-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Feat: SegmentedControl 컴포넌트 추가 및 설정 페이지 벤토 디자인 적용
- Loading branch information
1 parent
5544b34
commit 7384b52
Showing
6 changed files
with
146 additions
and
53 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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 @@ | ||
import * as styles from './SegmentedCotrol.css'; | ||
|
||
interface SegmentedControlProps { | ||
options: string[]; | ||
selected: string; | ||
handleSelect: (option: any) => void; | ||
} | ||
|
||
export default function SegmentedControl({ options, selected, handleSelect }: SegmentedControlProps) { | ||
return ( | ||
<div className={styles.track}> | ||
{options.map((option) => ( | ||
<div | ||
key={option} | ||
className={`${styles.segment} ${option === selected && styles.selectedSegment}`} | ||
onClick={() => handleSelect(option)} | ||
role="button" | ||
> | ||
{option} | ||
</div> | ||
))} | ||
</div> | ||
); | ||
} |
This file contains 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,29 @@ | ||
import { style } from '@vanilla-extract/css'; | ||
import * as fonts from '@/styles/font.css'; | ||
import { vars } from '@/styles/theme.css'; | ||
|
||
export const track = style({ | ||
width: 'auto', | ||
padding: '0.2rem', | ||
|
||
display: 'flex', | ||
borderRadius: '1.2rem', | ||
gap: '0.5rem', | ||
|
||
backgroundColor: vars.color.bggray, | ||
}); | ||
|
||
export const segment = style({ | ||
padding: '1rem 2rem', | ||
|
||
display: 'relative', | ||
|
||
borderRadius: '1.2rem', | ||
':hover': { | ||
backgroundColor: vars.color.bluegray6, | ||
}, | ||
}); | ||
|
||
export const selectedSegment = style({ | ||
backgroundColor: vars.color.white, | ||
}); |
This file contains 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