From 8886c5c7ab871a25d81d83518060a9e39d1fff45 Mon Sep 17 00:00:00 2001 From: suji8073 Date: Tue, 17 Jun 2025 00:16:19 +0900 Subject: [PATCH 1/3] =?UTF-8?q?[feat]=20TopList=20=EC=BB=B4=ED=8F=AC?= =?UTF-8?q?=EB=84=8C=ED=8A=B8=20=EA=B5=AC=ED=98=84=20-=20folder.svg=20?= =?UTF-8?q?=EC=B6=94=EA=B0=80(=EC=9E=84=EC=8B=9C)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/folder.svg | 3 +++ src/components/molecules/topList/TopList.tsx | 28 ++++++++++++++++++++ src/components/molecules/topList/index.ts | 1 + 3 files changed, 32 insertions(+) create mode 100644 public/folder.svg create mode 100644 src/components/molecules/topList/TopList.tsx create mode 100644 src/components/molecules/topList/index.ts diff --git a/public/folder.svg b/public/folder.svg new file mode 100644 index 0000000..fe14dd6 --- /dev/null +++ b/public/folder.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/components/molecules/topList/TopList.tsx b/src/components/molecules/topList/TopList.tsx new file mode 100644 index 0000000..0de2e52 --- /dev/null +++ b/src/components/molecules/topList/TopList.tsx @@ -0,0 +1,28 @@ +import Folder from '../../../../public/folder.svg'; + +interface TopListProps { + label: string; + progressText?: string; // '0/8' or undefined +} + +export const TopList = ({ label, progressText }: TopListProps) => { + return ( +
+
+ + {progressText ?? '완료'} + +
+ + + +
+ {label} +
+
+ ); +}; diff --git a/src/components/molecules/topList/index.ts b/src/components/molecules/topList/index.ts new file mode 100644 index 0000000..e03aa6a --- /dev/null +++ b/src/components/molecules/topList/index.ts @@ -0,0 +1 @@ +export { TopList } from './TopList'; From 0efab5dfc211da6848d7252eb1d282a8da00c0d2 Mon Sep 17 00:00:00 2001 From: suji8073 Date: Tue, 17 Jun 2025 00:17:46 +0900 Subject: [PATCH 2/3] =?UTF-8?q?[feat]=20TopList=20=EC=8A=A4=ED=86=A0?= =?UTF-8?q?=EB=A6=AC=EB=B6=81=20=EA=B5=AC=EC=84=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../molecules/topList/TopList.stories.tsx | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 src/components/molecules/topList/TopList.stories.tsx diff --git a/src/components/molecules/topList/TopList.stories.tsx b/src/components/molecules/topList/TopList.stories.tsx new file mode 100644 index 0000000..07db134 --- /dev/null +++ b/src/components/molecules/topList/TopList.stories.tsx @@ -0,0 +1,23 @@ +import type { Meta, StoryObj } from '@storybook/react'; +import { TopList } from './TopList'; + +const meta: Meta = { + title: 'components/TopList', + component: TopList, +}; + +export default meta; +type Story = StoryObj; + +export const inprogress: Story = { + args: { + label: 'text', + progressText: '0/8', + }, +}; + +export const complete: Story = { + args: { + label: 'text', + }, +}; From 3bcc8b596a4037f883da83ea3a613d33b9c37aaf Mon Sep 17 00:00:00 2001 From: suji8073 Date: Tue, 17 Jun 2025 23:54:21 +0900 Subject: [PATCH 3/3] =?UTF-8?q?[refactor]=20currentCount,=20totlaCount=20p?= =?UTF-8?q?rops=20=EC=B6=94=EA=B0=80=20-=20progressText=EC=99=80=20?= =?UTF-8?q?=EA=B0=99=EC=9D=B4=20=EA=B0=80=EA=B3=B5=EB=90=9C=20=EB=AC=B8?= =?UTF-8?q?=EC=9E=90=EC=97=B4=EC=9D=B4=20=EC=95=84=EB=8B=8C=20=EA=B0=81?= =?UTF-8?q?=EA=B0=81=20Number=20=ED=83=80=EC=9E=85=EC=9C=BC=EB=A1=9C=20pro?= =?UTF-8?q?ps=20=EC=A0=84=EB=8B=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../molecules/topList/TopList.stories.tsx | 5 ++++- src/components/molecules/topList/TopList.tsx | 14 ++++++++------ 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/src/components/molecules/topList/TopList.stories.tsx b/src/components/molecules/topList/TopList.stories.tsx index 07db134..e6a8a47 100644 --- a/src/components/molecules/topList/TopList.stories.tsx +++ b/src/components/molecules/topList/TopList.stories.tsx @@ -12,12 +12,15 @@ type Story = StoryObj; export const inprogress: Story = { args: { label: 'text', - progressText: '0/8', + currentCount: 0, + totalCount: 8, }, }; export const complete: Story = { args: { label: 'text', + currentCount: 8, + totalCount: 8, }, }; diff --git a/src/components/molecules/topList/TopList.tsx b/src/components/molecules/topList/TopList.tsx index 0de2e52..1926645 100644 --- a/src/components/molecules/topList/TopList.tsx +++ b/src/components/molecules/topList/TopList.tsx @@ -2,27 +2,29 @@ import Folder from '../../../../public/folder.svg'; interface TopListProps { label: string; - progressText?: string; // '0/8' or undefined + currentCount: number; + totalCount: number; } -export const TopList = ({ label, progressText }: TopListProps) => { +export const TopList = ({ label, currentCount, totalCount }: TopListProps) => { + const isCompleted = currentCount === totalCount; return (
- {progressText ?? '완료'} + {isCompleted ? '완료' : `${currentCount}/${totalCount}`}
-
+ {label} -
+
); };