diff options
Diffstat (limited to 'frontend/src/pages/Games.tsx')
| -rw-r--r-- | frontend/src/pages/Games.tsx | 64 |
1 files changed, 32 insertions, 32 deletions
diff --git a/frontend/src/pages/Games.tsx b/frontend/src/pages/Games.tsx index 15cc891..909ea20 100644 --- a/frontend/src/pages/Games.tsx +++ b/frontend/src/pages/Games.tsx | |||
| @@ -1,46 +1,46 @@ | |||
| 1 | import React from 'react'; | 1 | import React from "react"; |
| 2 | import { Helmet } from 'react-helmet'; | 2 | import { Helmet } from "react-helmet"; |
| 3 | 3 | ||
| 4 | import GameEntry from '@components/GameEntry'; | 4 | import GameEntry from "@components/GameEntry"; |
| 5 | import { Game } from '@customTypes/Game'; | 5 | import { Game } from "@customTypes/Game"; |
| 6 | import "@css/Maps.css" | 6 | import "@css/Maps.css" |
| 7 | 7 | ||
| 8 | interface GamesProps { | 8 | interface GamesProps { |
| 9 | games: Game[]; | 9 | games: Game[]; |
| 10 | } | 10 | } |
| 11 | 11 | ||
| 12 | const Games: React.FC<GamesProps> = ({ games }) => { | 12 | const Games: React.FC<GamesProps> = ({ games }) => { |
| 13 | 13 | ||
| 14 | const _page_load = () => { | 14 | const _page_load = () => { |
| 15 | const loaders = document.querySelectorAll(".loader"); | 15 | const loaders = document.querySelectorAll(".loader"); |
| 16 | loaders.forEach((loader) => { | 16 | loaders.forEach((loader) => { |
| 17 | (loader as HTMLElement).style.display = "none"; | 17 | (loader as HTMLElement).style.display = "none"; |
| 18 | }); | 18 | }); |
| 19 | } | 19 | } |
| 20 | 20 | ||
| 21 | React.useEffect(() => { | 21 | React.useEffect(() => { |
| 22 | document.querySelectorAll(".games-page-item-body").forEach((game, index) => { | 22 | document.querySelectorAll(".games-page-item-body").forEach((game, index) => { |
| 23 | game.innerHTML = ""; | 23 | game.innerHTML = ""; |
| 24 | }); | 24 | }); |
| 25 | _page_load(); | 25 | _page_load(); |
| 26 | }, []); | 26 | }, []); |
| 27 | 27 | ||
| 28 | return ( | 28 | return ( |
| 29 | <div className='games-page'> | 29 | <div className='games-page'> |
| 30 | <Helmet> | 30 | <Helmet> |
| 31 | <title>LPHUB | Games</title> | 31 | <title>LPHUB | Games</title> |
| 32 | </Helmet> | 32 | </Helmet> |
| 33 | <section> | 33 | <section> |
| 34 | <div className='games-page-content'> | 34 | <div className='games-page-content'> |
| 35 | <div className='games-page-item-content'> | 35 | <div className='games-page-item-content'> |
| 36 | {games.map((game, index) => ( | 36 | {games.map((game, index) => ( |
| 37 | <GameEntry game={game} key={index} /> | 37 | <GameEntry game={game} key={index} /> |
| 38 | ))} | 38 | ))} |
| 39 | </div> | 39 | </div> |
| 40 | </div> | ||
| 41 | </section> | ||
| 42 | </div> | 40 | </div> |
| 43 | ); | 41 | </section> |
| 42 | </div> | ||
| 43 | ); | ||
| 44 | }; | 44 | }; |
| 45 | 45 | ||
| 46 | export default Games; | 46 | export default Games; |