diff options
Diffstat (limited to 'frontend/src/App.js')
| -rw-r--r-- | frontend/src/App.js | 49 |
1 files changed, 0 insertions, 49 deletions
diff --git a/frontend/src/App.js b/frontend/src/App.js deleted file mode 100644 index d96fa88..0000000 --- a/frontend/src/App.js +++ /dev/null | |||
| @@ -1,49 +0,0 @@ | |||
| 1 | import React from 'react'; | ||
| 2 | import { BrowserRouter, Routes, Route} from "react-router-dom"; | ||
| 3 | |||
| 4 | import Sidebar from "./components/sidebar.js" | ||
| 5 | import Main from "./components/main.js" | ||
| 6 | import "./App.css"; | ||
| 7 | |||
| 8 | import Summary from "./components/pages/summary.js" | ||
| 9 | import Profile from "./components/pages/profile.js" | ||
| 10 | import About from './components/pages/about.js'; | ||
| 11 | import Games from "./components/pages/games.js"; | ||
| 12 | import Maplist from './components/pages/maplist.js'; | ||
| 13 | import Home from "./components/pages/maplist.js"; | ||
| 14 | import Homepage from './components/pages/home.js'; | ||
| 15 | |||
| 16 | |||
| 17 | export default function App() { | ||
| 18 | const [token, setToken] = React.useState(null); | ||
| 19 | const [mod,setMod] = React.useState(false) | ||
| 20 | React.useEffect(()=>{ | ||
| 21 | if(token!==null){ | ||
| 22 | setMod(JSON.parse(atob(token.split(".")[1])).mod) | ||
| 23 | } | ||
| 24 | },[token]) | ||
| 25 | |||
| 26 | return ( | ||
| 27 | <> | ||
| 28 | <BrowserRouter> | ||
| 29 | <Sidebar token={token} setToken={setToken}/> | ||
| 30 | <Routes> | ||
| 31 | <Route index element={<Homepage token={token} mod={mod} setToken={setToken}/>}></Route> | ||
| 32 | <Route path="/news" element={<Main text="News"/>}></Route> | ||
| 33 | <Route path="/records" element={<Main text="Records"/>}></Route> | ||
| 34 | <Route path="/leaderboards" element={<Main text="Leaderboards"/>}></Route> | ||
| 35 | <Route path="/discussions" element={<Main text="Discussion"/>}></Route> | ||
| 36 | <Route path="/scorelog" element={<Main text="Score logs"/>}></Route> | ||
| 37 | <Route path="/profile" element={<Profile token={token}/>}></Route> | ||
| 38 | <Route path="/users/*" element={<Profile/>}></Route> | ||
| 39 | <Route path="/rules" element={<Main text="Rules"/>}></Route> | ||
| 40 | <Route path="/about" element={<About/>}></Route> | ||
| 41 | <Route path="/maps/*" element={<Summary token={token} mod={mod}/>}></Route> | ||
| 42 | <Route path="/games" element={<Games/>}></Route> | ||
| 43 | <Route path="/games/*" element={<Maplist token={token} mod={mod} />}></Route> | ||
| 44 | <Route path="*" element={<Main text="404 Page not found"/>}></Route> | ||
| 45 | </Routes> | ||
| 46 | </BrowserRouter> | ||
| 47 | </> | ||
| 48 | ) | ||
| 49 | } \ No newline at end of file | ||