From 250cd864c54dfe2205db7728a1626b726976aa43 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=A0=95=ED=98=84=EC=A1=B0?= Date: Thu, 5 Sep 2024 17:58:07 +0900 Subject: [PATCH] =?UTF-8?q?Feat:=20=EC=9B=8C=ED=81=AC=EC=8A=A4=ED=8E=98?= =?UTF-8?q?=EC=9D=B4=EC=8A=A4=20=EB=A0=88=EC=9D=B4=EC=95=84=EC=9B=83=20?= =?UTF-8?q?=EA=B8=B0=EB=B0=98=EC=9C=BC=EB=A1=9C=20Admin=20=EC=82=AC?= =?UTF-8?q?=EC=9D=B4=ED=8A=B8=20=EB=A0=88=EC=9D=B4=EC=95=84=EC=9B=83=20?= =?UTF-8?q?=EA=B5=AC=ED=98=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/AdminLayout/index.stories.tsx | 44 +++++++++++++++ frontend/src/components/AdminLayout/index.tsx | 32 +++++++++++ .../src/components/AdminMenuSidebar/index.tsx | 32 +++++++++++ .../components/AdminProjectSidebar/index.tsx | 54 +++++++++++++++++++ 4 files changed, 162 insertions(+) create mode 100644 frontend/src/components/AdminLayout/index.stories.tsx create mode 100644 frontend/src/components/AdminLayout/index.tsx create mode 100644 frontend/src/components/AdminMenuSidebar/index.tsx create mode 100644 frontend/src/components/AdminProjectSidebar/index.tsx diff --git a/frontend/src/components/AdminLayout/index.stories.tsx b/frontend/src/components/AdminLayout/index.stories.tsx new file mode 100644 index 0000000..9b60b9c --- /dev/null +++ b/frontend/src/components/AdminLayout/index.stories.tsx @@ -0,0 +1,44 @@ +import '@/index.css'; +import { Meta, StoryObj } from '@storybook/react'; +import AdminLayout from './index'; +import { BrowserRouter as Router } from 'react-router-dom'; +import { Workspace } from '@/types'; + +const meta: Meta = { + title: 'Layout/AdminLayout', + component: AdminLayout, + parameters: { + layout: 'fullscreen', + }, +}; + +export default meta; + +type Story = StoryObj; + +const workspace: Workspace = { + id: 1, + name: 'Workspace Alpha', + projects: [ + { + id: 1, + name: 'Project Alpha', + type: 'Segmentation', + children: [], + }, + { + id: 2, + name: 'Project Beta', + type: 'Classification', + children: [], + }, + ], +}; + +export const Default: Story = { + render: () => ( + + + + ), +}; diff --git a/frontend/src/components/AdminLayout/index.tsx b/frontend/src/components/AdminLayout/index.tsx new file mode 100644 index 0000000..39e24cb --- /dev/null +++ b/frontend/src/components/AdminLayout/index.tsx @@ -0,0 +1,32 @@ +import { Outlet } from 'react-router-dom'; +import Header from '../Header'; +import { ResizablePanelGroup, ResizablePanel } from '../ui/resizable'; +import AdminProjectSidebar from '../AdminProjectSidebar'; +import AdminMenuSidebar from '../AdminMenuSidebar'; +import { Workspace } from '@/types'; + +interface AdminLayoutProps { + workspace: Workspace; +} + +export default function AdminLayout({ workspace }: AdminLayoutProps) { + return ( + <> +
+
+ + + +
+ +
+
+ +
+
+ + ); +} diff --git a/frontend/src/components/AdminMenuSidebar/index.tsx b/frontend/src/components/AdminMenuSidebar/index.tsx new file mode 100644 index 0000000..154e604 --- /dev/null +++ b/frontend/src/components/AdminMenuSidebar/index.tsx @@ -0,0 +1,32 @@ +import { useNavigate } from 'react-router-dom'; +import { cn } from '@/lib/utils'; + +export default function AdminMenuSidebar() { + const navigate = useNavigate(); + + const menuItems = [ + { label: '작업', path: '/admin/tasks' }, + { label: '리뷰', path: '/admin/reviews' }, + { label: '멤버 관리', path: '/admin/members' }, + ]; + + return ( +
+

메뉴

+
+ {menuItems.map((item) => ( + + ))} +
+
+ ); +} diff --git a/frontend/src/components/AdminProjectSidebar/index.tsx b/frontend/src/components/AdminProjectSidebar/index.tsx new file mode 100644 index 0000000..7e984fb --- /dev/null +++ b/frontend/src/components/AdminProjectSidebar/index.tsx @@ -0,0 +1,54 @@ +import { ResizablePanel, ResizableHandle } from '../ui/resizable'; +import { Project } from '@/types'; +import { useNavigate } from 'react-router-dom'; +import { SquarePen } from 'lucide-react'; +import { Button } from '../ui/button'; + +interface AdminProjectSidebarProps { + workspaceName: string; + projects: Project[]; +} + +export default function AdminProjectSidebar({ workspaceName, projects }: AdminProjectSidebarProps): JSX.Element { + const navigate = useNavigate(); + + return ( + <> + +
+

+ {workspaceName} +

+ + +
+
+ {projects.map((project) => ( + + ))} +
+
+ + + ); +}