added router for page navigation

This commit is contained in:
Carter 2024-11-13 10:16:59 -06:00
parent a1a76b48d1
commit e639e2cdf9

36
src/navigation/Router.tsx Normal file
View 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>
)
}