diff --git a/frontend/src/components/AdminMenuSidebar/index.tsx b/frontend/src/components/AdminMenuSidebar/index.tsx index 2010ac4..21b5e39 100644 --- a/frontend/src/components/AdminMenuSidebar/index.tsx +++ b/frontend/src/components/AdminMenuSidebar/index.tsx @@ -1,21 +1,22 @@ import { Link, useLocation, useParams } from 'react-router-dom'; import { cn } from '@/lib/utils'; + export default function AdminMenuSidebar() { const location = useLocation(); - const { workspaceId } = useParams<{ workspaceId: string }>(); + const { workspaceId, projectId } = useParams<{ workspaceId: string; projectId?: string }>(); const menuItems = [ { label: '리뷰', - path: `/admin/${workspaceId}/reviews`, + path: projectId ? `/admin/${workspaceId}/reviews/${projectId}` : `/admin/${workspaceId}/reviews`, }, { label: '멤버 관리', - path: `/admin/${workspaceId}/members`, + path: projectId ? `/admin/${workspaceId}/members/${projectId}` : `/admin/${workspaceId}/members`, }, { label: '모델 관리', - path: `/admin/${workspaceId}/models`, + path: projectId ? `/admin/${workspaceId}/models/${projectId}` : `/admin/${workspaceId}/models`, }, ]; diff --git a/frontend/src/components/AdminProjectSidebar/index.tsx b/frontend/src/components/AdminProjectSidebar/index.tsx index 454df8a..d6bf1b1 100644 --- a/frontend/src/components/AdminProjectSidebar/index.tsx +++ b/frontend/src/components/AdminProjectSidebar/index.tsx @@ -1,5 +1,5 @@ import { ResizablePanel, ResizableHandle } from '../ui/resizable'; -import { Link, useLocation, useNavigate, useParams } from 'react-router-dom'; +import { Link, useLocation, useParams } from 'react-router-dom'; import { SquarePen } from 'lucide-react'; import useProjectListQuery from '@/queries/projects/useProjectListQuery'; import useCreateProjectQuery from '@/queries/projects/useCreateProjectQuery'; @@ -11,7 +11,6 @@ import { cn } from '@/lib/utils'; export default function AdminProjectSidebar(): JSX.Element { const location = useLocation(); - const navigate = useNavigate(); const { workspaceId, projectId } = useParams<{ workspaceId: string; projectId?: string }>(); const profile = useAuthStore((state) => state.profile); const memberId = profile?.id || 0; @@ -31,13 +30,6 @@ export default function AdminProjectSidebar(): JSX.Element { }); }; - const handleHeaderClick = () => { - navigate({ - pathname: location.pathname, - search: '', - }); - }; - const getNewPath = (newProjectId: string) => { if (location.pathname.includes('reviews')) { return `/admin/${workspaceId}/reviews/${newProjectId}`; @@ -51,6 +43,9 @@ export default function AdminProjectSidebar(): JSX.Element { return location.pathname; }; + const basePath = location.pathname.split('/')[3]; + const basePathWithoutProjectId = `/admin/${workspaceId}/${basePath}`; + return ( <>
-

{workspaceTitle} -

+