From a75f9fa78897de7317fe336e68db7a255899ae33 Mon Sep 17 00:00:00 2001 From: nsfisis Date: Fri, 21 Mar 2025 12:22:32 +0900 Subject: feat(frontend): do not transit to finished page --- .../app/components/GolfPlayApps/GolfPlayAppGaming.tsx | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) (limited to 'frontend/app/components/GolfPlayApps/GolfPlayAppGaming.tsx') diff --git a/frontend/app/components/GolfPlayApps/GolfPlayAppGaming.tsx b/frontend/app/components/GolfPlayApps/GolfPlayAppGaming.tsx index b40f3c3..86b2379 100644 --- a/frontend/app/components/GolfPlayApps/GolfPlayAppGaming.tsx +++ b/frontend/app/components/GolfPlayApps/GolfPlayAppGaming.tsx @@ -26,6 +26,7 @@ type Props = { initialCode: string; onCodeChange: (code: string) => void; onCodeSubmit: (code: string) => void; + isFinished: boolean; }; export default function GolfPlayAppGaming({ @@ -37,6 +38,7 @@ export default function GolfPlayAppGaming({ initialCode, onCodeChange, onCodeSubmit, + isFinished, }: Props) { const leftTimeSeconds = useAtomValue(gamingLeftTimeSecondsAtom)!; const score = useAtomValue(scoreAtom); @@ -47,11 +49,13 @@ export default function GolfPlayAppGaming({ const handleTextChange = (e: React.ChangeEvent) => { setCodeSize(calcCodeSize(e.target.value)); - onCodeChange(e.target.value); + if (!isFinished) { + onCodeChange(e.target.value); + } }; const handleSubmitButtonClick = () => { - if (textareaRef.current) { + if (textareaRef.current && !isFinished) { onCodeSubmit(textareaRef.current.value); } }; @@ -61,7 +65,11 @@ export default function GolfPlayAppGaming({
{gameDisplayName}
- + {isFinished ? ( +
終了
+ ) : ( + + )}
@@ -91,7 +99,10 @@ export default function GolfPlayAppGaming({
コードサイズ: {codeSize}
- + 提出
-- cgit v1.2.3-70-g09d2