Update pulled app foundation out into a route of its own
This commit is contained in:
+24
-11
@@ -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";
|
||||||
@@ -46,17 +46,30 @@ function AppFoundation({children}) {
|
|||||||
// }
|
// }
|
||||||
|
|
||||||
function App() {
|
function App() {
|
||||||
const sidebarContext = createContext(["Home", "Global Map", "Regional Map", "Volcano", "Admin"]);
|
const sidebarContext = createContext(["Home", "Global Map", "Regional Map", "Volcano", "Admin"]);
|
||||||
// const [user, setUser] = useState(null);
|
// const [user, setUser] = useState(null);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Routes>
|
<Routes>
|
||||||
<Route path="/login" element={<Login />} />
|
{/*Public Routes*/}
|
||||||
<Route path="/home" element={<AppFoundation> <Home/> </AppFoundation>} />
|
<Route path="/login" element={<Login />} />
|
||||||
<Route path="/global-map" element={<AppFoundation> <GlobalMap/> </AppFoundation>} />
|
<Route path="/home" element={<AppFoundation> <Home/> </AppFoundation>} />
|
||||||
<Route path="/regional-map" element={<AppFoundation> <RegionalMap/> </AppFoundation>} />
|
<Route path="/global-map" element={<AppFoundation> <GlobalMap/> </AppFoundation>} />
|
||||||
<Route path="/volcano" element={<AppFoundation> <Volcano/> </AppFoundation>} />
|
<Route path="/regional-map" element={<AppFoundation> <RegionalMap/> </AppFoundation>} />
|
||||||
<Route path="/admin" element={<AppFoundation> <Admin/> </AppFoundation>} />
|
<Route path="/volcano" element={<AppFoundation> <Volcano/> </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