-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weโll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[4์ฃผ์ฐจ-TS] ๐ค๋ ธ์ธ์ฝ๋๋ฐฉ๐ค #7
base: main
Are you sure you want to change the base?
Conversation
์ค๋๋ ํ ํ ๋๋์ ๋ชธ์ ์ค์ฒ ์ค์ธ ์นํํธ์ ! ํ์ดํ
:) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
๋ฉ์ง๋ค์ !!!!! ํ์ ์ ๋๋ก ๋ฆฌ๋ทฐํ๊ฒ ์๋๋ค!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
๋ฉ์ ธ์ฌ !!!!! ์ค์ผ๋ ํค์ ts๊น์ง ์ผ๋ฌด์ง๊ฒ ์ ์ฐ์ ๊ฒ ๊ฐ์ต๋ฏธ๋ค !!!!
- ์๋์ผ๋ก ํ์ ์ถ๋ก ์ด ๋๋ฉด ๊ตณ์ด ํ์ ์ ๋ช ์ํด์ฃผ์ง ์์๋ ๊ด์ฐฎ์์ง ๊ถ๊ธํฉ๋๋ค!
- ๋ค๋ฅธ ์ธ์ด๋ค๊ณผ๋ ๋ฌ๋ฆฌ ํ์ ์คํฌ๋ฆฝํธ๋ ํ์ ์ถ๋ก ์ด ๋๋๋ก ์ ๋ํ๊ณ , ํ์ ์ด ์ถ๋ก ๋๋ ๊ฒฝ์ฐ ๊ตณ์ด ํ์ ์ ๋ช ์ํด์ฃผ์ง ์๋ ๊ฒ์ด ์ปจ๋ฒค์ ์ธ ๊ฒ ๊ฐ์ต๋๋ค. ๊ทธ๋ฐ๋ฐ ์ ๋ ์ด ๋ถ๋ถ์ ๋ํด ๋ช ํํ๊ฒ ์ ๊ทธ๋ ๊ฒ ํ๋ ์ง ์ด์ ๋ฅผ ์ ๋ชจ๋ฅด๊ฒ ์ต๋๋ค. ์๋ํ๋ฉด ํ์ธ์ด์์ ํ์ ์ด ์ถ๋ก ๋๋ ์์ํ์ ๋ค๋
์ฝ๋์ ๋ช
์์ ์ผ๋ก ํ์
์ ๋ํ๋ด๊ธฐ ์ํด (์ฌ๋์ ์ํด)
์ปดํ์ผ ๋จ๊ณ์์ ๋ถํ์ํ ํ์
์ถ๋ก ๋จ๊ณ๋ฅผ ์ค์ด๊ธฐ ์ํด (์ปดํจํฐ๋ฅผ ์ํด)
- ์์ ๊ฐ์ ์ด์ ๋ค๋ก ํญ์ ํ์ ์ ๋ช ์ํ ๊ฒ์ ๊ถ์ฅํ๊ณ ์๋ ๊ฒฝ์ฐ๋ค์ด ๋ง๋๋ผ๊ตฌ์. ์ด๋ ํ ์ด์ ๋ก ํ์ ์คํฌ๋ฆฝํธ์์๋ ํ์ ์ถ๋ก ์ด ์ปจ๋ฒค์ ์ด ๋ ๊ฒ์ธ์ง๋ .. ์ ๋ ์๊ฐ์ ๋๋ ๋ณด๊ณ ์ถ์ ์ฃผ์ ์ธ ๊ฒ ๊ฐ์์
- components ํด๋์ ์ปดํฌ๋ํธ๋ค์ ๋ค์ด๋ฐ์ด ํน์ ์ด์ํ์ง ์์์ง ๊ถ๊ธํด์! ๊ฒ์ํ๋ ์์ญ, ๊ฒฐ๊ณผ๋ฅผ ๋ณด์ฌ์ฃผ๋ ์์ญ์ด๋ผ๋ ์๋ฏธ๋ก ~Section์ด๋ผ๊ณ ์ง์๊ธด ํ๋ฐ ์๋ช ์ด ์ ์ผ ์ด๋ ต๋๋ผ๊ณ ์?
- ์ด๊ฑด .. ํญ์ ์ ๋ง ์ด๋ ต๊ณ ๊ฐ์ธ ์ทจํฅ๋ ๋ฐ์๋๊ณ ์ปจ๋ฒค์ ๋ ๋ฐ์๋๋ ์์ญ์ธ ๊ฒ ๊ฐ์์. ๊ทผ๋ฐ ํ์ฌ ์ ๊ฐ์ธ์ ์ธ ์๊ฐ์ผ๋ก ์ด์ํ ์ปดํฌ๋ํธ ๋ช ์ ์๋ ๊ฒ ๊ฐ์ต๋๋ค !
- ResultSection.tsx ์ปดํฌ๋ํธ์์ api์์ฒญ ํ ๊ฒ์๊ฒฐ๊ณผ ์ถ๋ ฅํ ๋ ๋ฐ์ ๋ ๋ฐฉ๋ฒ ์ค์์ ๋ญ๊ฐ ๋ ๋์๊น์? ์๋๋ฉด ์๋ค๋ณด๋ค ๋ ์ข์ ๋ค๋ฅธ ํํ ๋ฐฉ๋ฒ์ด ์์๊น์?
- ์ด ๋ถ๋ถ ๋ฆฌ๋ทฐ์๋ ์ ๋ฆฌํด๋ณด์๋๋ฐ ๊ฐ๋ ์ฑ์ ์ํด ์ค์ฒฉ ์ผํญ์ฐ์ฐ์๋ฅผ ์ง์ํ๋ ๋ฐฉ์์ด ์ข์ ๊ฒ ๊ฐ๊ณ , ํน์ ์กฐ๊ฑด๋ถ ๋ ๋๋ง์ ๊ณ ๋ คํด๋ณด๋ ๊ฒ๋ ์ข์ ๊ฒ ๊ฐ์ต๋๋ค!
{isLoading && | ||
new Array(10).fill(1).map((_, idx) => { | ||
return <Skeleton key={idx} />; | ||
})} | ||
{!isLoading && storeInfo.length === 0 ? ( | ||
<div style={{ color: "#fff" }}>๊ฒ์ ๊ฒฐ๊ณผ๊ฐ ์์ต๋๋ค.</div> | ||
) : ( | ||
storeInfo?.map((store: Store, idx: number) => ( | ||
<StoreCard key={idx} store={store} isCheck={isCheck} /> | ||
)) | ||
)} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
์ค ๊ฐ์ธ์ ์ผ๋ก ์ค์ฒฉ ์ผํญ์ฐ์ฐ์๋ณด๋ค &&์ ์ผํญ์ฐ์ฐ์๋ฅผ ํจ๊ป ์ด ์ด ๋ฐฉ์์ด ํ์คํ ์ข ๋ ๊ฐ๋ ์ฑ ์ข์ ๋ฐฉ์์ธ ๊ฑฐ ๊ฐ์์!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
๋ณดํธ์ ์ผ๋ก ๋ง์ด ์ฐ์ด๋ eslint airbnb js ์คํ์ผ ๊ฐ์ด๋์ ์๋์ ๊ฐ์ ๋ฃฐ์ด ์๋๋ฐ ํ ๋ฒ ์ฝ์ด๋ด๋ ์ข์ ๊ฒ ๊ฐ์์! (๋ฌผ๋ก ์ด ๊ฐ์ด๋๋ ์ ๋ ์ ๋ต์ด ์๋๊ณ ํ์
ํ ๋๋ง๋ค ๋ค๋ฅธ lint๋ฃฐ์ ์ฌ์ฉํ๊ฒ ๋ ๊ฑฐ๋ผ ์ ๋ง ์ฐธ๊ณ ์ฉ์
๋ฏธ๋ค ! )
https://github.com/parksb/javascript-style-guide
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
์ฐธ๊ณ ํ๊ฒ ์ต๋๋ค ๊ณ ๋ง์์!!
{isLoading && | ||
new Array(10).fill(1).map((_, idx) => { | ||
return <Skeleton key={idx} />; | ||
})} | ||
{!isLoading && storeInfo.length === 0 ? ( | ||
<div style={{ color: "#fff" }}>๊ฒ์ ๊ฒฐ๊ณผ๊ฐ ์์ต๋๋ค.</div> | ||
) : ( | ||
storeInfo?.map((store: Store, idx: number) => ( | ||
<StoreCard key={idx} store={store} isCheck={isCheck} /> | ||
)) | ||
)} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
{isLoading && | |
new Array(10).fill(1).map((_, idx) => { | |
return <Skeleton key={idx} />; | |
})} | |
{!isLoading && storeInfo.length === 0 ? ( | |
<div style={{ color: "#fff" }}>๊ฒ์ ๊ฒฐ๊ณผ๊ฐ ์์ต๋๋ค.</div> | |
) : ( | |
storeInfo?.map((store: Store, idx: number) => ( | |
<StoreCard key={idx} store={store} isCheck={isCheck} /> | |
)) | |
)} | |
if(isLoading) { | |
new Array(10).fill(1).map((_, idx) => { | |
return <Skeleton key={idx} />; | |
}) | |
} else { | |
return ( | |
<> | |
{storeInfo.length === 0 ? ( | |
<div style={{ color: "#fff" }}>๊ฒ์ ๊ฒฐ๊ณผ๊ฐ ์์ต๋๋ค.</div> | |
) : ( | |
storeInfo?.map((store: Store, idx: number) => ( | |
<StoreCard key={idx} store={store} isCheck={isCheck} /> | |
)) | |
)} | |
</> | |
) | |
} |
ํน์ ์ด๋ฐ ์์ผ๋ก ์กฐ๊ฑด๋ถ ๋ ๋๋ง์ ํ๋ ๋ฐฉ์๋ ์์ ๊ฒ ๊ฐ์์ฌ !
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ํน์ ๋์ค์ ์๋ฒ์ฌ์ด๋ ๋ฐ์ดํฐ ์ฒ๋ฆฌ ์ํ๋ฅผ ๋ก๋ฉ ์ํ ๋ฟ๋ง ์๋๋ผ ์๋ฌ ์ํ๊น์ง ํ์ฅ์ํจ๋ค๋ฉด ์ด๋ฐ ์์ผ๋ก switch-case๋ฌธ์ ์ด์ฉํ ์กฐ๊ฑด๋ถ๋ ๋๋ง์ ํ ์๋ ์์ ๊ฒ ๊ฐ์์ !
function Result({ isEmpty, keywordLocationData, status }: ResultProps) {
switch (status) {
case 'LOADING':
return <Loading />;
case 'ERROR':
return <ErrorFallback />;
default:
return isEmpty ? <NoResult /> : <CardList keywordLocationData={keywordLocationData} />;
}
}
๊ทผ๋ฐ ์ฌ์ค ์ด๊ฑฐ ๋ค ๊ฐ ์ทจ์ธ ์์ญ์ด๋ผ ์ ๋ต์ ์์ด์ ๊ฐ ์ทจ๋๋ก ๊ฐ๊ธฐ๋ฉด ๋ ๊ฑฐ ๊ฐ๊ธด ํด์ฌ ใ ใ
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
์ ์ ๋ ๊ฒ ํ๋ฉด ๋๋๊ตฌ๋ ใ
ใ
์ ๋ฐ์์ผ๋ก ๊ฐ๊ฒจ๋ณผ๊ฒ์ฌ
switch๋ฌธ ์ํ ์ฒ๋ฆฌ ์ฝ๋๋ ์ฐธ๊ณ ํ ๊ฒ์ ๊ฐ์ผ๋ท!
const [isCheck, setIsCheck] = useState<boolean>(false); | ||
const [myTown, setMyTown] = useState<string>(""); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
state๋ก input value๋ฅผ ๊ด๋ฆฌํ๊ณ ์๋ค๋ฉด useInput๊ฐ์ ์ปค์คํ ํ ์ ์ ์ํด์ ์ฌ์ฉํด๋ ์ข์ ๊ฒ ๊ฐ์์!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
์ปค์คํ ํ ์ ๊ดํด์ https://react.vlpt.us/basic/21-custom-hook.html ์ด๋ฐ ์๋ฃ๋ค ๋ณด๋ฉด ์ข์ ๊ฒ ๊ฐ์์ฌ !
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
์ด๋ฒ ๊ธฐํ์ ์ปค์คํ ํ ์ ํ ๋ฒ ์๋ํด๋ณผ๊ฒ์ฌ
background-color: #bdbdbd; | ||
`; | ||
|
||
export default Skeleton; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ํฌ. .. .์ค์ผ๋ ํค ๋ฉ์์ด์ฌ
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
๋ฐ๋ธ์คํค์ด ๋ ๋ฉ์์ด์ฌ
return ( | ||
<StWrapper> | ||
<StCheckBoxWrapper> | ||
<label htmlFor="checkbox">์ง์ญ ๊ธฐ๋ฐ์ผ๋ก ๊ฒ์</label> | ||
<input | ||
type="checkbox" | ||
id="checkbox" | ||
onChange={() => setIsCheck(!isCheck)} | ||
/> | ||
</StCheckBoxWrapper> | ||
|
||
<StTextInputWrapper> | ||
<label htmlFor="text">์ฐ๋ฆฌ ๋๋ค๋ ์ฌ๊ธฐ์์</label> | ||
<input | ||
type="text" | ||
placeholder="์ง์ญ์ ์ ๋ ฅํด์ฃผ์ธ์." | ||
disabled={isCheck} | ||
value={myTown} | ||
onChange={(e) => setMyTown(e.target.value)} | ||
/> | ||
</StTextInputWrapper> | ||
|
||
<StSearchButton type="button" onClick={() => onClick(isCheck, myTown)}> | ||
๊ฒ์ํ๊ธฐ | ||
</StSearchButton> | ||
</StWrapper> | ||
); | ||
} | ||
|
||
const StWrapper = styled.div` | ||
display: flex; | ||
flex-direction: column; | ||
justify-content: center; | ||
align-items: center; | ||
padding: 10px 0; | ||
gap: 10px; | ||
font-size: 20px; | ||
color: #fff; | ||
border-bottom: 2px solid #fff; | ||
width: 100%; | ||
`; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
์ด ๋ถ๋ถ formํ ๊ทธ๋ก wrappingํด์ ์ฌ์ฉํ๋ฉด ์ข์ ๊ฒ ๊ฐ์์!
return ( | |
<StWrapper> | |
<StCheckBoxWrapper> | |
<label htmlFor="checkbox">์ง์ญ ๊ธฐ๋ฐ์ผ๋ก ๊ฒ์</label> | |
<input | |
type="checkbox" | |
id="checkbox" | |
onChange={() => setIsCheck(!isCheck)} | |
/> | |
</StCheckBoxWrapper> | |
<StTextInputWrapper> | |
<label htmlFor="text">์ฐ๋ฆฌ ๋๋ค๋ ์ฌ๊ธฐ์์</label> | |
<input | |
type="text" | |
placeholder="์ง์ญ์ ์ ๋ ฅํด์ฃผ์ธ์." | |
disabled={isCheck} | |
value={myTown} | |
onChange={(e) => setMyTown(e.target.value)} | |
/> | |
</StTextInputWrapper> | |
<StSearchButton type="button" onClick={() => onClick(isCheck, myTown)}> | |
๊ฒ์ํ๊ธฐ | |
</StSearchButton> | |
</StWrapper> | |
); | |
} | |
const StWrapper = styled.div` | |
display: flex; | |
flex-direction: column; | |
justify-content: center; | |
align-items: center; | |
padding: 10px 0; | |
gap: 10px; | |
font-size: 20px; | |
color: #fff; | |
border-bottom: 2px solid #fff; | |
width: 100%; | |
`; | |
return ( | |
<StForm onSubmit={(e) => onClick(isCheck, myTown, e)}> | |
<StCheckBoxWrapper> | |
<label htmlFor="checkbox">์ง์ญ ๊ธฐ๋ฐ์ผ๋ก ๊ฒ์</label> | |
<input | |
type="checkbox" | |
id="checkbox" | |
onChange={() => setIsCheck(!isCheck)} | |
/> | |
</StCheckBoxWrapper> | |
<StTextInputWrapper> | |
<label htmlFor="text">์ฐ๋ฆฌ ๋๋ค๋ ์ฌ๊ธฐ์์</label> | |
<input | |
type="text" | |
placeholder="์ง์ญ์ ์ ๋ ฅํด์ฃผ์ธ์." | |
disabled={isCheck} | |
value={myTown} | |
onChange={(e) => setMyTown(e.target.value)} | |
/> | |
</StTextInputWrapper> | |
<StSearchButton type="submit"> | |
๊ฒ์ํ๊ธฐ | |
</StSearchButton> | |
</StForm> | |
); | |
} | |
const StForm = styled.form` | |
display: flex; | |
flex-direction: column; | |
justify-content: center; | |
align-items: center; | |
padding: 10px 0; | |
gap: 10px; | |
font-size: 20px; | |
color: #fff; | |
border-bottom: 2px solid #fff; | |
width: 100%; | |
`; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
๊ทผ๋ฐ form tag๋ฅผ ์ฐ๊ณ onSubmit์ด๋ฒคํธ๋ฅผ ๋ฐ์์ํค๋ฉด ๋ํดํธ๋ก ๋ธ๋ผ์ฐ์ ์์ ์๋ก๊ณ ์นจํ๋ ๋์์ ๋ฃ์ด๋ฒ๋ ค์ onSubmit์ด๋ฒคํธ ๋ด๋ถ์ ๋ค์ด์๋ ํจ์์์ ๊ทธ๋ฐ ๋ถํ์ํ ๋ํดํธ ๋์์ ๋ง์์ค์ผ ํ๋๋ฐ (SPA์์ ์๋ก๊ณ ์นจ์ ๋ถํ์ํ ๋์์ด๋๊น์ฌ !) ๊ทธ๋ฌ๊ธฐ ์ํด์
- ์ผ๋จ event์ธ์๋ฅผ ๋ฐ์์ฃผ๋๋ก ์์ ํ๊ณ ,
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
์ 7์ฃผ์ฐจ ๊ณผ์ ์์ ์ด๋ฐ ์์ผ๋ก ์งฐ์๋๋ฐ ์ด๊ฒ๋ ๊ทธ๋ ๊ฒ ๋ฐ๊ฟ๋ณผ๊ฒ์!
์ด ๋ฐฉ๋ฒ์ด ๋ ์ข์๋ณด์ด๋ค์
const [isChecked, setIsChecked] = useState<boolean>(false); | ||
const [isLoading, setIsLoading] = useState(false); | ||
|
||
const onClickSearchButton = (isCheck: boolean, myTown: string) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
๋ธ๋ผ์ฐ์ ๊ฐ ์๋ก๊ณ ์นจ๋๋ ์ด๋ฒคํธ ๋ํดํธ ๋์์ ๋ง๊ธฐ ์ํด
const onClickSearchButton = (isCheck: boolean, myTown: string) => { | |
const onClickSearchButton = (isCheck: boolean, myTown: string, e:React.FormEvent<HTMLFormElement>) => { | |
e.preventDefault(); |
- ์ด๋ฐ ์์ผ๋ก event๋ฅผ ๋ฐ์์
e.preventDefault();
๋ฅผ ํตํด ๋ํดํธ ์ด๋ฒคํธ๋ฅผ ๋ง์์ฃผ๋ฉด ์ข์ ๊ฒ ๊ฐ์ต๋ฏธ๋ค!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
๊ฐ์๋์ด์์๐ฃ๐๐๐
๊ฒฐ๊ณผ๋ฅผ ๋ณด์ฌ์ฃผ๋ ์์ญ์ด๋ผ๋ ์๋ฏธ๋ก ~Section์ด๋ผ๊ณ ์ง์๊ธด ํ๋ฐ
๋๋ ๊ทธ๋ ๊ฒ ์ง์๋ ๊ฒ ๊ฐ์๋ฐ ๋ ๊ฐ์ ๊ฒฝ์ฐ์๋
- ํด๋น ํ์ด์ง์ 3๊ฐ์ section๋ง ์กด์ฌํ์ฌ ์๊ณ๊ฐ ๊ฐ์
- ๊ฐ๊ฐ ์๋ฉํฑ ํ๊ทธ section์ ์ฌ์ฉํ ๊ฒ์
์ด๋ฐ ์ด์ ๋ก ๊ทธ๋ ๊ฒ ๋ค์ด๋ฐ ํ๋ ๊ฒ ๊ฐ์!
1, 3๋ฒ ๋ถ๋ถ์ ๋ํ๊ฐ ์ค๋ช ์ ํด์ค ๊ฒ ๊ฐ๋ค์!!!! ๋ฐฐ์๊ฐ๋ฏธ๋ค....๋์ปค๋ฐ๐คฉ๐คฉ @Nahee-Park
"dependencies": { | ||
"@types/styled-components": "^5.1.25", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ํ์
๊ด๋ จ ์์กด์ฑ์ ๊ฐ๋ฐํ๊ฒฝ์์ ํ์ํ๊ธฐ ๋๋ฌธ์ devDependencies
์ ์ ์ธํด์ฃผ์ด๋ ์ข์
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
์ํ ์คํค์คํค
return data.documents; | ||
}; | ||
|
||
export const getStoreBasedTown = async (town: string): Promise<Store[]> => { | ||
const { data } = await api.get("", { | ||
params: { | ||
query: `${town} ๋ ธ๋๋ฐฉ`, | ||
}, | ||
}); | ||
return data.documents; | ||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
getLocationBasedSearch
์ geStoreBasedTown
ํจ์๊ฐ params ๋ฅผ ์ ์ธํ๊ณ ๋น์ทํด๋ณด์ด๋๋ฐ
getQueryParams์ด์ฉ๊ตฌ
๋ก params ๋ฅผ ์ ์ธํด์ฃผ๊ณ ํตํฉ์์ผ์ฃผ๋ ๋ฐฉ๋ฒ๋ ์์ ๊ฒ ๊ฐ๋ค!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
๊ทธ๋ ๊ฒ ๋ฌถ์ด๋ด์ผ๊ฒ ๋ค ๊ณ ๋ง์!
</StWrapper> | ||
); | ||
} | ||
const StWrapper = styled.div` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
์๋ฉํฑ ํ๊ทธ๋ ํจ ๊ณ ๋ คํด๋ณด์ฌ์ด ์ด๋จ๊น์,!
const StWrapper = styled.div` | |
const StWrapper = styled.main` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
์! ๊ฐ์ฌํฉ๋๋ค ๋์ฐ๋ฏธ์ข๋ค์
} | ||
|
||
& > .info__address { | ||
max-width: 150px; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
์คํธ ํด๋์ค๋ช ์ผ๋ก ์ ์ธํด์ฃผ์ ์ด์ ๊ฐ ๊ถ๊ธํฉ๋๋ค
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
๋ ธ๋๋ฐฉ ์นด๋ ์์ ์ ๋ณด ์ค์์ ์ ๋ชฉ ๋นผ๊ณ ๋๋จธ์ง๋ฅผ ๋ค pํ๊ทธ๋ก ํด๋์ class๋ก ๊ตฌ๋ถํ๋๋ฐ nth-child๋ก ๋ฐ๊พธ๋๊ฒ ๋ ์ข์๊น์?๊ทธ๋๋ nth-child๊ฐ ์๊ฐ์ด ์๋ฌ์๋๋ค ใ ใ ใ
+) ๊ทธ๋ฅ ์ค์ปดํฌ๋ํธ๋ก ๋ง๋๋๊ฒ ๋ซ๊ฒ ๋ค๊ณ ์๊ฐ์ด ๋ค์์ต๋๋ค
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
SC ๋ง๋ค๊ธฐ ์ค์ผ์ด ~~~~
|
||
return ( | ||
<StCard> | ||
<a href={place_url || undefined}>{place_name}</a> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
undefined
์ต์
๋์ ๋ถ์ฌ์ค ์ด์ ๊ฐ ๊ถ๊ธํฉ๋๋ค !!
<a href={place_url || undefined}>{place_name}</a> | |
<a href={place_url}>{place_name}</a> |
API ์ place_url
์ด ์๋ ๊ฒ ๋๋ฌธ์ด๋ผ๋ฉด ์๋์ฒ๋ผ ์์ฑํ๋ ๊ฒ ๋ ๋ช
์์ ์ด์ง ์์๊น ํฉ๋๋ค! (css ์ฝ๋๊ฐ ์กฐ๊ธ ๋ณ๊ฒฝ๋ ์ ์๊ฒ ๋ค์,!)
<a href={place_url || undefined}>{place_name}</a> | |
{place_url && <a href={place_url}>{place_name}</a>} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ํ์ธํด๋ณด๋๊น ๋ถํ์ํ ๋ถ๋ถ์ด๋ค์... ๊ผผ๊ผผํ์ง ๋ชปํ๋ค์
๋ง์ฝ ํด๋น ๋ฐ์ดํฐ๋ฅผ ์ค ์๋ ์๊ณ ์ ์ค์๋ ์๋ ๊ฒฝ์ฐ๋ผ๋ฉด ์ข๋์ด ๋ฐ์ ์จ์ฃผ์ ์ฝ๋๋ก ์์ฑํ๋๋ก ํ ๊ฒ์!๐
<label htmlFor="text">์ฐ๋ฆฌ ๋๋ค๋ ์ฌ๊ธฐ์์</label> | ||
<input | ||
type="text" | ||
placeholder="์ง์ญ์ ์ ๋ ฅํด์ฃผ์ธ์." |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
์ฌ๊ธด id ์์ฑ์ด ๋น ์ง ๊ฒ ๊ฐ๋ค์??
<label htmlFor="text">์ฐ๋ฆฌ ๋๋ค๋ ์ฌ๊ธฐ์์</label> | |
<input | |
type="text" | |
placeholder="์ง์ญ์ ์ ๋ ฅํด์ฃผ์ธ์." | |
<label htmlFor="text">์ฐ๋ฆฌ ๋๋ค๋ ์ฌ๊ธฐ์์</label> | |
<input | |
type="text" | |
id="text" | |
placeholder="์ง์ญ์ ์ ๋ ฅํด์ฃผ์ธ์." |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
์๋ ฅ 3.0์ด์ธ์??
export default function ResultSection({ | ||
storeInfo, | ||
isCheck, | ||
isLoading, | ||
}: ResultSectionProps) { | ||
return ( | ||
<> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
์ปจ๋ฒค์ ์ฐจ์ด์ด์ง๋ง, ์๋์ฒ๋ผ ์ ์ธํ๊ธฐ๋ ํฉ๋๋ค! ๊ฐ๋ ์ฑ์ด ์ข๋ค๋ ์๊ฒฌ์ด ์๋ ๊ฒ ๊ฐ์์,, ๋ ์ฃผํจ
export default function ResultSection({ | |
storeInfo, | |
isCheck, | |
isLoading, | |
}: ResultSectionProps) { | |
return ( | |
<> | |
export default function ResultSection(props: ResultSectionProps) { | |
const {storeInfo, isCheck, isLoading} = props | |
return ( | |
<> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
์ค..ํจ์ฌ ๋ณด๊ธฐ ํธํ๋ค์ ๊ฐ์ฌํฉ๋๋ค!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
๋ค๋ฅธ ์ธ์ด๋ค๊ณผ๋ ๋ฌ๋ฆฌ ํ์ ์คํฌ๋ฆฝํธ๋ ํ์ ์ถ๋ก ์ด ๋๋๋ก ์ ๋ํ๊ณ , ํ์ ์ด ์ถ๋ก ๋๋ ๊ฒฝ์ฐ ๊ตณ์ด ํ์ ์ ๋ช ์ํด์ฃผ์ง ์๋ ๊ฒ์ด ์ปจ๋ฒค์ ์ธ ๊ฒ ๊ฐ์ต๋๋ค. ๊ทธ๋ฐ๋ฐ ์ ๋ ์ด ๋ถ๋ถ์ ๋ํด ๋ช ํํ๊ฒ ์ ๊ทธ๋ ๊ฒ ํ๋ ์ง ์ด์ ๋ฅผ ์ ๋ชจ๋ฅด๊ฒ ์ต๋๋ค.
์ ๋ ๊ถ๊ธํด์ ์ฌ๊ธฐ์ ๊ธฐ ์ฐพ์๋ดค๋๋ฐ,
๋ค๋ฅธ ์ธ์ด๋ค๊ฐ์ ๊ฒฝ์ฐ์๋ ๋ฉ๋ชจ๋ฆฌ ์์ญ์ ์ํด ํ์
์ง์ ์ด ํ์์ ์ด๋ฏ๋ก ๋ช
์์ ์ผ๋ก ์ง์ ํด์ฃผ๋ ๊ฒ ๊ฐ๊ณ
์๋ฐ์คํฌ๋ฆฝํธ์ ํ์
์คํฌ๋ฆฝํธ๋ ๋ฉ๋ชจ๋ฆฌ ํ ๋น ๋ฐฉ์์ด ๋ค๋ฅด๋ฏ๋ก ์๊ธด ์ปจ๋ฒค์
์ฐจ์ด๊ฐ ์๋๊น ํฉ๋๋ค!
๋ช
์์ ์ผ๋ก๋ ์์์ ์ผ๋ก๋ ํ์
๋ถ์ฌํด์ฃผ๋ ๋ฐฉ์ ๋ ๋ค ์ฅ๋จ์ ์ด ์์ผ๋ ๋ชฉ์ ์ ๋ฐ๋ผ ์ ์ฐํ๊ฒ ์ฐ๋ ๊ฒ ๋ง๋ ๊ฒ ๊ฐ์์
์ด๋ฅผ ์ํด ๋ช
์์ ํ์
์ง์ ์ ์ํ ๋ฆฐํธ์ ์์์ ํ์
์ง์ ์ ์ํ ๋ฆฐํธ๋ค์ด ๋๊ตฌ๋ก์จ ์๋ ๊ฒ ๊ฐ๊ธฐ๋ ํ๋ค์!!
โจ ๊ตฌํ ๊ธฐ๋ฅ ๋ช ์ธ
๐ PR Point
์ง๋ฌธ์์ด์
!isLoading
์ด ์ค๋ณต๋จ๐ญ ์ด๋ ค์ ๋ ์
๐ ๊ตฌํ ๊ฒฐ๊ณผ๋ฌผ
Vite.App.-.Chrome.2022-06-25.00-26-29_Trim.mp4