aboutsummaryrefslogtreecommitdiff
path: root/frontend/src/pages
diff options
context:
space:
mode:
Diffstat (limited to 'frontend/src/pages')
-rw-r--r--frontend/src/pages/About.tsx4
-rw-r--r--frontend/src/pages/Games.tsx31
-rw-r--r--frontend/src/pages/Maplist.tsx14
-rw-r--r--frontend/src/pages/Profile.tsx2
4 files changed, 21 insertions, 30 deletions
diff --git a/frontend/src/pages/About.tsx b/frontend/src/pages/About.tsx
index a8b7826..b7bd534 100644
--- a/frontend/src/pages/About.tsx
+++ b/frontend/src/pages/About.tsx
@@ -28,12 +28,12 @@ const About: React.FC = () => {
28 28
29 29
30 return ( 30 return (
31 <div id="about"> 31 <main>
32 <Helmet> 32 <Helmet>
33 <title>LPHUB | About</title> 33 <title>LPHUB | About</title>
34 </Helmet> 34 </Helmet>
35 <ReactMarkdown>{aboutText}</ReactMarkdown> 35 <ReactMarkdown>{aboutText}</ReactMarkdown>
36 </div> 36 </main>
37 ); 37 );
38}; 38};
39 39
diff --git a/frontend/src/pages/Games.tsx b/frontend/src/pages/Games.tsx
index 15cc891..5e0d5bf 100644
--- a/frontend/src/pages/Games.tsx
+++ b/frontend/src/pages/Games.tsx
@@ -3,43 +3,26 @@ import { Helmet } from 'react-helmet';
3 3
4import GameEntry from '@components/GameEntry'; 4import GameEntry from '@components/GameEntry';
5import { Game } from '@customTypes/Game'; 5import { Game } from '@customTypes/Game';
6import "@css/Maps.css" 6import gamesCSS from "@css/Games.module.css";
7 7
8interface GamesProps { 8interface GamesProps {
9 games: Game[]; 9 games: Game[];
10} 10}
11 11
12const Games: React.FC<GamesProps> = ({ games }) => { 12const Games: React.FC<GamesProps> = ({ games }) => {
13
14 const _page_load = () => {
15 const loaders = document.querySelectorAll(".loader");
16 loaders.forEach((loader) => {
17 (loader as HTMLElement).style.display = "none";
18 });
19 }
20
21 React.useEffect(() => {
22 document.querySelectorAll(".games-page-item-body").forEach((game, index) => {
23 game.innerHTML = "";
24 });
25 _page_load();
26 }, []);
27
28 return ( 13 return (
29 <div className='games-page'> 14 <main>
30 <Helmet> 15 <Helmet>
31 <title>LPHUB | Games</title> 16 <title>LPHUB | Games</title>
32 </Helmet> 17 </Helmet>
33 <section> 18 <section>
34 <div className='games-page-content'> 19 <div className={gamesCSS.content}>
35 <div className='games-page-item-content'> 20 {games.map((game, index) => (
36 {games.map((game, index) => ( 21 <GameEntry game={game} key={index} />
37 <GameEntry game={game} key={index} /> 22 ))}
38 ))}
39 </div>
40 </div> 23 </div>
41 </section> 24 </section>
42 </div> 25 </main>
43 ); 26 );
44}; 27};
45 28
diff --git a/frontend/src/pages/Maplist.tsx b/frontend/src/pages/Maplist.tsx
index 76f9a52..b9e17f7 100644
--- a/frontend/src/pages/Maplist.tsx
+++ b/frontend/src/pages/Maplist.tsx
@@ -88,7 +88,13 @@ const Maplist: React.FC = () => {
88 } 88 }
89 }, [gameChapters]) 89 }, [gameChapters])
90 90
91 91 useEffect(() => {
92 const queryParams = new URLSearchParams(location.search);
93 const cat = queryParams.get("cat");
94 if (cat != null) {
95 setCatNum(parseFloat(cat) - 1);
96 }
97 }, [location])
92 98
93 return ( 99 return (
94 <main> 100 <main>
@@ -121,7 +127,9 @@ const Maplist: React.FC = () => {
121 )?.portal_count 127 )?.portal_count
122 } 128 }
123 </h2> 129 </h2>
124 <h3>portals</h3> 130 <h3>{game?.category_portals.find(
131 (obj) => obj.category.id === catNum + 1)!.portal_count == 1 ? "portal" : "portals"
132 }</h3>
125 </div> 133 </div>
126 <div className="game-header-categories"> 134 <div className="game-header-categories">
127 {game?.category_portals.map((cat, index) => ( 135 {game?.category_portals.map((cat, index) => (
@@ -160,7 +168,7 @@ const Maplist: React.FC = () => {
160 <span>{map.is_disabled ? map.category_portals[0].portal_count : map.category_portals.find( 168 <span>{map.is_disabled ? map.category_portals[0].portal_count : map.category_portals.find(
161 (obj) => obj.category.id === catNum + 1 169 (obj) => obj.category.id === catNum + 1
162 )?.portal_count}</span> 170 )?.portal_count}</span>
163 <span>portals</span> 171 <span>{map.category_portals.find((obj) => obj.category.id === catNum + 1)?.portal_count == 1 ? "portal" : "portals"}</span>
164 </div> 172 </div>
165 </div> 173 </div>
166 <div className="difficulty-bar"> 174 <div className="difficulty-bar">
diff --git a/frontend/src/pages/Profile.tsx b/frontend/src/pages/Profile.tsx
index 48233bf..ee56999 100644
--- a/frontend/src/pages/Profile.tsx
+++ b/frontend/src/pages/Profile.tsx
@@ -109,7 +109,7 @@ const Profile: React.FC<ProfileProps> = ({ profile, token, gameData, onDeleteRec
109 }; 109 };
110 110
111 return ( 111 return (
112 <div> 112 <div style={{position: "absolute", width: "calc(100% - 50px)", left: "350px"}}>
113 <Helmet> 113 <Helmet>
114 <title>LPHUB | {profile.user_name}</title> 114 <title>LPHUB | {profile.user_name}</title>
115 <meta name="description" content={profile.user_name} /> 115 <meta name="description" content={profile.user_name} />