added router for page navigation
This commit is contained in:
parent
a1a76b48d1
commit
e639e2cdf9
1 changed files with 36 additions and 0 deletions
36
src/navigation/Router.tsx
Normal file
36
src/navigation/Router.tsx
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
import { Suspense } from "react";
|
||||
import LoadingScreen from "../app/LoadingScreen";
|
||||
import { BrowserRouter, Navigate, Route, Routes } from "react-router-dom";
|
||||
import { Typography } from "@mui/material";
|
||||
|
||||
|
||||
|
||||
export default function Router() {
|
||||
|
||||
|
||||
const hello = () => {
|
||||
return (
|
||||
<Typography>
|
||||
Hello!
|
||||
</Typography>
|
||||
)
|
||||
}
|
||||
|
||||
return (
|
||||
<Suspense fallback={<LoadingScreen />}>
|
||||
<BrowserRouter>
|
||||
<Routes>
|
||||
|
||||
{/* Redirects */}
|
||||
<Route path="/callback" element={<Navigate to="/" />} />
|
||||
|
||||
{/* Page routes */}
|
||||
<Route index element={hello()} />
|
||||
{/* <Route path="blogs" element={<Blogs />} />
|
||||
<Route path="contact" element={<Contact />} />
|
||||
<Route path="*" element={<NoPage />} /> */}
|
||||
</Routes>
|
||||
</BrowserRouter>
|
||||
</Suspense>
|
||||
)
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue