-
Notifications
You must be signed in to change notification settings - Fork 4
Feat/component/Dropdownfilter/DEVING-43 #23
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
Feat/component/Dropdownfilter/DEVING-43 #23
Conversation
|
The latest updates on your projects. Learn more about Vercel for Git โ๏ธ
|
Walkthrough๋๋กญ๋ค์ด ์ปดํฌ๋ํธ์ ๊ธฐ๋ฅ๊ณผ ์ฌ์ฉ ์์๊ฐ ์ ๋ฐ์ ์ผ๋ก ํฅ์๋์์ต๋๋ค. ์์ ํ์ด์ง์์๋ ์ํ ๊ด๋ฆฌ ๋ก์ง๊ณผ ํํฐ, ๋ฉ๋ด ์ต์ ์ด ์ ๋ฐ์ดํธ๋์ด ๋ค์ํ ์คํ์ผ์ ๋๋กญ๋ค์ด ์ฌ์ฉ๋ฒ์ ๋ณด์ฌ์ค๋๋ค. ๋ํ, ๊ณตํต ๋๋กญ๋ค์ด ์ปดํฌ๋ํธ๋ @radix-ui/react-dropdown-menu๋ฅผ ๋์ ํด ์ธํฐํ์ด์ค์ ๋ด๋ถ ์ํ ๊ด๋ฆฌ๊ฐ ์ฌ๊ตฌ์ฑ๋์์ผ๋ฉฐ, Header ์ปดํฌ๋ํธ์์๋ ๋ฉ๋ด ๋ฐฐ์ด ๊ตฌ์กฐ๊ฐ ๊ฐ์ ๋์ด ํ๋กํ ์ด๋ฏธ์ง ์ฒ๋ฆฌ ๋ฐฉ์์ด ์์ ๋์์ต๋๋ค. Changes
Sequence Diagram(s)sequenceDiagram
participant U as ์ฌ์ฉ์
participant T as ๋๋กญ๋ค์ด ํธ๋ฆฌ๊ฑฐ
participant D as ๋๋กญ๋ค์ด ๋ฉ๋ด (RadixUI)
participant S as ์ํ ๊ด๋ฆฌ
U->>T: ํธ๋ฆฌ๊ฑฐ ํด๋ฆญ
T->>D: ๋ฉ๋ด ์ด๊ธฐ ์์ฒญ
D->>S: isOpen ์ํ ์
๋ฐ์ดํธ
U->>D: ์ต์
์ ํ
D->>S: selectedValue ์
๋ฐ์ดํธ ๋ฐ onChange ํธ์ถ
S->>T: ์ ํ๋ ๊ฐ ๋ฐ์
D->>U: ๊ฒฐ๊ณผ ํ์
Possibly related PRs
Suggested labels
Suggested reviewers
Poem
โจ Finishing Touches
๐ชง TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
CI Status Report๊ฒ์ฌ ๊ฒฐ๊ณผ
โ ๋ชจ๋ ๊ฒ์ฌ๊ฐ ํต๊ณผ๋์์ต๋๋ค. |
Codecov ReportAll modified and coverable lines are covered by tests โ |
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.
Actionable comments posted: 0
๐งน Nitpick comments (4)
src/components/common/Dropdown.tsx (3)
60-101: renderTriggerContent ๋ถ๋ฆฌ
imageProps์variant์ ๋ฐ๋ผ ๋ค๋ฅธ UI๋ฅผ ์ ์ ํ ๋ถ๊ธฐํ์ฌ ๊ฐ๋ ์ฑ์ด ์ข์ต๋๋ค.- ์์ด์ฝ์ด ์๋ variant์์๋ ์ ํ๋ ๋ผ๋ฒจ์ ํจ๊ป ํ์ํด์ฃผ๋ UX๊ฐ ํธ๋ฆฌํฉ๋๋ค.
์ด ํจ์๊ฐ ๊ธธ์ด์ง ์ ์์ผ๋ฏ๋ก ์ ์ง๋ณด์๋ฅผ ์ํด ๊ตฌ์กฐ๋ฅผ ๋ ์ธ๋ถํํ ์๋ ์์ต๋๋ค.
103-106: ๋ฐฐ๊ฒฝ์ ๋ณ๊ฒฝ ์ฌ๋ถ ์กฐ๊ฑด
className?.includes('w-[460px]')๋ฅผ ์์ธ๋ก ์ฒ๋ฆฌํ๋ ๋ถ๋ถ์ ์๋๋ฅผ ํ์ ํ๊ธฐ ๋ค์ ์ด๋ ค์ธ ์ ์์ต๋๋ค. ์ถํ ๋ณ๋์ boolean prop์ผ๋ก ๋ถ๋ฆฌํ๋ ๋ฐฉ์์ ๊ณ ๋ คํด๋ณด์ธ์.
160-160: ๋ง๋ฌด๋ฆฌ ํ์ธํ์ผ ๋๋ถ๋ถ์ ์ถ๊ฐ๋ ์ค์ด๋ ๊ณต๋ฐฑ์ ์๋์ง ๋ค์ ํ๋ฒ ํ์ธํด๋ณด์๋ฉด ์ข๊ฒ ์ต๋๋ค.
src/app/preview/dropdown/page.tsx (1)
81-122: ์ฌ๋ฌ ๋๋กญ๋ค์ด ์์ ์น์ ๊ตฌ์ฑ
- "๊ธฐ๋ณธ ๋๋กญ๋ค์ด" / "์ํ ๊ด๋ฆฌ ๋๋กญ๋ค์ด"์ผ๋ก ๊ตฌ๋ถํด ์๋๋ฆฌ์ค๋ณ ์ํฉ์ ๋ช ๋ฃํ๊ฒ ๋ณด์ฌ์ค๋๋ค.
- ๋ค์ํ variant์ size ์ค์ ์ด ์ ๋๋ฌ๋ ํ์ต์ ์ ์ฉํฉ๋๋ค.
๊ฐ ์น์ ์ ๊ฐ์๋ฅผ ์ถ๊ฐํ๋ฉด ์ ๊ท ํ์์ด ๋น ๋ฅด๊ฒ ์ดํดํ๋ ๋ฐ ๋์์ด ๋ ๊ฒ์ ๋๋ค.
๐ Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
๐ Files selected for processing (3)
src/app/preview/dropdown/page.tsx(1 hunks)src/components/common/Dropdown.tsx(1 hunks)src/components/common/Header.tsx(1 hunks)
โฐ Context from checks skipped due to timeout of 90000ms (1)
- GitHub Check: check
๐ Additional comments (18)
src/components/common/Dropdown.tsx (11)
1-1: "use client" ์ ์ ์ฉ๋์๋์ง ํ์ธ์ด ๋ผ์ธ์ Next.js 13 ์ด์์์ ํด๋ผ์ด์ธํธ ์ปดํฌ๋ํธ๋ก ๋์ํ๊ธฐ ์ํ ์ ์ธ์ ๋๋ค. ๋ณ๋ค๋ฅธ ๋ฌธ์ ๋ ์์ด ๋ณด์ ๋๋ค.
3-7: ์ฌ๋ฌ ๋ผ์ด๋ธ๋ฌ๋ฆฌ ์ํฌํธ
@radix-ui/react-dropdown-menu,lucide-react,next/image๋ฑ ๋ค์ํ ๋ผ์ด๋ธ๋ฌ๋ฆฌ ์ฌ์ฉ์ด ๋ชฉ์ ์ ๋ถํฉํด ๋ณด์ ๋๋ค. ๋ถํ์ํ ์์กด์ฑ์ด ์๋์ง ์ถํ ์ ๊ฒ์ ๊ถ์ฅํฉ๋๋ค.
9-13: IDropdownOption ์ธํฐํ์ด์ค ์ ์
value์labelํ๋๋ฅผ ํ์๋ก,onSelect๋ฅผ ์ ํ์ ์ผ๋ก ๋์ด ์ ์ฐํ๊ฒ ์ต์ ๋ณ ๋์์ ์ง์ ํ ์ ์์ต๋๋ค.
15-31: IDropdownProps ์ธํฐํ์ด์ค ๊ตฌ์กฐ ์ ์ ๋๋กญ๋ค์ด ์คํ์ผยท์ด๋ฏธ์ง๋ฅผ ๋น๋กฏํด ๋ค์ํ ์์ฑ์ ์ฃผ์์ ํตํด ๋ช ํํ ์ค๋ช ํ๊ณ ์์ด ์ ์ง๋ณด์ ์ ์ดํดํ๊ธฐ ์ฝ์ต๋๋ค.
33-43: ๊ธฐ๋ณธ ๋งค๊ฐ๋ณ์ ์ค์ ๋ํดํธ ๊ฐ๋ค์ด ๋ฏธ๋ฆฌ ์ง์ ๋์ด ์์ด ์์ธ ์ํฉ์ ์ต์ํํ๊ณ , ์ฌ์ฉ์ ์ ์ฅ์์ โ์ ํํ์ธ์โ ์๋ด ๋ฌธ๊ตฌ๊ฐ ์ง๊ด์ ์ ๋๋ค.
44-45: ๋๋กญ๋ค์ด ์ํ ๊ด๋ฆฌ
isOpen๊ณผselectedValue๋ฅผ ๋ถ๋ฆฌํ์ฌ ๋ช ํํ๊ฒ ๊ด๋ฆฌํ๊ณ ์์ต๋๋ค.
47-47: ์ ํ๋ ์ต์ ์๋ณ ๋ก์ง
options.find๋ก ํ์ฌ ์ ํ๋ ๊ฐ์ ๋น ๋ฅด๊ฒ ํ์ธํ ์ ์์ด ์ฝ๋๋ฅผ ๋จ์ํํฉ๋๋ค.
49-52: sizeClasses ์ฒ๋ฆฌ
s์l์ผ์ด์ค๋ณ๋ก Tailwind ํด๋์ค๋ฅผ ๊ด๋ฆฌํ๋ฏ๋ก, ๋ค์ํ ์ฌ์ด์ฆ ๋์์ด ํธ๋ฆฌํด ๋ณด์ ๋๋ค.
54-58: handleSelect ํจ์์ ์ฝ๋ฐฑ ๋ก์ง๋ด๋ถ ์ํ์ ์ธ๋ถ ์ฝ๋ฐฑ์ ๋ชจ๋ ์ฒ๋ฆฌํด์ฃผ์ด ์ฌ์ฌ์ฉ ๊ฐ๋ฅ์ฑ์ด ๋๊ณ ํ์ฅ์ฑ๋ ์ข์ ๋ณด์ ๋๋ค.
109-122: Trigger ํด๋์ค ๊ตฌ์ฑRadix UI์ Trigger๋ฅผ ์ฌ์ฉํด ๋๋กญ๋ค์ด ์คํ ์ํ์ ๋ฐ๋ผ ๋ฐฐ๊ฒฝยท๊ธ์์์ ๊ฐ์์ ์ผ๋ก ๋ณ๊ฒฝํด์ฃผ๋ ๋ก์ง์ด ๋ช ํํฉ๋๋ค.
127-157: Dropdown Content ๊ตฌ์กฐ
sideOffset,contentClassName๋ฑ์ผ๋ก ๋๋กญ๋ค์ด ์์นยท์คํ์ผ์ ์ธ๋ฐํ๊ฒ ์ ์ดํ ์ ์๊ณ ,options๋ฅผ mapํ์ฌ Item์ ์์ฑํ๋ ํจํด์ด ์ง๊ด์ ์ ๋๋ค.src/app/preview/dropdown/page.tsx (5)
3-3: ํ๋กํ ์์ด์ฝ ์ํฌํธSVG ํํ์ ์์ด์ฝ์ importํ์ฌ ์ค๋ฅ ์์ด ์ฌ์ฉ ์ค์ ๋๋ค.
7-44: ๋๋กญ๋ค์ด ์ฌ์ฉ ์์๋ฅผ ์์ธ ์ฃผ์์ผ๋ก ์๋ด๋๋กญ๋ค์ด ํน์ง, ์์ ์ฝ๋, ์ต์ ์ค๋ช ๋ฑ์ด ํ๋ถํด ๋ค๋ฅธ ๊ฐ๋ฐ์๋ค๋ ์ดํดํ๊ธฐ ์ฝ์ต๋๋ค.
46-79: ์ํ ๋ฐ ์ต์ ์ ์
selectedFilter๋ฅผ useState๋ก ๊ด๋ฆฌํ์ฌ ๋์ ํํฐ ์ ํ์ ๊ตฌํํ์ต๋๋ค.filterOptions,filterAreaOptions,menuOptions๊ฐ ์๋ก ๋ค๋ฅธ ์ฉ๋์ ๋ง์ถฐ ์ ๊ตฌ์ฑ๋์ด ์์ต๋๋ค.
124-135: ์ด๋ฏธ์ง ๋๋กญ๋ค์ด ์์
imageProps๋ฅผ ๊ฐ์ฒด๋ก ๋๊ฒจ, ํธ๋ฆฌ๊ฑฐ๋ก SVG๋ฅผ ์ฝ๊ฒ ์ฌ์ฉํ ์ ์์ต๋๋ค.className,contentClassName๋ก ์์น ์กฐ์ ๋ก์ง์ ๋ถ๋ฆฌํด UI ์ ์ง๋ณด์์ฑ์ด ๋์ต๋๋ค.
137-148: ์ปค์คํ ์คํ์ผ ๋๋กญ๋ค์ด
w-[460px]์คํ์ผ์ ํธ๋ฆฌ๊ฑฐยท์ฝํ ์ธ ์ ๋์์ ์ ์ฉํ์ฌ ์๊ฐ์ ์ผ๋ก ์ผ๊ด์ฑ ์๊ฒ ๊ตฌํ๋์์ต๋๋ค.src/components/common/Header.tsx (2)
28-42: ๋๋กญ๋ค์ด ๋ฉ๋ด ๊ตฌ์กฐ ํ์ฅ
valueํ๋๋ฅผ ์ถ๊ฐํด ๊ธฐ์กดlabel๊ณผ ํจ๊ป ๋์ฑ ์์ ์ ์ผ๋ก ๋ฉ๋ด๋ฅผ ์๋ณํฉ๋๋ค.- ๊ฐ ๋ฉ๋ด ์์ดํ ๋ณ
onSelect์์ ๋ผ์ฐํ ์ฒ๋ฆฌ๋ฅผ ํด์ฃผ์ด ์ฝ๋ ํ๋ฆ์ด ๋ถ๋ช ํฉ๋๋ค.
47-55: ๋๋กญ๋ค์ด์ ์ด๋ฏธ์ง variant๋ก ์ฌ์ฉ
variant="image"์ค์ ๊ณผ ํจ๊ปimageProps๋ฅผ ํตํด Profile SVG๋ฅผ ํธ๋ฆฌ๊ฑฐ๋ก ํ์ฉํ๋ ๋ฐฉ์์ด ์์ฐ์ค๋ฝ์ต๋๋ค.contentClassName="mr-[85px]"๋ฑ์ ์์น ์กฐ์ ๋ ๋ช ์์ ์ด๋ผ ์ถํ ์์ ์ด ์ฉ์ดํฉ๋๋ค.
| import Dropdown from '@/components/common/Dropdown'; | ||
| import { useState } from 'react'; | ||
|
|
||
| /** |
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 Doc์ ์ปดํฌ๋ํธ์ ์์ฑํด์ฃผ์๋ฉด ๊ฐ์ฌํ๊ฒ ์ต๋๋ค!
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.
๋ต ์์ ํ๊ฒ ์ต๋๋ค!
๐ย ์ฃผ์ ์์ ๋ด์ฉ
๋๋กญ๋ค์ด trigger์ contents ๋ณํฉ
filter ๊ธฐ๋ฅ๊ณผ ์คํ์ผ ์ปค์คํ ๊ตฌํ
๐บย ์คํฌ๋ฆฐ์ท
๐ ์ฐธ๊ณ ์ฌํญ
์ฝ๋๊ฐ ๋ง์ด ๋๋ฝ์ต๋๋ค ์ฃ์กํฉ๋๋ค..

preview/dropdown/page.tsx์ ์ค๋ช ์์ต๋๋ค.. ์ฐธ๊ณ ํด์ฃผ์ธ์ฉ..!
๐ฌย ๋ฆฌ๋ทฐ ์๊ตฌ์ฌํญ
๐ย ๊ด๋ จ ์ด์
DEVING-43
Summary by CodeRabbit