diff options
| author | Wolfboy248 <georgejvindkarlsen@gmail.com> | 2024-12-11 09:41:13 +0100 |
|---|---|---|
| committer | Wolfboy248 <georgejvindkarlsen@gmail.com> | 2024-12-11 09:41:13 +0100 |
| commit | d19aebd898af77dbc65fabfc4fe905f72769ccc7 (patch) | |
| tree | 28121000fd821b01d8662f238ea2d0a6e10ec1b5 /frontend/src/pages | |
| parent | fix/frontent: fix category parameter not working (diff) | |
| download | lphub-d19aebd898af77dbc65fabfc4fe905f72769ccc7.tar.gz lphub-d19aebd898af77dbc65fabfc4fe905f72769ccc7.tar.bz2 lphub-d19aebd898af77dbc65fabfc4fe905f72769ccc7.zip | |
fix/frontend: games page css rehaul, small maplist fixes
Diffstat (limited to 'frontend/src/pages')
| -rw-r--r-- | frontend/src/pages/Games.tsx | 26 | ||||
| -rw-r--r-- | frontend/src/pages/Maplist.tsx | 6 |
2 files changed, 9 insertions, 23 deletions
diff --git a/frontend/src/pages/Games.tsx b/frontend/src/pages/Games.tsx index e7e031e..45dd170 100644 --- a/frontend/src/pages/Games.tsx +++ b/frontend/src/pages/Games.tsx | |||
| @@ -3,36 +3,20 @@ import React from 'react'; | |||
| 3 | import GameEntry from '@components/GameEntry'; | 3 | import GameEntry from '@components/GameEntry'; |
| 4 | import { Game } from '@customTypes/Game'; | 4 | import { Game } from '@customTypes/Game'; |
| 5 | import "@css/Maps.css" | 5 | import "@css/Maps.css" |
| 6 | import gamesCSS from "@css/Games.module.css"; | ||
| 6 | 7 | ||
| 7 | interface GamesProps { | 8 | interface GamesProps { |
| 8 | games: Game[]; | 9 | games: Game[]; |
| 9 | } | 10 | } |
| 10 | 11 | ||
| 11 | const Games: React.FC<GamesProps> = ({ games }) => { | 12 | const Games: React.FC<GamesProps> = ({ games }) => { |
| 12 | |||
| 13 | const _page_load = () => { | ||
| 14 | const loaders = document.querySelectorAll(".loader"); | ||
| 15 | loaders.forEach((loader) => { | ||
| 16 | (loader as HTMLElement).style.display = "none"; | ||
| 17 | }); | ||
| 18 | } | ||
| 19 | |||
| 20 | React.useEffect(() => { | ||
| 21 | document.querySelectorAll(".games-page-item-body").forEach((game, index) => { | ||
| 22 | game.innerHTML = ""; | ||
| 23 | }); | ||
| 24 | _page_load(); | ||
| 25 | }, []); | ||
| 26 | |||
| 27 | return ( | 13 | return ( |
| 28 | <main> | 14 | <main> |
| 29 | <section> | 15 | <section> |
| 30 | <div className='games-page-content'> | 16 | <div className={gamesCSS.content}> |
| 31 | <div className='games-page-item-content'> | 17 | {games.map((game, index) => ( |
| 32 | {games.map((game, index) => ( | 18 | <GameEntry game={game} key={index} /> |
| 33 | <GameEntry game={game} key={index} /> | 19 | ))} |
| 34 | ))} | ||
| 35 | </div> | ||
| 36 | </div> | 20 | </div> |
| 37 | </section> | 21 | </section> |
| 38 | </main> | 22 | </main> |
diff --git a/frontend/src/pages/Maplist.tsx b/frontend/src/pages/Maplist.tsx index 7b4ce06..ecea3e1 100644 --- a/frontend/src/pages/Maplist.tsx +++ b/frontend/src/pages/Maplist.tsx | |||
| @@ -123,7 +123,9 @@ const Maplist: React.FC = () => { | |||
| 123 | )?.portal_count | 123 | )?.portal_count |
| 124 | } | 124 | } |
| 125 | </h2> | 125 | </h2> |
| 126 | <h3>portals</h3> | 126 | <h3>{game?.category_portals.find( |
| 127 | (obj) => obj.category.id === catNum + 1)!.portal_count == 1 ? "portal" : "portals" | ||
| 128 | }</h3> | ||
| 127 | </div> | 129 | </div> |
| 128 | <div className="game-header-categories"> | 130 | <div className="game-header-categories"> |
| 129 | {game?.category_portals.map((cat, index) => ( | 131 | {game?.category_portals.map((cat, index) => ( |
| @@ -162,7 +164,7 @@ const Maplist: React.FC = () => { | |||
| 162 | <span>{map.is_disabled ? map.category_portals[0].portal_count : map.category_portals.find( | 164 | <span>{map.is_disabled ? map.category_portals[0].portal_count : map.category_portals.find( |
| 163 | (obj) => obj.category.id === catNum + 1 | 165 | (obj) => obj.category.id === catNum + 1 |
| 164 | )?.portal_count}</span> | 166 | )?.portal_count}</span> |
| 165 | <span>portals</span> | 167 | <span>{map.category_portals.find((obj) => obj.category.id === catNum + 1)?.portal_count == 1 ? "portal" : "portals"}</span> |
| 166 | </div> | 168 | </div> |
| 167 | </div> | 169 | </div> |
| 168 | <div className="difficulty-bar"> | 170 | <div className="difficulty-bar"> |