From 4123224b999c151ae6f1c6dce9c59f49e5e48ce9 Mon Sep 17 00:00:00 2001 From: speak-mentaiko <1717miyawaki@gmail.com> Date: Fri, 11 Oct 2024 23:08:48 +0900 Subject: [PATCH] =?UTF-8?q?fix:=20=E5=9E=8B=E3=82=92=E5=90=88=E3=82=8F?= =?UTF-8?q?=E3=81=9B=E3=81=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/kcmsf/src/pages/result.tsx | 30 +++++++++++++++++++---------- 1 file changed, 20 insertions(+), 10 deletions(-) diff --git a/packages/kcmsf/src/pages/result.tsx b/packages/kcmsf/src/pages/result.tsx index 845e4b43..000d9156 100644 --- a/packages/kcmsf/src/pages/result.tsx +++ b/packages/kcmsf/src/pages/result.tsx @@ -217,22 +217,32 @@ const PreResultColum = (props: { match: PreMatch }) => { ), [props.match] ); + const leftGoalTimeSeconds = useMemo(() => { + if (!leftResult) { + return ""; + } else { + if (leftResult.goalTimeSeconds) + return parseSeconds(leftResult.goalTimeSeconds); + return "フィニッシュ"; + } + }, [leftResult]); + const rightGoalTimeSeconds = useMemo(() => { + if (!rightResult) { + return ""; + } else { + if (rightResult.goalTimeSeconds) + return parseSeconds(rightResult.goalTimeSeconds); + return "フィニッシュ"; + } + }, [leftResult]); return ( <> {props.match.leftTeam?.teamName} {leftResult?.points} - - {leftResult?.finishState === "goal" - ? (parseSeconds(leftResult.goalTimeSeconds) ?? "") - : "フィニッシュ"} - + {leftGoalTimeSeconds} {props.match.rightTeam?.teamName} {rightResult?.points} - - {rightResult?.finishState === "goal" - ? (parseSeconds(rightResult.goalTimeSeconds) ?? "") - : "フィニッシュ"} - + {rightGoalTimeSeconds} ); };