summaryrefslogtreecommitdiffhomepage
path: root/react-frontend/src/pages/Game.tsx
diff options
context:
space:
mode:
authorrealtradam <[email protected]>2024-06-29 18:30:20 -0400
committerrealtradam <[email protected]>2024-06-29 18:30:20 -0400
commit2a8545f11267de06447b3c56d8beca8d27596dab (patch)
treee9e4aaf0ed2436d3ca31114c739194dd351e8d09 /react-frontend/src/pages/Game.tsx
parent95088f3fdd3f593d486b55e3840cee0dbc1a5051 (diff)
downloadgameHolster-2a8545f11267de06447b3c56d8beca8d27596dab.tar.gz
gameHolster-2a8545f11267de06447b3c56d8beca8d27596dab.zip
work on rendering gamesdev
Diffstat (limited to 'react-frontend/src/pages/Game.tsx')
-rw-r--r--react-frontend/src/pages/Game.tsx25
1 files changed, 25 insertions, 0 deletions
diff --git a/react-frontend/src/pages/Game.tsx b/react-frontend/src/pages/Game.tsx
new file mode 100644
index 0000000..464176a
--- /dev/null
+++ b/react-frontend/src/pages/Game.tsx
@@ -0,0 +1,25 @@
+import { useState, useEffect } from "react";
+import { useParams } from "react-router-dom";
+import { GameType } from "../components/GameCard";
+
+export default function Games () {
+ const { path_game, path_user } = useParams();
+ const [gameData, setGameData] = useState<GameType>();
+
+ useEffect(() => {
+ const url = `${import.meta.env.VITE_API_TITLE}/api/v1/games/${path_user}/${path_game}`;
+ fetch(url).then((response) => {
+ if (response.ok) {
+ return response.json();
+ }
+ throw new Error("Network response was not ok.");
+ }).then((response) => setGameData(response)); //.catch(() => navigate("/"));
+ }, [path_game, path_user]);
+
+ return(
+ <>
+ <h1>blah</h1>
+ </>
+ );
+
+}