Update pulled app foundation out into a route of its own
This commit is contained in:
+14
-1
@@ -1,5 +1,5 @@
|
|||||||
import 'leaflet/dist/leaflet.css';
|
import 'leaflet/dist/leaflet.css';
|
||||||
import { Routes, Route } from 'react-router-dom';
|
import { Routes, Route, Navigate } from 'react-router-dom';
|
||||||
import { useRecipe, Grid, GridItem, useDialog } from "@chakra-ui/react";
|
import { useRecipe, Grid, GridItem, useDialog } from "@chakra-ui/react";
|
||||||
import { createContext } from "react";
|
import { createContext } from "react";
|
||||||
import Login from "@/Login.jsx";
|
import Login from "@/Login.jsx";
|
||||||
@@ -51,12 +51,25 @@ function App() {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<Routes>
|
<Routes>
|
||||||
|
{/*Public Routes*/}
|
||||||
<Route path="/login" element={<Login />} />
|
<Route path="/login" element={<Login />} />
|
||||||
<Route path="/home" element={<AppFoundation> <Home/> </AppFoundation>} />
|
<Route path="/home" element={<AppFoundation> <Home/> </AppFoundation>} />
|
||||||
<Route path="/global-map" element={<AppFoundation> <GlobalMap/> </AppFoundation>} />
|
<Route path="/global-map" element={<AppFoundation> <GlobalMap/> </AppFoundation>} />
|
||||||
<Route path="/regional-map" element={<AppFoundation> <RegionalMap/> </AppFoundation>} />
|
<Route path="/regional-map" element={<AppFoundation> <RegionalMap/> </AppFoundation>} />
|
||||||
<Route path="/volcano" element={<AppFoundation> <Volcano/> </AppFoundation>} />
|
<Route path="/volcano" element={<AppFoundation> <Volcano/> </AppFoundation>} />
|
||||||
<Route path="/admin" element={<AppFoundation> <Admin/> </AppFoundation>} />
|
<Route path="/admin" element={<AppFoundation> <Admin/> </AppFoundation>} />
|
||||||
|
|
||||||
|
{/*Non-Public Routes*/}
|
||||||
|
<Route element={<AppFoundation />}>
|
||||||
|
<Route path="/home" element={<Home />} />
|
||||||
|
<Route path="/global-map" element={<GlobalMap />} />
|
||||||
|
<Route path="/regional-map" element={<RegionalMap />} />
|
||||||
|
<Route path="/volcano" element={<Volcano />} />
|
||||||
|
<Route path="/admin" element={<Admin />} />
|
||||||
|
</Route>
|
||||||
|
|
||||||
|
{/*Redirect Routes*/}
|
||||||
|
<Route path="/" element={<Navigate to="/home" replace />} />
|
||||||
</Routes>
|
</Routes>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user