aboutsummaryrefslogtreecommitdiffhomepage
path: root/frontend/app/components/GolfWatchApps/GolfWatchAppGaming1v1.tsx
diff options
context:
space:
mode:
authornsfisis <nsfisis@gmail.com>2025-03-15 23:23:16 +0900
committernsfisis <nsfisis@gmail.com>2025-03-15 23:23:16 +0900
commit17c1fbe0f8565f191a191138bebac7409512962e (patch)
tree848eb22810ce3298ef40d7a196bfd461e41e802f /frontend/app/components/GolfWatchApps/GolfWatchAppGaming1v1.tsx
parent172b6d3211d040e8d577afda80debce583c3bf7c (diff)
downloadiosdc-japan-2025-albatross-17c1fbe0f8565f191a191138bebac7409512962e.tar.gz
iosdc-japan-2025-albatross-17c1fbe0f8565f191a191138bebac7409512962e.tar.zst
iosdc-japan-2025-albatross-17c1fbe0f8565f191a191138bebac7409512962e.zip
feat(frontend): improve left time display
Diffstat (limited to 'frontend/app/components/GolfWatchApps/GolfWatchAppGaming1v1.tsx')
-rw-r--r--frontend/app/components/GolfWatchApps/GolfWatchAppGaming1v1.tsx21
1 files changed, 9 insertions, 12 deletions
diff --git a/frontend/app/components/GolfWatchApps/GolfWatchAppGaming1v1.tsx b/frontend/app/components/GolfWatchApps/GolfWatchAppGaming1v1.tsx
index d9ee800..8e2b565 100644
--- a/frontend/app/components/GolfWatchApps/GolfWatchAppGaming1v1.tsx
+++ b/frontend/app/components/GolfWatchApps/GolfWatchAppGaming1v1.tsx
@@ -5,6 +5,7 @@ import {
} from "../../states/watch";
import type { PlayerProfile } from "../../types/PlayerProfile";
import CodeBlock from "../Gaming/CodeBlock";
+import LeftTime from "../Gaming/LeftTime";
import Problem from "../Gaming/Problem";
import ScoreBar from "../Gaming/ScoreBar";
import SubmitResult from "../Gaming/SubmitResult";
@@ -41,12 +42,6 @@ export default function GolfWatchAppGaming1v1({
const scoreB = stateB?.score ?? null;
const statusB = stateB?.status ?? "none";
- const leftTime = (() => {
- const m = Math.floor(leftTimeSeconds / 60);
- const s = leftTimeSeconds % 60;
- return `${m.toString().padStart(2, "0")}:${s.toString().padStart(2, "0")}`;
- })();
-
const topBg = gameResult
? gameResult === "winA"
? "bg-orange-400"
@@ -76,15 +71,17 @@ export default function GolfWatchAppGaming1v1({
</div>
<div className="font-bold text-center">
<div className="text-gray-100">{gameDisplayName}</div>
- <div className="text-3xl">
- {gameResult
- ? gameResult === "winA"
+ {gameResult ? (
+ <div className="text-3xl">
+ {gameResult === "winA"
? `勝者 ${playerProfileA.displayName}`
: gameResult === "winB"
? `勝者 ${playerProfileB.displayName}`
- : "引き分け"
- : leftTime}
- </div>
+ : "引き分け"}
+ </div>
+ ) : (
+ <LeftTime sec={leftTimeSeconds} />
+ )}
</div>
<div className="font-bold flex justify-between my-auto">
<div className="text-6xl">{scoreB}</div>