1 | // eslint-disable-next-line no-unused-vars
|
---|
2 | import React from "react";
|
---|
3 | import {BrowserRouter as Router, Route, Routes} from "react-router-dom";
|
---|
4 | import BrowseMaps from "./pages/BrowseMaps/BrowseMaps.jsx";
|
---|
5 | import LoginPage from "./pages/Login/Login";
|
---|
6 | import Signup from "./pages/Signup/Signup";
|
---|
7 | import IMaps from "./pages/IMaps/IMaps";
|
---|
8 | import Draw from "./pages/Draw/Draw";
|
---|
9 | import Error from "./pages/Error/Error";
|
---|
10 | import ProtectedRoute from "./components/ProtectedRoute/ProtectedRoute";
|
---|
11 | import "./App.css";
|
---|
12 | import MapView from "./pages/MapView/MapView.jsx";
|
---|
13 | import MyMaps from "./pages/MyMaps/MyMaps.jsx";
|
---|
14 |
|
---|
15 | import '@fontsource/roboto/300.css';
|
---|
16 | import '@fontsource/roboto/400.css';
|
---|
17 | import '@fontsource/roboto/500.css';
|
---|
18 | import '@fontsource/roboto/700.css';
|
---|
19 | import {AppProvider} from "./components/AppContext/AppContext.jsx";
|
---|
20 | import AdminPage from "./pages/AdminPage/AdminPage.jsx";
|
---|
21 |
|
---|
22 |
|
---|
23 | function App() {
|
---|
24 |
|
---|
25 | return (
|
---|
26 |
|
---|
27 | <AppProvider>
|
---|
28 | <Router>
|
---|
29 | <Routes>
|
---|
30 |
|
---|
31 | <Route element={<ProtectedRoute/>}>
|
---|
32 | <Route path="/myMaps/:mapName/Draw" element={<Draw/>}/>
|
---|
33 | <Route path="/myMaps" element={<MyMaps/>}/>
|
---|
34 | <Route path="/myMaps/:mapName/View" element={<MapView isPrivate={true}/>}/>
|
---|
35 | <Route path="/Admin" element={<AdminPage/>}/>
|
---|
36 | </Route>
|
---|
37 | <Route path="/" element={<IMaps/>}/>
|
---|
38 | <Route path="/Maps/:mapName/View" element={<MapView isPrivate={false}/>}/>
|
---|
39 | <Route path="/Maps" element={<BrowseMaps/>}/>
|
---|
40 |
|
---|
41 |
|
---|
42 | <Route path="/Login" element={<LoginPage/>}/>
|
---|
43 | <Route path="/Signup" element={<Signup/>}/>
|
---|
44 |
|
---|
45 | <Route path="*" element={<Error/>}/>
|
---|
46 | </Routes>
|
---|
47 | </Router>
|
---|
48 | </AppProvider>
|
---|
49 |
|
---|
50 |
|
---|
51 | );
|
---|
52 | }
|
---|
53 |
|
---|
54 | export default App;
|
---|