Refator: 워크스페이스(레이블링 작업공간) 라우터 변경

This commit is contained in:
정현조 2024-09-13 08:21:09 +09:00
parent db51fe659b
commit 2a4effff47

View File

@ -13,8 +13,9 @@ import { Navigate } from 'react-router-dom';
export const webPath = { export const webPath = {
home: () => '/', home: () => '/',
browse: () => '/browse', browse: () => '/browse',
workspace: () => '/workspace', workspace: (workspaceId: string, projectId?: string) =>
admin: (id: string) => `/admin/${id}`, projectId ? `/workspace/${workspaceId}/project/${projectId}` : `/workspace/${workspaceId}`,
admin: (workspaceId: string) => `/admin/${workspaceId}`,
oauthCallback: () => '/redirect/oauth2', oauthCallback: () => '/redirect/oauth2',
}; };
@ -44,17 +45,21 @@ const router = createBrowserRouter([
], ],
}, },
{ {
path: webPath.workspace(), path: '/workspace/:workspaceId',
element: <WorkspaceLayout />, element: <WorkspaceLayout />,
children: [ children: [
{ {
index: true, path: '',
element: <div>workspace</div>, element: <div>workspace</div>,
}, },
{
path: 'project/:projectId',
element: <div>workspace project</div>,
},
], ],
}, },
{ {
path: webPath.admin(':id'), path: webPath.admin(':workspaceId'),
element: <AdminLayout />, element: <AdminLayout />,
children: [ children: [
{ {