routes to TS
This commit is contained in:
1 parent
2f6dbe9a3a
commit
86fd535eaf
2 files changed
+5
-5
No files matched your search
@@ -9,8 +9,8 @@ import { useTheme } from "@mui/material";
|
|||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
|
|
||||||
interface NotFoundProps {
|
interface NotFoundProps {
|
||||||
title: string;
|
title?: string;
|
||||||
desc: string;
|
desc?: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
const NotFoundPage = ({ title, desc }: NotFoundProps) => {
|
const NotFoundPage = ({ title, desc }: NotFoundProps) => {
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ import { ThemeProvider } from "@mui/material";
|
|||||||
import { lightTheme, darkTheme } from "@/Utils/Theme/v2Theme";
|
import { lightTheme, darkTheme } from "@/Utils/Theme/v2Theme";
|
||||||
|
|
||||||
import { useSelector } from "react-redux";
|
import { useSelector } from "react-redux";
|
||||||
|
import type { RootState } from "@/store";
|
||||||
import { Navigate, Route, Routes as LibRoutes } from "react-router";
|
import { Navigate, Route, Routes as LibRoutes } from "react-router";
|
||||||
import RootLayout from "@/Components/v2/layout/RootLayout";
|
import RootLayout from "@/Components/v2/layout/RootLayout";
|
||||||
import NotFound from "@/Pages/NotFound";
|
import NotFound from "@/Pages/NotFound";
|
||||||
@@ -59,7 +60,7 @@ import {
|
|||||||
import CreateMonitor from "@/Pages/CreateMonitor";
|
import CreateMonitor from "@/Pages/CreateMonitor";
|
||||||
|
|
||||||
const Routes = () => {
|
const Routes = () => {
|
||||||
const mode = useSelector((state) => state.ui.mode);
|
const mode = useSelector((state: RootState) => state.ui.mode);
|
||||||
const v2theme = mode === "light" ? lightTheme : darkTheme;
|
const v2theme = mode === "light" ? lightTheme : darkTheme;
|
||||||
return (
|
return (
|
||||||
<LibRoutes>
|
<LibRoutes>
|
||||||
@@ -390,12 +391,11 @@ const Routes = () => {
|
|||||||
/>
|
/>
|
||||||
|
|
||||||
<Route
|
<Route
|
||||||
exact
|
|
||||||
path="/register/:token"
|
path="/register/:token"
|
||||||
element={
|
element={
|
||||||
<>
|
<>
|
||||||
<ThemeProvider theme={v2theme}>
|
<ThemeProvider theme={v2theme}>
|
||||||
<AuthRegister superAdminExists={true} />
|
<AuthRegister />
|
||||||
</ThemeProvider>
|
</ThemeProvider>
|
||||||
</>
|
</>
|
||||||
}
|
}
|
||||||
Reference in new issue
Block a user