Skip to content

Commit

Permalink
๐ŸŽจ ๊ณต์šฉ ์ปดํฌ๋„ŒํŠธ ์ถ”๊ฐ€ (๋“œ๋กญ๋‹ค์šด, ํ—ค๋”, ํŽ˜์ด์ง€ ์ปจํ…Œ์ด๋„ˆ) (#9)
Browse files Browse the repository at this point in the history
* feat: svgr ์„ค์น˜ ๋ฐ ์„ธํŒ…

* feat: shared ํด๋” ๋‚ด์—์„œ tailwind๊ฐ€ ์ž‘๋™๋˜๋„๋ก ์„ธํŒ…

* feat: public ํด๋”๋‚ด assets์„ import ๊ฐ€๋Šฅํ•˜๋„๋ก ์„ธํŒ…

* feat: storybook์—์„œ svgr์ด ๋™์ž‘๋˜๋„๋ก ์„ธํŒ…

* feat: header ๊ณตํ†ต ์ปดํฌ๋„ŒํŠธ ๊ตฌํ˜„

* feat: PageContainer ์ปดํฌ๋„ŒํŠธ ๊ตฌํ˜„

* feat: Dropdown ์ปดํฌ๋„ŒํŠธ ๊ตฌํ˜„ ๋ฐ storise ํŒŒ์ผ ์ƒ์„ฑ

* feat: page.tsx์— pagecontainer ์ ์šฉ

* feat: dropdown, header export ํŒŒ์ผ ์ถ”๊ฐ€

* chore: lint ์ ์šฉ

* chore: shared ๋‚ด .gitkeep ์ œ๊ฑฐ

* feat: dropdown ๋‚ด use-client ์ถ”๊ฐ€

* feat: PageContainer export ๊ตฌ์กฐ ์ˆ˜์ •

* setting: next.config.mjs๋‚ด turbopack ๋Œ€์‘ svg ์„ค์ • ์ œ๊ฑฐ

* feat: pageContainer ๋‚ด import ์ˆ˜์ •

* feat: dropdown ์ปดํฌ๋„ŒํŠธ ์ˆ˜์ •

* chore: dropdown stories ํŒŒ์ผ ๋‚ด ๋„ค์ด๋ฐ ์ˆ˜์ •

* style: dropdown ์ปดํฌ๋„ŒํŠธ button ๋‚ด radius ์ถ”๊ฐ€

* feat: Dropdown.stories.tsx ํƒ€์ž… ๋ช…์‹œ ์ค„์ž„ ๋ฐ props ๋‚ด ํ•จ์ˆ˜ ์„ ์–ธํ•˜์—ฌ ์ ์šฉ

* feat: Header.tsx ๋‚ด prop type ์ˆ˜์ •
  • Loading branch information
suhwan2004 authored Oct 23, 2024
1 parent 3f01365 commit cdf4564
Show file tree
Hide file tree
Showing 22 changed files with 566 additions and 42 deletions.
23 changes: 23 additions & 0 deletions .storybook/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,28 @@ const config: StorybookConfig = {
name: '@storybook/nextjs',
options: {},
},
webpackFinal: async (config) => {
const imageRule = config.module?.rules?.find((rule) => {
const test = (rule as { test: RegExp }).test;

if (!test) {
return false;
}
if (Array.isArray(test)) {
return test.some((t) => t instanceof RegExp && t.test('.svg'));
}

return test instanceof RegExp && test.test('.svg');
}) as { [key: string]: any };

imageRule.exclude = /\.svg$/;

config.module?.rules?.push({
test: /\.svg$/,
use: ['@svgr/webpack'],
});

return config;
},
};
export default config;
67 changes: 39 additions & 28 deletions app/page.tsx
Original file line number Diff line number Diff line change
@@ -1,39 +1,50 @@
import IconArrowFront from '/public/assets/icon/arrow-front.svg';

