-
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
Implement lecture search/#10 #46
Conversation
๐storybook: https://65ccb85d5afe55a024495bc0-axtyjslool.chromatic.com/ |
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 ( | ||
<div className="rounded-2xl border-[1px] border-black-2 w-full"> | ||
<div className={twMerge('rounded-xl border-[1px] border-gray-300 w-full ', isScrollList && 'h-72 overflow-auto')}> |
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.
isScrollList && 'h-72 overflow-auto
์ ์์ด ๊ฑฐ์ง์ธ ๊ฒฝ์ฐ์๋ className์ false๊ฐ๋ ๋ค์ด๊ฐ๋๋ผ๊ณ ์! ์ ๋ ์ต๊ทผ์ ์๊ฒ ๋ ์ ์ด๋ผ์ &&
๋
ผ๋ฆฌ์ฐ์ฐ์๋ฅผ ์ฌ์ฉํ๊ณ ์ถ์๋๋ cn
์ฐ์ฐ์๋ฅผ ์ฌ์ฉํฉ๋๋ค.
cn
utilํจ์๋ shadcn์ค์ ์ ์งํํ๋ฉด์ app>utils/shadcn/utils.ts ๋ด๋ถ์ ์ด๋ฏธ ์์นํด์ ธ์์ผ๋ฉฐ, cnํจ์๊ฐ twMerge
์ clsx๋ฅผ ์กฐํฉํ ๊ฒ์ด๊ธฐ ๋๋ฌธ์ false๋ฅผ filteringํ๋ ๊ฒ๋ ๊ฐ๋ฅํฉ๋๋ค :)
<div className={twMerge('rounded-xl border-[1px] border-gray-300 w-full ', isScrollList && 'h-72 overflow-auto')}> | |
<div className={cn('rounded-xl border-[1px] border-gray-300 w-full ', isScrollList && 'h-72 overflow-auto')}> |
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.
๊ฐ์ฌํฉ๋๋ค ์์ ํ์ต๋๋ค 0a9c473
@@ -1,8 +1,17 @@ | |||
export type LectureInfo = { | |||
export interface LectureInfo { | |||
[index: string]: string | number; |
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.
[index: string]: string | number;
์ด๋ป๊ฒ ์ฌ์ฉ๋๋์?
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.
object.keys ๋ฉ์๋๋ฅผ ์ฌ์ฉํ ๋ ์ฌ์ฉํ๋ key๋ string ํ์ ์ธ๋ฐ, ์ด string ํ์ ์ string literal type์ ํ ๋นํ๋ ค ํ๊ธฐ ๋๋ฌธ์ ์ค๋ฅ๊ฐ ๋ฐ์ํ์๊ณ ์ ๊ตฌ๋ฌธ์ ํตํด ํด๊ฒฐํ์ต๋๋ค
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.
ํด๋น ์ปดํฌ๋ํธ๋ ๋ฆฌํฉํ ๋ง์ ํตํด ๋ณ๊ฒฝ๋์์ต๋๋ค!
๐storybook: https://65ccb85d5afe55a024495bc0-kynwwdpktn.chromatic.com/ |
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์ด๋ค์. ์๊ณ ํ์ จ์ต๋๋ค ๐
text-input์ ์ฌ์ฉํ๋๋ฐ font size์ธ text-sm์ด ๋๋ฌด ์๋ค๊ณ ๋๊ปด์ง๋๋ค ์ด ๋ถ๋ถ variant๋ฅผ ํตํด ์กฐ์ ํด๋ ๊ด์ฐฎ์์ง ์ฌ์ญค๋ณด๊ณ ์ถ์ต๋๋ค
๋์ผํ๊ฒ ๊ฐ๋ฐ์ ์งํํ๋ฉด์ ๋ถํธ์ ๋๊ผ๋ ๋ถ๋ถ์ ๋๋ค! ํ ๋ช ์ด ๋ด๋นํด์ ์ ์ฒด์ ์ธ buttonํฌ๊ธฐ์ ๋ํ refactoring์ ์งํํ๋ ๊ฒ์ด ์ข๋ค๊ณ ์๊ฐ์ด ๋ญ๋๋ค.
๊ฒ์ํ๊ธฐ ๋ฒํผ์ด ์์ผ๋ฉด ๋์์ธ์ด ์์์๋ค๊ณ ์๊ฐํด์ ์ ๊ฑฐํ์ต๋๋ค. ๊ผญ ๊ฒ์ํ๊ธฐ ๋ฒํผ์ด ํ์ํ ์ด์ ๋ ๋ชจ๋ฅด๊ฒ ๋๋ผ๊ตฌ์
๋ง์ํ์ ์๊ฒฌ๊ณผ ๊ฐ์ด ๊ฒ์ํ๊ธฐ ๋ฒํผ์ด ์๋ ๊ฒ์ด UI/UX์ธก๋ฉด์์ ์ ๋ฆฌํ๋ค๊ณ ์๊ฐ์ด ๋ญ๋๋ค. ์ด๋ฅผ ์ํด์๋ debouncing
๋ฐ enter
๋ฅผ ํตํ apiํธ์ถ๋ง ๋ฐ์๋์ด์ผ ํ ๊ฒ ๊ฐ์๋ฐ, ๋๊ฐ์ง ๊ธฐ๋ฅ ๋ชจ๋ ๊ณํํ๊ณ ๊ณ์ ์ง ๊ถ๊ธํฉ๋๋ค!
๋น ์ถํ์ ๋ ๊ฐ์ง ๊ธฐ๋ฅ ๋ฐ์ ํ ์์ ์
๋๋ค! |
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.
- ์๊ณ ํ์ จ์ต๋๋ค.
- ๋ณด๋ฉด์ ๋๋์ ์, ์ด๋ฒ ๋ฆฌํฉํ ๋ง์ ํตํ ๊ฐ์ฅ ํฐ ๊ฐ์ ์ ์ ๊ฐ๋ ์ฑ์ด๋ผ๊ณ ์๊ฐ์ด ๋ค์ด์. ๊ฐ ์ปดํฌ๋ํธ๊ฐ ์ด๋ค ์ฑ ์์ ์ํํ๋์ง ์ฝ๋๋ฅผ ์ฝ๋ ์ฌ๋์ด ํฌ๊ฒ ๊ณ ๋ฏผํ ํ์ ์์ด ์ฝ๊ฒ ์ดํดํ ์ ์์์ต๋๋ค.
- ์ด๋ฐ ๊ตฌ์กฐ๋ผ๋ฉด ๋ณ๊ฒฝ์ฌํญ์ด ์๊ฒผ์ ๋๋, ์ฝ๋๋ฅผ ์ดํดํ๊ณ ๋ณ๊ฒฝํด์ผ ํ ์์น๋ฅผ ์ฝ๊ฒ ์ฐพ์ ์ ์์ ๊ฒ ๊ฐ์ต๋๋ค.
- ํ ๊ฐ์ง ๊ฑธ๋ฆฌ๋ ์ ์ด ์๋ค๋ฉด, taken-lecture ์ปดํฌ๋ํธ์์ lecture-search ์ปดํฌ๋ํธ๋ฅผ ํธ์ถํ๋ ๊ฒ์ด๋ค์. ๋์ผํ ์์ค์ ์ปดํฌ๋ํธ๋ฅผ ํธ์ถํ๋ ๊ฒ์ ํฐ ๋ฌธ์ ๊ฐ ๋์ง ์์ง๋ง, ์ด ๋ ์ปดํฌ๋ํธ๋ ๋ ์์ ์์ค์ ์ปดํฌ๋ํธ์ธ ํ์ด์ง ์ปดํฌ๋ํธ(์ปจํ ์ด๋)์์ ๊ฒฐํฉํ๋ ๊ฒ์ด ๋ ์ ํฉํด ๋ณด์ ๋๋ค.
- ๋ฒํผ ํฌ๊ธฐ๋ ํจ์จ์ฑ์ ์ํด ์ ๊ฒฝ์ด๊ฐ ๋ฆฌํฉํ ๋งํ๋ฉด ๋ ๊ฒ ๊ฐ๋ค์. ๋ฏธ๋ฆฌ ๊ณ ๋ง์์
const customButton = await screen.findByTestId('custom-button'); | ||
await userEvent.click(customButton); |
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.
[comment]
- ์ด๋ ๊ฒ 2์ค๋ก ๋๋ ์ ์์ฑํ ์ด์ ๊ฐ ์์๊น์?
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.
์ ๋ ํ ์ค์ ์์ฑํ ๊ฒ๋ณด๋ค ๋ ์ค์ ๋๋ ์ ์์ฑํ๋ ๊ฒ ์์ ์ ํ๋ฆ์ด ๋ ์ ์ฝํ๋ค๊ณ ์๊ฐํด์ ๊ทธ๋ ๊ฒ ์์ ํ์ต๋๋ค!
๊ทธ๋ ๋ค์! ์ปจํ
์ด๋์์ ๊ฒฐํฉํ๋ ๊ฒ ๋ ์ข์ ๊ฒ ๊ฐ์์ ์์ ํ์ต๋๋ค ๊ฐ์ฌํฉ๋๋ค:) |
๐storybook: https://65ccb85d5afe55a024495bc0-iichcqsgup.chromatic.com/ |
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.
- ํ์ธํ์ต๋๋ค.
- ํ ์คํธ ์ฝ๋์์ render() ํจ์๊ฐ ๋ ๋ฒ ์ฌ์ฉ๋๋ ๊ฒ์ ์กฐ๊ธ ์ผ๋ฐ์ ์ด์ง ์๋ค๊ณ ์๊ฐ์ด ๋ค๊ธด ํ์ผ๋, ์๋ฒ ์ปดํฌ๋ํธ๊ฐ ์์ง ์ง์๋์ง ์์์ ํน๋ณํ ๋ฐฉ์์ผ๋ก ์ฌ์ฉ๋๋ ์ํฉ์ด๊ธฐ ๋๋ฌธ์ ์ด์ฉ ์ ์๋ค๋ ์๊ฐ์ด ๋ญ๋๋ค.
๐ ์์ ๋ด์ฉ
์ดํ ๊ฒ์ ๊ธฐ๋ฅ ๊ตฌํ๊ณผ ์ปค์คํ ์ ์ฅ ๊ธฐ๋ฅ์ ์ฐจ๋ก๋๋ก ํ ์์ ์ ๋๋ค!
๐ค ๊ณ ๋ฏผ ํ๋ ๋ถ๋ถ
๐ ๋์์ด ํ์ํ ๋ถ๋ถ
๋ค์ด๋ฐ ๊ฐ์ ๊ฒฝ์ฐ๋ ์ด๋ํ๋ ๋ ผ์๋ฅผ ์ฐธ๊ณ ํ์ต๋๋ค
#42 (comment)
์ ๊ฐ ์งํ ํ ์ปดํฌ๋ํธ ๋ถ๋ฆฌ๊ฐ ๊ด์ฌ์ฌ๋ฅผ ์ ๋ถ๋ฆฌํ ๊ฒ์ธ์ง ํ์ ์ด ์๋๋ค์ ๋ค๋ฅธ ๋ถ๋ค ์๊ฒฌ ๋ ์ฃผ์๋ฉด ๊ฐ์ฌํ๊ฒ ์ต๋๋ค!
โ๏ธ๋ฆฌํฉํ ๋ง
๋ ผ์๋ฅผ ๊ธฐ๋ฐ์ผ๋ก ๋ฆฌํฉํ ๋ง์ ์งํํ์ต๋๋ค
์ ๋ ๋๋ง ์์ผฐ์ต๋๋ค