diff --git a/src/components/common/BackBtn/index.tsx b/src/components/common/BackBtn/index.tsx new file mode 100644 index 0000000..5d8733c --- /dev/null +++ b/src/components/common/BackBtn/index.tsx @@ -0,0 +1,25 @@ +import React, { ButtonHTMLAttributes, FC } from 'react'; + +import { backPathDefaultStyle } from './style'; +import { buttonDefaultStyle, buttonSVGDefaultStyle } from '@/styles/common'; + +interface ButtonProps extends ButtonHTMLAttributes { + width: string; + height: string; + color: string; +} + +const Exit: FC = ({ width, height, color }) => { + return ( + + ); +}; + +export default Exit; diff --git a/src/components/common/BackBtn/style.ts b/src/components/common/BackBtn/style.ts new file mode 100644 index 0000000..57c7977 --- /dev/null +++ b/src/components/common/BackBtn/style.ts @@ -0,0 +1,8 @@ +import { css } from '@emotion/react'; + +export const backPathDefaultStyle = css` + stroke-linecap: round; + stroke-linejoin: round; + stroke-width: 10; + fill: none; +`; diff --git a/src/components/common/ExitBtn/index.tsx b/src/components/common/ExitBtn/index.tsx new file mode 100644 index 0000000..e83599b --- /dev/null +++ b/src/components/common/ExitBtn/index.tsx @@ -0,0 +1,35 @@ +import React, { ButtonHTMLAttributes, FC } from 'react'; + +import { buttonDefaultStyle, buttonSVGDefaultStyle } from '@/styles/common'; +import { exitLineDefaultStyle } from './style'; + +interface ButtonProps extends ButtonHTMLAttributes { + width: string; + height: string; + color: string; +} + +const Exit: FC = ({ width, height, color }) => { + return ( + + ); +}; + +export default Exit; diff --git a/src/components/common/ExitBtn/style.ts b/src/components/common/ExitBtn/style.ts new file mode 100644 index 0000000..c465d11 --- /dev/null +++ b/src/components/common/ExitBtn/style.ts @@ -0,0 +1,6 @@ +import { css } from '@emotion/react'; + +export const exitLineDefaultStyle = css` + stroke-linecap: round; + stroke-width: 20; +`; diff --git a/src/stories/BackBtn.stories.tsx b/src/stories/BackBtn.stories.tsx new file mode 100644 index 0000000..f866249 --- /dev/null +++ b/src/stories/BackBtn.stories.tsx @@ -0,0 +1,37 @@ +/* eslint-disable react/jsx-props-no-spreading */ +import React from 'react'; +import { ComponentStory, ComponentMeta } from '@storybook/react'; + +import theme from '@/styles/theme'; +import BackBtn from '@/components/common/BackBtn'; + +export default { + title: 'common/Back Button', + component: BackBtn, +} as ComponentMeta; + +const Template: ComponentStory = (args) => ( + +); + +export const PrimaryBackButton = Template.bind({}); +PrimaryBackButton.args = { + width: '50px', + height: '50px', + color: theme.colorPrimary, +}; +export const LightBackButton = Template.bind({}); +LightBackButton.args = { + width: '50px', + height: '50px', + color: 'white', +}; +LightBackButton.decorators = [ + (Story) => { + return ( +
+ +
+ ); + }, +]; diff --git a/src/stories/ExitBtn.stories.tsx b/src/stories/ExitBtn.stories.tsx new file mode 100644 index 0000000..49af7c7 --- /dev/null +++ b/src/stories/ExitBtn.stories.tsx @@ -0,0 +1,37 @@ +/* eslint-disable react/jsx-props-no-spreading */ +import React from 'react'; +import { ComponentStory, ComponentMeta } from '@storybook/react'; + +import theme from '@/styles/theme'; +import ExitBtn from '@/components/common/ExitBtn'; + +export default { + title: 'common/Exit Button', + component: ExitBtn, +} as ComponentMeta; + +const Template: ComponentStory = (args) => ( + +); + +export const PrimaryExitButton = Template.bind({}); +PrimaryExitButton.args = { + width: '50px', + height: '50px', + color: theme.colorPrimary, +}; +export const LightExitButton = Template.bind({}); +LightExitButton.args = { + width: '50px', + height: '50px', + color: 'white', +}; +LightExitButton.decorators = [ + (Story) => { + return ( +
+ +
+ ); + }, +]; diff --git a/src/styles/common.ts b/src/styles/common.ts new file mode 100644 index 0000000..1393c65 --- /dev/null +++ b/src/styles/common.ts @@ -0,0 +1,12 @@ +import { css } from '@emotion/react'; + +export const buttonDefaultStyle = css` + border: none; + background-color: transparent; + padding: 0; +`; + +export const buttonSVGDefaultStyle = css` + width: 100%; + height: 100%; +`;