From 110b91039b6aba689afb99d3fdc1207f4ae8cf8f Mon Sep 17 00:00:00 2001 From: junseublim Date: Thu, 11 Jul 2024 02:03:44 +0900 Subject: [PATCH 1/3] Feat: Add Modal Component --- .storybook/main.ts | 18 ++ .storybook/preview-body.html | 1 + package-lock.json | 289 +++++++++++-------------- package.json | 1 + public/icons/bottom_modal.svg | 14 ++ public/icons/modal.svg | 10 + src/components/Modal/Modal.stories.tsx | 152 +++++++++++++ src/components/Modal/index.tsx | 233 ++++++++++++++++++++ 8 files changed, 553 insertions(+), 165 deletions(-) create mode 100644 .storybook/preview-body.html create mode 100644 public/icons/bottom_modal.svg create mode 100644 public/icons/modal.svg create mode 100644 src/components/Modal/Modal.stories.tsx create mode 100644 src/components/Modal/index.tsx diff --git a/.storybook/main.ts b/.storybook/main.ts index d98b990..5f559f5 100644 --- a/.storybook/main.ts +++ b/.storybook/main.ts @@ -14,5 +14,23 @@ const config: StorybookConfig = { options: {}, }, staticDirs: ['../public'], + webpackFinal: async (config) => { + config.module = config.module || {} + config.module.rules = config.module.rules || [] + const imageRule = config.module.rules.find((rule) => + // @ts-ignore + rule?.['test']?.test('.svg'), + ) + if (imageRule) { + // @ts-ignore + imageRule['exclude'] = /\.svg$/ + } + config.module.rules.push({ + test: /\.svg$/, + use: ['@svgr/webpack'], + }) + + return config + }, } export default config diff --git a/.storybook/preview-body.html b/.storybook/preview-body.html new file mode 100644 index 0000000..0288277 --- /dev/null +++ b/.storybook/preview-body.html @@ -0,0 +1 @@ +