-
Notifications
You must be signed in to change notification settings - Fork 1
/
router.tsx
84 lines (80 loc) · 2.04 KB
/
router.tsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
import AuthGuard from '@features/auth/components/auth-guard.tsx'
import * as Sentry from '@sentry/react'
import { createBrowserRouter } from 'react-router-dom'
import ErrorPage from '../pages/error-page.tsx'
import Login from '../pages/login.tsx'
import MissionPage from '../pages/mission-page.tsx'
import MissionsPage from '../pages/missions-page.tsx'
import SignUp from '../pages/signup.tsx'
import Home2 from '../v2/pages/home.tsx'
import MissionListUlamPage from '../v2/pages/mission-list-ulam-page.tsx'
import MissionPamPage from '../v2/pages/mission-pam-page.tsx'
import MissionUlamPage from '../v2/pages/mission-ulam-page.tsx'
export const getPath = (path: string) => `/${path}`
export const ROOT_PATH = '/'
export const LOGIN_PATH = 'login'
export const SIGNUP_PATH = 'signup'
export const PAM_HOME_PATH = '/pam/missions'
export const PAM_V2_HOME_PATH = 'v2/pam/missions'
export const ULAM_V2_HOME_PATH = '/v2/ulam/missions'
const sentryCreateBrowserRouter = Sentry.wrapCreateBrowserRouter(createBrowserRouter)
export const router = sentryCreateBrowserRouter([
{
path: ROOT_PATH,
element: <Home2 />,
errorElement: <ErrorPage />
},
{
path: LOGIN_PATH,
element: <Login />
},
{
path: SIGNUP_PATH,
element: <SignUp />
},
{
path: PAM_HOME_PATH,
element: (
<AuthGuard>
<MissionsPage />
</AuthGuard>
),
errorElement: <ErrorPage />
},
{
path: 'pam/missions/:missionId/:actionId?',
element: (
<AuthGuard>
<MissionPage />
</AuthGuard>
)
},
//V2
{
path: ULAM_V2_HOME_PATH,
element: (
<AuthGuard>
<MissionListUlamPage />
</AuthGuard>
),
errorElement: <ErrorPage />
},
{
path: `${ULAM_V2_HOME_PATH}/:missionId/:actionId?`,
element: (
<AuthGuard>
<MissionUlamPage />
</AuthGuard>
),
errorElement: <ErrorPage />
},
{
path: `${PAM_V2_HOME_PATH}/:missionId/:actionId?`,
element: (
<AuthGuard>
<MissionPamPage />
</AuthGuard>
),
errorElement: <ErrorPage />
}
])