Skip to content

Commit

Permalink
feat: Spacing 컴포넌트 구현 및 스토리북 구현
Browse files Browse the repository at this point in the history
  • Loading branch information
HeeSeok-kim committed Oct 29, 2023
1 parent 41aa08d commit acf1743
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
13 changes: 12 additions & 1 deletion src/components/common/spacing/Spacing.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,13 @@ const meta: Meta<typeof Spacing> = {
control: { type: 'text' },
type: { name: 'string', required: true }
}
},
render: function Render(args) {
return (
<div className={'w-[100px] h-[100px]'}>
<Spacing size={args.size} color={args.color} />
</div>
)
}
}

Expand All @@ -27,5 +34,9 @@ export default meta
type Story = StoryObj<typeof Spacing>

export const Primary: Story = {
render: () => <Spacing size={32} color={'blue-500'} />
...meta,
args: {
size: 32,
color: 'blue-500'
}
}
4 changes: 3 additions & 1 deletion src/components/common/spacing/Spacing.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@ interface SpacingProps {
* */

const Spacing = ({ size, color }: SpacingProps) => {
return <div className={`h-[${size}px] w-full bg-${color}`}></div>
const spacingStyle = `h-[${size}px] bg-${color}`

return <div className={spacingStyle}></div>
}

export default Spacing

0 comments on commit acf1743

Please sign in to comment.