From d19aebd898af77dbc65fabfc4fe905f72769ccc7 Mon Sep 17 00:00:00 2001 From: Wolfboy248 Date: Wed, 11 Dec 2024 09:41:13 +0100 Subject: fix/frontend: games page css rehaul, small maplist fixes --- frontend/src/pages/Games.tsx | 26 +++++--------------------- frontend/src/pages/Maplist.tsx | 6 ++++-- 2 files changed, 9 insertions(+), 23 deletions(-) (limited to 'frontend/src/pages') 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'; import GameEntry from '@components/GameEntry'; import { Game } from '@customTypes/Game'; import "@css/Maps.css" +import gamesCSS from "@css/Games.module.css"; interface GamesProps { games: Game[]; } const Games: React.FC = ({ games }) => { - - const _page_load = () => { - const loaders = document.querySelectorAll(".loader"); - loaders.forEach((loader) => { - (loader as HTMLElement).style.display = "none"; - }); - } - - React.useEffect(() => { - document.querySelectorAll(".games-page-item-body").forEach((game, index) => { - game.innerHTML = ""; - }); - _page_load(); - }, []); - return (
-
-
- {games.map((game, index) => ( - - ))} -
+
+ {games.map((game, index) => ( + + ))}
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 = () => { )?.portal_count } -

portals

+

{game?.category_portals.find( + (obj) => obj.category.id === catNum + 1)!.portal_count == 1 ? "portal" : "portals" + }

{game?.category_portals.map((cat, index) => ( @@ -162,7 +164,7 @@ const Maplist: React.FC = () => { {map.is_disabled ? map.category_portals[0].portal_count : map.category_portals.find( (obj) => obj.category.id === catNum + 1 )?.portal_count} - portals + {map.category_portals.find((obj) => obj.category.id === catNum + 1)?.portal_count == 1 ? "portal" : "portals"}
-- cgit v1.2.3