MSP-3523 add notFound page

This commit is contained in:
veselovnk committed 2024-06-27 11:31:16 +03:00
1 parent 63084e945f
commit 37e9093166
2 files changed
+41 -9

No files matched your search

+21
View File
@@ -0,0 +1,21 @@
import { Button } from 'antd'
import { Layout } from 'isp-ui-kit'
import { useNavigate } from 'react-router-dom'
import { routePaths } from '@routes/routePaths.ts'
const { NotFoundPage } = Layout
const NotFound = () => {
const navigate = useNavigate()
return (
<NotFoundPage>
<Button type="primary" onClick={() => navigate(routePaths.modules)}>
На главную
</Button>
</NotFoundPage>
)
}
export default NotFound
+20 -9
View File
@@ -4,6 +4,7 @@ import { lazy, Suspense } from 'react'
import { Navigate, Route, Routes } from 'react-router-dom'
import LayoutComponent from '@components/Layout'
// Составная часть основной страницы, поэтому без lazy
import Configurations from '@pages/ConfigurationsPage'
import Connections from '@pages/ConnectionsPage'
@@ -26,7 +27,9 @@ const ModulesPage = lazy(() => import('@pages/ModulesPage'))
const ApplicationsPage = lazy(() => import('@pages/ApplicationsPage'))
const AllVersionsPage = lazy(() => import('@pages/AllVersionsPage'))
const ConfigurationEditorPage = lazy(
() => import('@pages/ConfigurationEditorPage'))
() => import('@pages/ConfigurationEditorPage')
)
const NotFound = lazy(() => import('@pages/NotFound'))
const Routers = () => {
return (
@@ -151,14 +154,14 @@ const Routers = () => {
}
/>
</Route>
<Route path={`:moduleId/${routePaths.configEditor}/:id`}
element={
<Suspense fallback={<Spin />}>
<ConfigurationEditorPage />
</Suspense>
}>
</Route>
<Route
path={`:moduleId/${routePaths.configEditor}/:id`}
element={
<Suspense fallback={<Spin />}>
<ConfigurationEditorPage />
</Suspense>
}
></Route>
<Route
path={routePaths.modules}
element={
@@ -213,6 +216,14 @@ const Routers = () => {
</Suspense>
}
/>
<Route
path={routePaths.notFound}
element={
<Suspense fallback={<Spin />}>
<NotFound />
</Suspense>
}
/>
</Routes>
)
}