File tree Expand file tree Collapse file tree 2 files changed +53
-0
lines changed
Expand file tree Collapse file tree 2 files changed +53
-0
lines changed Original file line number Diff line number Diff line change 1+ import Link from 'next/link'
2+
3+ import { LogoBlack , LogoGray , LogoWhite } from '@/assets/logoList'
4+
5+ type Variant = 'default' | 'primary' | 'secondary'
6+
7+ type LogoProps = { variant ?: Variant }
8+
9+ const logoByVariant : Record < Variant , React . ReactElement > = {
10+ default : < LogoBlack /> ,
11+ primary : < LogoWhite /> ,
12+ secondary : < LogoGray /> ,
13+ }
14+
15+ export const Logo = ( { variant = 'default' } : LogoProps ) : JSX . Element => {
16+ const logo = logoByVariant [ variant ]
17+
18+ return < Link href = { '/' } > { logo } </ Link >
19+ }
Original file line number Diff line number Diff line change 1+ import { Logo } from '@/components/common/logo'
2+
3+ export default {
4+ title : 'Common/Logo/Logo' ,
5+ component : Logo ,
6+ parameters : {
7+ layout : 'centered' ,
8+ } ,
9+ argTypes : {
10+ variant : {
11+ control : 'radio' ,
12+ options : [ 'default' , 'primary' , 'secondary' ] ,
13+ description : '로고의 스타일을 결정하는 옵션입니다.' ,
14+ } ,
15+ } ,
16+ }
17+
18+ export const Default = {
19+ args : {
20+ variant : 'default' ,
21+ } ,
22+ }
23+
24+ export const Primary = {
25+ args : {
26+ variant : 'primary' ,
27+ } ,
28+ }
29+
30+ export const Secondary = {
31+ args : {
32+ variant : 'secondary' ,
33+ } ,
34+ }
You can’t perform that action at this time.
0 commit comments