MSP-3107 connect AppAccessPage to app
This commit is contained in:
1 parent
76404b06e9
commit
90e9485f19
4 files changed
+51
-13
No files matched your search
@@ -1,5 +1,5 @@
|
||||
import { Spin } from 'antd'
|
||||
import { Suspense, lazy } from 'react'
|
||||
import { lazy, Suspense } from 'react'
|
||||
import { Route, Routes } from 'react-router-dom'
|
||||
|
||||
import Layout from '@components/Layout'
|
||||
@@ -10,11 +10,9 @@ import PrivateRoute from '@routes/PrivateRoute'
|
||||
import { routePaths } from '@routes/routePaths.ts'
|
||||
|
||||
const LoginPage = lazy(() => import('@pages/LoginPage'))
|
||||
|
||||
const ErrorPage = lazy(() => import('@components/ErrorPage'))
|
||||
|
||||
|
||||
const ProfilePage = lazy(() => import('@pages/ProfilePage'))
|
||||
const AppAccessPage = lazy(() => import('@pages/AppAccessPage'))
|
||||
|
||||
const Routers = () => {
|
||||
return (
|
||||
@@ -29,17 +27,35 @@ const Routers = () => {
|
||||
</Suspense>
|
||||
}
|
||||
/>
|
||||
<Route
|
||||
path={`${routePaths.profile}`}
|
||||
element={
|
||||
<Suspense fallback={<Spin />}>
|
||||
<ProfilePage />
|
||||
</Suspense>
|
||||
}
|
||||
/>
|
||||
<Route
|
||||
path={`${routePaths.appAccess}`}
|
||||
element={
|
||||
<Suspense fallback={<Spin />}>
|
||||
<AppAccessPage />
|
||||
</Suspense>
|
||||
}
|
||||
>
|
||||
<Route
|
||||
path={`${routePaths.profile}`}
|
||||
path=":id"
|
||||
element={
|
||||
<Suspense fallback={<Spin />}>
|
||||
<ProfilePage />
|
||||
<AppAccessPage />
|
||||
</Suspense>
|
||||
}
|
||||
/>
|
||||
</Route>
|
||||
</Route>
|
||||
<Route path={routePaths.error}
|
||||
</Route>
|
||||
<Route
|
||||
path={routePaths.error}
|
||||
element={
|
||||
<Suspense fallback={<Spin />}>
|
||||
<ErrorPage />
|
||||
|
||||
@@ -1,9 +1,16 @@
|
||||
type RoutePaths = 'home' | 'notFound' | 'error' | 'login' | 'profile'
|
||||
type RoutePaths =
|
||||
| 'home'
|
||||
| 'notFound'
|
||||
| 'error'
|
||||
| 'login'
|
||||
| 'profile'
|
||||
| 'appAccess'
|
||||
|
||||
export const routePaths: Record<RoutePaths, string> = {
|
||||
home: '/',
|
||||
error: '/error',
|
||||
notFound: '*',
|
||||
login: '/login',
|
||||
profile: '/profile'
|
||||
profile: '/profile',
|
||||
appAccess: '/appAccess'
|
||||
}
|
||||
Reference in new issue
Block a user