import { PageContainer } from '@/widgets/pageContainer/ui/PageContainer';
export default function Home() {
return (
<div className="flex flex-row justify-center gap-12 bg-[#666666]">
<div className="w-72">
<p className="bg-white text-black">White</p>
<p className="bg-gray01 text-black">Gray 01</p>
<p className="bg-gray02 text-black">Gray 02</p>
<p className="bg-gray03 text-black">Gray 03</p>
<p className="bg-gray04 text-black">Gray 04</p>
<p className="bg-gray05 text-black">Gray 05</p>
<p className="bg-gray06 text-black">Gray 06</p>
<p className="bg-gray07 text-white">Gray 07</p>
</div>
<PageContainer
headerProps={{
left: <IconArrowFront width="44" height="44" />,
center: <div className="text-black">๋ฉ”์ธํŽ˜์ด์ง€</div>,
right: <button className="w-[44px] h-[44px] pr-2 text-black">๊ฒŒ์‹œ</button>,
}}
>
<div className="mt-[44px] flex flex-col justify-center gap-12 bg-[#666666]">
<div className="w-72">
<p className="bg-white text-black">White</p>
<p className="bg-gray01 text-black">Gray 01</p>
<p className="bg-gray02 text-black">Gray 02</p>
<p className="bg-gray03 text-black">Gray 03</p>
<p className="bg-gray04 text-black">Gray 04</p>
<p className="bg-gray05 text-black">Gray 05</p>
<p className="bg-gray06 text-black">Gray 06</p>
<p className="bg-gray07 text-white">Gray 07</p>
</div>

<div className="w-72">
<p className="bg-red01 text-black">Red 01</p>
<p className="bg-red02 text-black">Red 02</p>
<p className="bg-red03 text-black">Red 03</p>
<div className="w-72">
<p className="bg-red01 text-black">Red 01</p>
<p className="bg-red02 text-black">Red 02</p>
<p className="bg-red03 text-black">Red 03</p>

<div className="h-6" />
<div className="h-6" />

<p className="bg-yellow01 text-black">Yellow 01</p>
<p className="bg-yellow02 text-black">Yellow 02</p>
</div>
<p className="bg-yellow01 text-black">Yellow 01</p>
<p className="bg-yellow02 text-black">Yellow 02</p>
</div>

<div className="w-72">
<p className="bg-ashblue01 text-black">Ashblue 01</p>
<p className="bg-ashblue02 text-black">Ashblue 02</p>
<p className="bg-overlay text-white">Overlay</p>
<div className="w-72">
<p className="bg-ashblue01 text-black">Ashblue 01</p>
<p className="bg-ashblue02 text-black">Ashblue 02</p>
<p className="bg-overlay text-white">Overlay</p>

<div className="h-6" />
<div className="h-6" />

<p className="bg-mint01 text-black">Mint 01</p>
<p className="bg-mint02 text-black">Mint 02</p>
<p className="bg-mint03 text-black">Mint 03</p>
<p className="bg-mint01 text-black">Mint 01</p>
<p className="bg-mint02 text-black">Mint 02</p>
<p className="bg-mint03 text-black">Mint 03</p>
</div>
</div>
</div>
</PageContainer>
);
}
4 changes: 4 additions & 0 deletions global.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
declare module '*.svg' {
const content: React.FunctionComponent<React.SVGAttributes<SVGElement>>;
export default content;
}
10 changes: 9 additions & 1 deletion next.config.mjs
Original file line number Diff line number Diff line change
@@ -1,4 +1,12 @@
/** @type {import('next').NextConfig} */
const nextConfig = {};
const nextConfig = {
webpack: (config) => {
config.module.rules.push({
test: /\.svg$/,
use: ["@svgr/webpack"],
});
return config;
},
};

export default nextConfig;
7 changes: 4 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,7 @@
},
"devDependencies": {
"@chromatic-com/storybook": "^1.9.0",
"@eslint/js": "^9.12.0",
"@tanstack/eslint-plugin-query": "^5.59.7",
"@tanstack/react-query-devtools": "^5.59.4",
"@eslint/js": "^9.12.0",
"@storybook/addon-a11y": "^8.3.5",
"@storybook/addon-designs": "^8.0.3",
"@storybook/addon-essentials": "^8.3.5",
Expand All @@ -38,6 +36,9 @@
"@storybook/nextjs": "^8.3.5",
"@storybook/react": "^8.3.5",
"@storybook/test": "^8.3.5",
"@svgr/webpack": "^8.1.0",
"@tanstack/eslint-plugin-query": "^5.59.7",
"@tanstack/react-query-devtools": "^5.59.4",
"@testing-library/react": "^16.0.1",
"@types/node": "^20",
"@types/react": "^18",
Expand Down
Loading

0 comments on commit cdf4564

Please sign in to comment.