Skip to content

Commit

Permalink
feat(Divider): Divider 実装 (#71)
Browse files Browse the repository at this point in the history
  • Loading branch information
locona authored Jun 23, 2021
1 parent f90cc50 commit d09dc66
Show file tree
Hide file tree
Showing 3 changed files with 53 additions and 0 deletions.
27 changes: 27 additions & 0 deletions src/divider/Divider.stories.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import React from 'react'
import { Meta } from '@storybook/react/types-6-0'

import 'twin.macro'
import { Divider } from './Divider'

export default {
title: 'Atom/Divider',
component: Divider,
decorators: [
// eslint-disable-next-line @typescript-eslint/no-explicit-any
(Story: any) => (
<div tw="mt-10 flex flex-col h-screen w-screen gap-4">
<Story />
</div>
),
],
argTypes: {
backgroundColor: { control: 'color' },
},
} as Meta

export const basic = () => (
<div>
<Divider />
</div>
)
25 changes: 25 additions & 0 deletions src/divider/Divider.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import { VFC } from 'react'
import MuiDivider, {
DividerProps as MuiDividerProps,
} from '@material-ui/core/Divider'
import tw, { css, TwStyle } from 'twin.macro'

export type DividerProps = MuiDividerProps & {
twin?: TwStyle[]
}

export const Divider: VFC<DividerProps> = ({ twin }) => {
return (
<MuiDivider
light
css={[
css`
&.MuiDivider-root {
${tw`border border-low`}
${twin}
}
`,
]}
/>
)
}
1 change: 1 addition & 0 deletions src/divider/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from './Divider'

1 comment on commit d09dc66

@vercel
Copy link

@vercel vercel bot commented on d09dc66 Jun 23, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.