aboutsummaryrefslogtreecommitdiffhomepage
path: root/frontend/app/components/GolfPlayApp.client.tsx
diff options
context:
space:
mode:
authornsfisis <nsfisis@gmail.com>2024-08-12 00:32:06 +0900
committernsfisis <nsfisis@gmail.com>2024-08-12 01:02:41 +0900
commit8c7d882dfa67bcef37a4f39be6f1ca57f160b816 (patch)
treeeaed36391b59615594646be8dfd2d304a0fe2918 /frontend/app/components/GolfPlayApp.client.tsx
parent7527e54bba0c528015ce402bfa4534c1ab6ca1da (diff)
downloadiosdc-japan-2024-albatross-8c7d882dfa67bcef37a4f39be6f1ca57f160b816.tar.gz
iosdc-japan-2024-albatross-8c7d882dfa67bcef37a4f39be6f1ca57f160b816.tar.zst
iosdc-japan-2024-albatross-8c7d882dfa67bcef37a4f39be6f1ca57f160b816.zip
feat(frontend): improve play page styling
Diffstat (limited to 'frontend/app/components/GolfPlayApp.client.tsx')
-rw-r--r--frontend/app/components/GolfPlayApp.client.tsx8
1 files changed, 8 insertions, 0 deletions
diff --git a/frontend/app/components/GolfPlayApp.client.tsx b/frontend/app/components/GolfPlayApp.client.tsx
index 4aebd52..ef3a229 100644
--- a/frontend/app/components/GolfPlayApp.client.tsx
+++ b/frontend/app/components/GolfPlayApp.client.tsx
@@ -12,14 +12,17 @@ type GamePlayerMessageS2C = components["schemas"]["GamePlayerMessageS2C"];
type GamePlayerMessageC2S = components["schemas"]["GamePlayerMessageC2S"];
type Game = components["schemas"]["Game"];
+type User = components["schemas"]["User"];
type GameState = "connecting" | "waiting" | "starting" | "gaming" | "finished";
export default function GolfPlayApp({
game,
+ player,
sockToken,
}: {
game: Game;
+ player: User;
sockToken: string;
}) {
const socketUrl =
@@ -83,6 +86,9 @@ export default function GolfPlayApp({
}, 1000);
const onCodeSubmit = useDebouncedCallback((code: string) => {
+ if (code === "") {
+ return;
+ }
console.log("player:c2s:submit");
sendJsonMessage({
type: "player:c2s:submit",
@@ -171,6 +177,8 @@ export default function GolfPlayApp({
} else if (gameState === "gaming") {
return (
<GolfPlayAppGaming
+ gameDisplayName={game.display_name}
+ playerDisplayName={player.display_name}
problemTitle={game.problem.title}
problemDescription={game.problem.description}
onCodeChange={onCodeChange}