-
Notifications
You must be signed in to change notification settings - Fork 1
Feat/23 공통 Dropdown 컴포넌트 구현 #60
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
Merged
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
59c3788
feat: 체크 아이콘 showBackground prop 추가
LeeCh0129 2f8f83e
feat: ChevronIcon 컴포넌트 추가
LeeCh0129 7e821fd
feat: 공통 컴포넌트 Dropdown 구현
LeeCh0129 6d9875b
feat: Dropdown 컴포넌트 예제 페이지
LeeCh0129 92f812c
feat: 아이콘 샘플 페이지(임시)
LeeCh0129 0a388d7
chore: 불필요한 공백 코드 제거
LeeCh0129 f08e2a6
Merge branch 'develop' into feature/23
LeeCh0129 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,22 +1,57 @@ | ||
| import React from 'react'; | ||
|
|
||
| const CheckIcon = ({ size = 24, ...props }) => ( | ||
| <svg | ||
| xmlns='http://www.w3.org/2000/svg' | ||
| width={size} | ||
| height={size} | ||
| fill='none' | ||
| viewBox='0 0 24 24' | ||
| > | ||
| <circle cx='12' cy='12' r='12' fill='#121'></circle> | ||
| <path | ||
| stroke='#fff' | ||
| strokeLinecap='round' | ||
| strokeLinejoin='round' | ||
| strokeWidth='1.5' | ||
| d='m7.607 12.35 3.08 3.15 5.563-7.143' | ||
| /> | ||
| </svg> | ||
| ); | ||
| interface CheckIconProps { | ||
| size?: number; | ||
| showBackground?: boolean; | ||
| [key: string]: any; | ||
| } | ||
|
|
||
| const CheckIcon = ({ | ||
| size = 24, | ||
| showBackground = true, | ||
| ...props | ||
| }: CheckIconProps) => { | ||
| // 배경 없이 체크만 표시하는 경우 | ||
| if (!showBackground) { | ||
| return ( | ||
| <svg | ||
| xmlns='http://www.w3.org/2000/svg' | ||
| width={size} | ||
| height={size} | ||
| fill='none' | ||
| viewBox='0 0 24 24' | ||
| {...props} | ||
| > | ||
| <path | ||
| stroke='currentColor' | ||
| strokeLinecap='round' | ||
| strokeLinejoin='round' | ||
| strokeWidth='1.5' | ||
| d='m7.607 12.35 3.08 3.15 5.563-7.143' | ||
| /> | ||
| </svg> | ||
| ); | ||
| } | ||
|
|
||
| return ( | ||
| <svg | ||
| xmlns='http://www.w3.org/2000/svg' | ||
| width={size} | ||
| height={size} | ||
| fill='none' | ||
| viewBox='0 0 24 24' | ||
| {...props} | ||
| > | ||
| <circle cx='12' cy='12' r='12' fill='#121'></circle> | ||
| <path | ||
| stroke='#fff' | ||
| strokeLinecap='round' | ||
| strokeLinejoin='round' | ||
| strokeWidth='1.5' | ||
| d='m7.607 12.35 3.08 3.15 5.563-7.143' | ||
| /> | ||
| </svg> | ||
| ); | ||
| }; | ||
|
|
||
| export default CheckIcon; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,25 @@ | ||
| import React from 'react'; | ||
|
|
||
| const ChevronIcon = ({ size = 24, direction = 'down', ...props }) => ( | ||
| <svg | ||
| xmlns='http://www.w3.org/2000/svg' | ||
| width={size} | ||
| height={size} | ||
| fill='none' | ||
| viewBox='0 0 24 24' | ||
| style={{ | ||
| transform: direction === 'up' ? 'rotate(180deg)' : 'none', | ||
| ...props.style, | ||
| }} | ||
| > | ||
| <path | ||
| stroke='#1B1B1B' | ||
| strokeLinecap='round' | ||
| strokeLinejoin='round' | ||
| strokeWidth='1.5' | ||
| d='M5.25 9 12 15.75 18.75 9' | ||
| /> | ||
| </svg> | ||
| ); | ||
|
|
||
| export default ChevronIcon; | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,24 @@ | ||
| 'use client'; | ||
|
|
||
| import { useState } from 'react'; | ||
| import Dropdown from '@components/Dropdown'; | ||
| import { ACTIVITY_CATEGORIES, ActivityCategory } from '@/constants/categories'; | ||
|
|
||
| export default function DropdownExample() { | ||
| const [category, setCategory] = useState<ActivityCategory | ''>(''); | ||
|
|
||
| return ( | ||
| <div className='min-h-screen p-40'> | ||
| <h1 className='text-24 mb-40 font-bold'>Dropdown 테스트</h1> | ||
|
|
||
| {/* 카테고리 드롭다운 UI 확인 */} | ||
| <Dropdown | ||
| className='h-56 w-800' | ||
| options={ACTIVITY_CATEGORIES} | ||
| value={category} | ||
| onChange={setCategory} | ||
| placeholder='카테고리' | ||
| /> | ||
| </div> | ||
| ); | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1 +1,89 @@ | ||
| export default function Home() {} | ||
| 'use client'; | ||
|
|
||
| import BellIcon from '@assets/svg/bell'; | ||
| import CheckIcon from '@assets/svg/check'; | ||
| import ChevronIcon from '@assets/svg/chevron'; | ||
| import CloseEyeIcon from '@assets/svg/close-eye'; | ||
| import CloseIcon from '@assets/svg/close'; | ||
| import IconDropdown from '@assets/svg/dropdown'; | ||
| import IconFacebook from '@assets/svg/facebook'; | ||
| import IconInstagram from '@assets/svg/instagram'; | ||
| import LeftArrowIcon from '@assets/svg/left-arrow'; | ||
| import LocationIcon from '@assets/svg/location'; | ||
| import LogoIcon from '@assets/svg/logo'; | ||
| import OpenEyeIcon from '@assets/svg/open-eye'; | ||
| import RightArrowIcon from '@assets/svg/right-arrow'; | ||
| import IconTwitter from '@assets/svg/twitter'; | ||
| import IconYoutube from '@assets/svg/youtube'; | ||
|
|
||
| export default function Home() { | ||
| const icons = [ | ||
| { name: 'BellIcon', component: <BellIcon size={32} /> }, | ||
| { name: 'CheckIcon', component: <CheckIcon size={32} /> }, | ||
| { | ||
| name: 'CheckIcon (no bg)', | ||
| component: <CheckIcon size={32} showBackground={false} />, | ||
| }, | ||
| { | ||
| name: 'ChevronIcon (down)', | ||
| component: <ChevronIcon size={32} direction='down' />, | ||
| }, | ||
| { | ||
| name: 'ChevronIcon (up)', | ||
| component: <ChevronIcon size={32} direction='up' />, | ||
| }, | ||
| { name: 'CloseEyeIcon', component: <CloseEyeIcon size={32} /> }, | ||
| { name: 'CloseIcon', component: <CloseIcon size={32} /> }, | ||
| { | ||
| name: 'DropdownIcon', | ||
| component: <IconDropdown size={32} color='#1B1B1B' />, | ||
| }, | ||
| { | ||
| name: 'FacebookIcon', | ||
| component: <IconFacebook size={32} color='#1B1B1B' />, | ||
| }, | ||
| { | ||
| name: 'InstagramIcon', | ||
| component: <IconInstagram size={32} color='#1B1B1B' />, | ||
| }, | ||
| { name: 'LeftArrowIcon', component: <LeftArrowIcon size={32} /> }, | ||
| { name: 'LocationIcon', component: <LocationIcon size={32} /> }, | ||
| { name: 'LogoIcon', component: <LogoIcon size={80} /> }, | ||
| { name: 'OpenEyeIcon', component: <OpenEyeIcon size={32} /> }, | ||
| { name: 'RightArrowIcon', component: <RightArrowIcon size={32} /> }, | ||
| { | ||
| name: 'TwitterIcon', | ||
| component: <IconTwitter size={32} color='#1B1B1B' />, | ||
| }, | ||
| { | ||
| name: 'YoutubeIcon', | ||
| component: <IconYoutube size={32} color='#1B1B1B' />, | ||
| }, | ||
| ]; | ||
|
|
||
| return ( | ||
| <div className='min-h-screen bg-gray-100 p-40'> | ||
| <div className='mx-auto max-w-1200'> | ||
| <h1 className='text-32 mb-40 text-center font-bold'> | ||
| GlobalNomad 아이콘 샘플 | ||
| </h1> | ||
|
|
||
| <div className='grid grid-cols-2 gap-24 md:grid-cols-3 lg:grid-cols-4'> | ||
| {icons.map(({ name, component }, index) => ( | ||
| <div | ||
| key={index} | ||
| className='rounded-8 flex min-h-120 flex-col items-center justify-center border border-gray-300 bg-white p-16' | ||
| > | ||
| <div className='mb-12 flex items-center justify-center'> | ||
| {component} | ||
| </div> | ||
| <p className='text-14 text-center font-medium break-all text-gray-700'> | ||
| {name} | ||
| </p> | ||
| </div> | ||
| ))} | ||
| </div> | ||
| </div> | ||
| </div> | ||
| ); | ||
| } |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
🛠️ Refactor suggestion
TypeScript 타입 정의가 누락되었습니다.
TypeScript 프로젝트에서 컴포넌트 props에 대한 타입 정의가 없어 타입 안전성이 보장되지 않습니다.
다음과 같이 타입 정의를 추가하세요:
🤖 Prompt for AI Agents