From 89560a61bc6e41d86acaea596762eda2da38fe50 Mon Sep 17 00:00:00 2001 From: Arda Serdar Pektezol <1669855+pektezol@users.noreply.github.com> Date: Mon, 9 Sep 2024 19:29:42 +0300 Subject: refactor: upload run form, lots of random shit --- frontend/src/pages/Games.tsx | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) (limited to 'frontend/src/pages/Games.tsx') diff --git a/frontend/src/pages/Games.tsx b/frontend/src/pages/Games.tsx index eb7177f..ea136c2 100644 --- a/frontend/src/pages/Games.tsx +++ b/frontend/src/pages/Games.tsx @@ -2,16 +2,13 @@ import React from 'react'; import GameEntry from '../components/GameEntry'; import { Game } from '../types/Game'; -import { API } from '../api/Api'; import "../css/Maps.css" -const Games: React.FC = () => { - const [games, setGames] = React.useState([]); +interface GamesProps { + games: Game[]; +} - const _fetch_games = async () => { - const games = await API.get_games(); - setGames(games); - }; +const Games: React.FC = ({ games }) => { const _page_load = () => { const loaders = document.querySelectorAll(".loader"); @@ -21,7 +18,9 @@ const Games: React.FC = () => { } React.useEffect(() => { - _fetch_games(); + document.querySelectorAll(".games-page-item-body").forEach((game, index) => { + game.innerHTML = ""; + }); _page_load(); }, []); -- cgit v1.2.3