Refactor: AdminIndex 일때 레이아웃 기능 제거

This commit is contained in:
정현조 2024-09-20 09:53:58 +09:00
parent 0f7e1f84c9
commit c6fc24c933

View File

@ -1,18 +1,16 @@
import { Outlet, useMatch } from 'react-router-dom';
import { Outlet } from 'react-router-dom';
import Header from '../Header';
import { ResizablePanelGroup, ResizablePanel } from '../ui/resizable';
import AdminProjectSidebar from '../AdminProjectSidebar';
import AdminMenuSidebar from '../AdminMenuSidebar';
export default function AdminLayout() {
const isIndexPage = useMatch({ path: '/admin/:workspaceId', end: true });
return (
<>
<Header className="fixed left-0 top-0" />
<div className="mt-16 h-[calc(100vh-64px)] w-screen">
<ResizablePanelGroup direction="horizontal">
{!isIndexPage && <AdminProjectSidebar />}
<AdminProjectSidebar />
<ResizablePanel className="flex w-full items-center">
<main className="h-full grow">
@ -21,11 +19,11 @@ export default function AdminLayout() {
</ResizablePanel>
<AdminMenuSidebar />
</ResizablePanelGroup>
{isIndexPage && (
<main className="h-full w-full">
<Outlet />
</main>
)}
(
<main className="h-full w-full">
<Outlet />
</main>
)
</div>
</>
);