diff options
| author | FifthWit <fifthwitbusiness@gmail.com> | 2025-01-30 10:44:30 -0600 |
|---|---|---|
| committer | FifthWit <fifthwitbusiness@gmail.com> | 2025-01-30 10:44:30 -0600 |
| commit | e40f07211f5f15dcb138e2520a76d13afd3c0cfd (patch) | |
| tree | 46bad6a17e66d55a4a65088c0b6eb8c48641615a /frontend/src/pages/Games.tsx | |
| parent | added prettier for more consistency (diff) | |
| download | lphub-e40f07211f5f15dcb138e2520a76d13afd3c0cfd.tar.gz lphub-e40f07211f5f15dcb138e2520a76d13afd3c0cfd.tar.bz2 lphub-e40f07211f5f15dcb138e2520a76d13afd3c0cfd.zip | |
formatted with prettier
Diffstat (limited to 'frontend/src/pages/Games.tsx')
| -rw-r--r-- | frontend/src/pages/Games.tsx | 61 |
1 files changed, 31 insertions, 30 deletions
diff --git a/frontend/src/pages/Games.tsx b/frontend/src/pages/Games.tsx index 15cc891..ae0a2d6 100644 --- a/frontend/src/pages/Games.tsx +++ b/frontend/src/pages/Games.tsx | |||
| @@ -3,44 +3,45 @@ 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 | const _page_load = () => { | ||
| 14 | const loaders = document.querySelectorAll('.loader'); | ||
| 15 | loaders.forEach(loader => { | ||
| 16 | (loader as HTMLElement).style.display = 'none'; | ||
| 17 | }); | ||
| 18 | }; | ||
| 13 | 19 | ||
| 14 | const _page_load = () => { | 20 | React.useEffect(() => { |
| 15 | const loaders = document.querySelectorAll(".loader"); | 21 | document |
| 16 | loaders.forEach((loader) => { | 22 | .querySelectorAll('.games-page-item-body') |
| 17 | (loader as HTMLElement).style.display = "none"; | 23 | .forEach((game, index) => { |
| 18 | }); | 24 | game.innerHTML = ''; |
| 19 | } | 25 | }); |
| 26 | _page_load(); | ||
| 27 | }, []); | ||
| 20 | 28 | ||
| 21 | React.useEffect(() => { | 29 | return ( |
| 22 | document.querySelectorAll(".games-page-item-body").forEach((game, index) => { | 30 | <div className="games-page"> |
| 23 | game.innerHTML = ""; | 31 | <Helmet> |
| 24 | }); | 32 | <title>LPHUB | Games</title> |
| 25 | _page_load(); | 33 | </Helmet> |
| 26 | }, []); | 34 | <section> |
| 27 | 35 | <div className="games-page-content"> | |
| 28 | return ( | 36 | <div className="games-page-item-content"> |
| 29 | <div className='games-page'> | 37 | {games.map((game, index) => ( |
| 30 | <Helmet> | 38 | <GameEntry game={game} key={index} /> |
| 31 | <title>LPHUB | Games</title> | 39 | ))} |
| 32 | </Helmet> | 40 | </div> |
| 33 | <section> | ||
| 34 | <div className='games-page-content'> | ||
| 35 | <div className='games-page-item-content'> | ||
| 36 | {games.map((game, index) => ( | ||
| 37 | <GameEntry game={game} key={index} /> | ||
| 38 | ))} | ||
| 39 | </div> | ||
| 40 | </div> | ||
| 41 | </section> | ||
| 42 | </div> | 41 | </div> |
| 43 | ); | 42 | </section> |
| 43 | </div> | ||
| 44 | ); | ||
| 44 | }; | 45 | }; |
| 45 | 46 | ||
| 46 | export default Games; | 47 | export default Games; |