diff options
Diffstat (limited to 'frontend/src/App.tsx')
| -rw-r--r-- | frontend/src/App.tsx | 106 |
1 files changed, 64 insertions, 42 deletions
diff --git a/frontend/src/App.tsx b/frontend/src/App.tsx index fbfa59f..8a95e77 100644 --- a/frontend/src/App.tsx +++ b/frontend/src/App.tsx | |||
| @@ -6,18 +6,18 @@ import { UserProfile } from "@customTypes/Profile"; | |||
| 6 | import Sidebar from "./components/Sidebar"; | 6 | import Sidebar from "./components/Sidebar"; |
| 7 | import "./App.css"; | 7 | import "./App.css"; |
| 8 | 8 | ||
| 9 | import Profile from "@pages/Profile"; | 9 | import Profile from "@pages/Profile/Profile.tsx"; |
| 10 | import Games from "@pages/Games"; | 10 | import Games from "@pages/Games/Games.tsx"; |
| 11 | import Maps from "@pages/Maps"; | 11 | import Maps from "@pages/Maps/Maps.tsx"; |
| 12 | import User from "@pages/User"; | 12 | import User from "@pages/User/User.tsx"; |
| 13 | import Homepage from "@pages/Homepage"; | 13 | import Homepage from "@pages/Home/Homepage.tsx"; |
| 14 | import UploadRunDialog from "./components/UploadRunDialog"; | 14 | import UploadRunDialog from "./components/UploadRunDialog"; |
| 15 | import Rules from "@pages/Rules"; | 15 | import Rules from "@pages/Rules/Rules.tsx"; |
| 16 | import About from "@pages/About"; | 16 | import About from "@pages/About/About.tsx"; |
| 17 | import { Game } from "@customTypes/Game"; | 17 | import { Game } from "@customTypes/Game"; |
| 18 | import { API } from "./api/Api"; | 18 | import { API } from "./api/Api"; |
| 19 | import Maplist from "@pages/Maplist"; | 19 | import Maplist from "@pages/Maplist/Maplist.tsx"; |
| 20 | import Rankings from "@pages/Rankings"; | 20 | import Rankings from "@pages/Rankings/Rankings.tsx"; |
| 21 | import { get_user_id_from_token, get_user_mod_from_token } from "./utils/Jwt"; | 21 | import { get_user_id_from_token, get_user_mod_from_token } from "./utils/Jwt"; |
| 22 | 22 | ||
| 23 | const App: React.FC = () => { | 23 | const App: React.FC = () => { |
| @@ -76,6 +76,7 @@ const App: React.FC = () => { | |||
| 76 | <title>LPHUB</title> | 76 | <title>LPHUB</title> |
| 77 | <meta name="description" content="Least Portals Hub" /> | 77 | <meta name="description" content="Least Portals Hub" /> |
| 78 | </Helmet> | 78 | </Helmet> |
| 79 | |||
| 79 | <UploadRunDialog | 80 | <UploadRunDialog |
| 80 | token={token} | 81 | token={token} |
| 81 | open={uploadRunDialog} | 82 | open={uploadRunDialog} |
| @@ -87,40 +88,61 @@ const App: React.FC = () => { | |||
| 87 | }} | 88 | }} |
| 88 | games={games} | 89 | games={games} |
| 89 | /> | 90 | /> |
| 90 | <Sidebar | 91 | |
| 91 | setToken={setToken} | 92 | <div className="flex flex-row not-md:flex-col h-[100vh]"> |
| 92 | profile={profile} | 93 | |
| 93 | setProfile={setProfile} | 94 | <Sidebar |
| 94 | onUploadRun={() => setUploadRunDialog(true)} | 95 | setToken={setToken} |
| 95 | /> | 96 | profile={profile} |
| 96 | <Routes> | 97 | setProfile={setProfile} |
| 97 | <Route path="/" element={<Homepage />} /> | 98 | onUploadRun={() => setUploadRunDialog(true)} |
| 98 | <Route | ||
| 99 | path="/profile" | ||
| 100 | element={ | ||
| 101 | <Profile | ||
| 102 | profile={profile} | ||
| 103 | token={token} | ||
| 104 | gameData={games} | ||
| 105 | onDeleteRecord={() => _set_profile(get_user_id_from_token(token))} | ||
| 106 | /> | ||
| 107 | } | ||
| 108 | /> | ||
| 109 | <Route | ||
| 110 | path="/users/*" | ||
| 111 | element={<User profile={profile} token={token} gameData={games} />} | ||
| 112 | /> | ||
| 113 | <Route path="/games" element={<Games games={games} />} /> | ||
| 114 | <Route path="/games/:id" element={<Maplist />}></Route> | ||
| 115 | <Route | ||
| 116 | path="/maps/*" | ||
| 117 | element={<Maps token={token} isModerator={isModerator} />} | ||
| 118 | /> | 99 | /> |
| 119 | <Route path="/rules" element={<Rules />} /> | 100 | |
| 120 | <Route path="/about" element={<About />} /> | 101 | <main className="w-full"> |
| 121 | <Route path="/rankings" element={<Rankings />}></Route> | 102 | |
| 122 | <Route path="*" element={"404"} /> | 103 | <Routes> |
| 123 | </Routes> | 104 | <Route path="/" element={<Homepage />} /> |
| 105 | |||
| 106 | <Route | ||
| 107 | path="/profile" | ||
| 108 | element={ | ||
| 109 | <Profile | ||
| 110 | profile={profile} | ||
| 111 | token={token} | ||
| 112 | gameData={games} | ||
| 113 | onDeleteRecord={() => _set_profile(get_user_id_from_token(token))} | ||
| 114 | /> | ||
| 115 | } | ||
| 116 | /> | ||
| 117 | |||
| 118 | <Route | ||
| 119 | path="/users/*" | ||
| 120 | element={<User profile={profile} token={token} gameData={games} />} | ||
| 121 | /> | ||
| 122 | |||
| 123 | <Route path="/games" element={<Games games={games} />} /> | ||
| 124 | |||
| 125 | <Route path="/games/:id" element={<Maplist />}></Route> | ||
| 126 | |||
| 127 | <Route | ||
| 128 | path="/maps/*" | ||
| 129 | element={<Maps token={token} isModerator={isModerator} />} | ||
| 130 | /> | ||
| 131 | |||
| 132 | <Route path="/rules" element={<Rules />} /> | ||
| 133 | |||
| 134 | <Route path="/about" element={<About />} /> | ||
| 135 | |||
| 136 | <Route path="/rankings" element={<Rankings />}></Route> | ||
| 137 | |||
| 138 | <Route path="*" element={"404"} /> | ||
| 139 | |||
| 140 | </Routes> | ||
| 141 | |||
| 142 | </main> | ||
| 143 | |||
| 144 | |||
| 145 | </div> | ||
| 124 | </> | 146 | </> |
| 125 | ); | 147 | ); |
| 126 | }; | 148 | }; |