From cc5948168752680f8ffb4a1b9cd1411d68378ad1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=A0=95=ED=98=84=EC=A1=B0?= Date: Mon, 9 Sep 2024 15:02:32 +0900 Subject: [PATCH] =?UTF-8?q?Refactor:=20=EC=9B=8C=ED=81=AC=EC=8A=A4?= =?UTF-8?q?=ED=8E=98=EC=9D=B4=EC=8A=A4=20=EB=A0=88=EC=9D=B4=EC=95=84?= =?UTF-8?q?=EC=9B=83=EC=97=90=EC=84=9C=20=EC=9B=8C=ED=81=AC=EC=8A=A4?= =?UTF-8?q?=ED=8E=98=EC=9D=B4=EC=8A=A4=EA=B0=80=20=20=EC=97=86=EC=9D=84=20?= =?UTF-8?q?=EA=B2=BD=EC=9A=B0=20=EC=B6=94=EA=B0=80,=20=EC=8A=A4=ED=86=A0?= =?UTF-8?q?=EB=A6=AC=EB=B6=81=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../WorkspaceBrowseLayout/index.stories.tsx | 23 ++++++++++++++++++ .../WorkspaceBrowseLayout/index.tsx | 24 ++++++++++--------- 2 files changed, 36 insertions(+), 11 deletions(-) create mode 100644 frontend/src/components/WorkspaceBrowseLayout/index.stories.tsx diff --git a/frontend/src/components/WorkspaceBrowseLayout/index.stories.tsx b/frontend/src/components/WorkspaceBrowseLayout/index.stories.tsx new file mode 100644 index 0000000..6a37e1b --- /dev/null +++ b/frontend/src/components/WorkspaceBrowseLayout/index.stories.tsx @@ -0,0 +1,23 @@ +import '@/index.css'; +import { Meta, StoryObj } from '@storybook/react'; +import WorkspaceBrowseLayout from '.'; + +const meta: Meta = { + title: 'Layout/WorkspaceBrowseLayout', + component: WorkspaceBrowseLayout, + parameters: { + layout: 'fullscreen', + }, +}; + +export default meta; + +type Story = StoryObj; + +export const Default: Story = { + render: () => , +}; + +export const Empty: Story = { + render: () => , +}; diff --git a/frontend/src/components/WorkspaceBrowseLayout/index.tsx b/frontend/src/components/WorkspaceBrowseLayout/index.tsx index 617745f..cfca174 100644 --- a/frontend/src/components/WorkspaceBrowseLayout/index.tsx +++ b/frontend/src/components/WorkspaceBrowseLayout/index.tsx @@ -1,7 +1,6 @@ import { Suspense } from 'react'; import { NavLink, Outlet } from 'react-router-dom'; import Header from '../Header'; -import Footer from '../Footer'; import { Workspace } from '@/types'; import { Dialog, DialogContent, DialogHeader, DialogTrigger } from '../ui/dialogCustom'; import { Plus } from 'lucide-react'; @@ -60,15 +59,19 @@ export default function WorkspaceBrowseLayout() { - {workspaces.map((workspace) => ( - (isActive ? 'body-strong' : 'body') + ' cursor-pointer'} - > - {workspace.name} - - ))} + {workspaces.length > 0 ? ( + workspaces.map((workspace) => ( + (isActive ? 'body-strong' : 'body') + ' cursor-pointer'} + > + {workspace.name} + + )) + ) : ( +

워크스페이스가 없습니다.

+ )}
}> @@ -76,7 +79,6 @@ export default function WorkspaceBrowseLayout() { -