-
Notifications
You must be signed in to change notification settings - Fork 0
Create Week8 Mission 1, 2 #102
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
Conversation
hyesngy
left a comment
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.
์ด๋ฒ ์ฃผ ์ํฌ๋ถ์ ํตํด React์ ์ฑ๋ฅ ์ต์ ํ ๊ธฐ๋ฒ์ธ debounce์ throttle์ ์ ์ฉํด๋ดค์ต๋๋ค! ์ฝ์ง ์์ ๊ฐ๋
์ด์ง๋ง ๋ชจ๋ ์ ํด๋ด์
์ ๋๋จํฉ๋๋ค! ๐๐ป๐๐ป๐๐ป
์ด๋ฐ ์ต์ ํ ๊ธฐ๋ฒ๋ค์ ์ค์ ์๋น์ค์์ UX๋ฅผ ํฌ๊ฒ ํฅ์์ํค๋ ์์์ ๋๋ค. ์์ผ๋ก ์์ ๋ฐ๋ชจ๋ฐ์ด ํ๋ก์ ํธ์์๋ ๊ผญ ํ์ฉํด์ ๊ตฌํํด๋ณด๋ฉด ์ข๊ฒ ์ต๋๋ค!๐๐ป๐๐ป๐๐ป
| const searchLpsResult = useInfiniteSearchLps({ | ||
| searchType: "title", | ||
| keyword: debouncedKeyword, | ||
| order, | ||
| }); | ||
|
|
||
| const tagLpsResult = useInfiniteTagSearchLps({ | ||
| tagName: debouncedKeyword, | ||
| order, | ||
| }); |
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.
ํ์ฌ search.tsx์์ useInfiniteSearchLps์ useInfiniteTagSearchLps ๋ ๊ฐ์ ํ
์ ์ฌ์ฉํ๊ณ , ๊ฐ๊ฐ์ ํ
์์ ๊ฑฐ์ ๋์ผํ ๋ฌดํ ์คํฌ๋กค ๋ก์ง์ ์ค๋ณต ๊ตฌํํ๊ณ ์์ต๋๋ค. useInfiniteSearchLps ๋ด๋ถ์์ ์ด๋ฏธ searchType์ ๋ฐ๋ผ ๋ค๋ฅธ API๋ฅผ ํธ์ถํ๋ ๋ก์ง์ด ์์์๋ ๋ถ๊ตฌํ๊ณ , ํ๊ทธ ๊ฒ์๋ง์ ์ํ ๋ณ๋ ํ
์ ๋ ๋ง๋ค์ด ์ฌ์ฉํ๊ณ ์๋๋ฐ, ์ด๋ ์ฝ๋๊ฐ ์ค๋ณต๋๊ณ ์ ์ง๋ณด์์ฑ ์ธก๋ฉด์์ ์ข์ง ์์ต๋๋ค.
์ฝ๋ ์ผ๊ด์ฑ์ ์ํด ํ๋์ ํ ์ผ๋ก ํตํฉํ์ฌ ๊ด๋ฆฌํ๋ ๊ฒ์ด ์ข์ ๊ฒ ๊ฐ์ต๋๋ค!
| <div className="flex justify-end w-full mb-4 pr-20"> | ||
| <div className="flex border rounded overflow-hidden"> | ||
| <button | ||
| onClick={() => handleOrderChange("asc")} | ||
| className={`w-24 px-4 py-1 text-sm ${order === "asc" ? "bg-black text-white" : "bg-white text-black"}`} | ||
| > | ||
| ์ค๋๋์ | ||
| </button> | ||
| <button | ||
| onClick={() => handleOrderChange("desc")} | ||
| className={`w-24 px-4 py-1 text-sm ${order === "desc" ? "bg-black text-white" : "bg-white text-black"}`} | ||
| > | ||
| ์ต์ ์ | ||
| </button> | ||
| </div> | ||
| </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.
ํ์ฌ search.tsx์ home.tsx์์ ์ ๋ ฌ ๋ฒํผ UI๊ฐ ์ค๋ณต๋๊ณ ์๋๋ฐ, ์ด ๋ถ๋ถ์ ๋ณ๋์ SortButton ์ปดํฌ๋ํธ๋ก ๋ถ๋ฆฌํ๋ฉด ์ฝ๋ ์ค๋ณต์ ์ค์ด๊ณ ์ผ๊ด๋ UI๋ฅผ ์ ์งํ ์ ์์ ๊ฒ ๊ฐ์ต๋๋ค.
๐ ๋ฏธ์ ๋ฒํธ
8์ฃผ์ฐจ Misson 1,2
๐ ๊ตฌํ ์ฌํญ
๐ ์คํฌ๋ฆฐ์ท
โ ์ฒดํฌ๋ฆฌ์คํธ
๐ค ์ง๋ฌธ ์ฌํญ