From df57e43059a230062d903f55f9af7339828875c3 Mon Sep 17 00:00:00 2001 From: nsfisis Date: Sun, 28 Jul 2024 23:28:10 +0900 Subject: feat(frontend): partially implement gaming --- .../GolfPlayApps/GolfPlayAppConnecting.tsx | 3 +++ .../GolfPlayApps/GolfPlayAppFinished.tsx | 3 +++ .../components/GolfPlayApps/GolfPlayAppGaming.tsx | 30 ++++++++++++++++++++++ .../GolfPlayApps/GolfPlayAppStarting.tsx | 7 +++++ .../components/GolfPlayApps/GolfPlayAppWaiting.tsx | 3 +++ 5 files changed, 46 insertions(+) create mode 100644 frontend/app/components/GolfPlayApps/GolfPlayAppConnecting.tsx create mode 100644 frontend/app/components/GolfPlayApps/GolfPlayAppFinished.tsx create mode 100644 frontend/app/components/GolfPlayApps/GolfPlayAppGaming.tsx create mode 100644 frontend/app/components/GolfPlayApps/GolfPlayAppStarting.tsx create mode 100644 frontend/app/components/GolfPlayApps/GolfPlayAppWaiting.tsx (limited to 'frontend/app/components/GolfPlayApps') diff --git a/frontend/app/components/GolfPlayApps/GolfPlayAppConnecting.tsx b/frontend/app/components/GolfPlayApps/GolfPlayAppConnecting.tsx new file mode 100644 index 0000000..e92a8e0 --- /dev/null +++ b/frontend/app/components/GolfPlayApps/GolfPlayAppConnecting.tsx @@ -0,0 +1,3 @@ +export default function GolfPlayAppConnecting() { + return
Connecting...
; +} diff --git a/frontend/app/components/GolfPlayApps/GolfPlayAppFinished.tsx b/frontend/app/components/GolfPlayApps/GolfPlayAppFinished.tsx new file mode 100644 index 0000000..75ceb71 --- /dev/null +++ b/frontend/app/components/GolfPlayApps/GolfPlayAppFinished.tsx @@ -0,0 +1,3 @@ +export default function GolfPlayAppFinished() { + return
Finished
; +} diff --git a/frontend/app/components/GolfPlayApps/GolfPlayAppGaming.tsx b/frontend/app/components/GolfPlayApps/GolfPlayAppGaming.tsx new file mode 100644 index 0000000..332cb3c --- /dev/null +++ b/frontend/app/components/GolfPlayApps/GolfPlayAppGaming.tsx @@ -0,0 +1,30 @@ +export default function GolfPlayAppGaming({ + problem, + onCodeChange, + currentScore, +}: { + problem: string; + onCodeChange: (code: string) => void; + currentScore: number | null; +}) { + const handleTextChange = (e: React.ChangeEvent) => { + onCodeChange(e.target.value); + }; + + return ( +
+
+
{problem}
+
+ {currentScore == null ? "Score: -" : `Score: ${currentScore}`} +
+
+
+