aboutsummaryrefslogtreecommitdiff
path: root/frontend/src/pages
diff options
context:
space:
mode:
Diffstat (limited to 'frontend/src/pages')
-rw-r--r--frontend/src/pages/Games.tsx26
-rw-r--r--frontend/src/pages/Maplist.tsx6
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';
3import GameEntry from '@components/GameEntry'; 3import GameEntry from '@components/GameEntry';
4import { Game } from '@customTypes/Game'; 4import { Game } from '@customTypes/Game';
5import "@css/Maps.css" 5import "@css/Maps.css"
6import gamesCSS from "@css/Games.module.css";
6 7
7interface GamesProps { 8interface GamesProps {
8 games: Game[]; 9 games: Game[];
9} 10}
10 11
11const Games: React.FC<GamesProps> = ({ games }) => { 12const 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">