From cca0f63e50684d6806697589b620ee4b4c1b21b5 Mon Sep 17 00:00:00 2001 From: nsfisis Date: Thu, 20 Mar 2025 22:18:14 +0900 Subject: feat(frontend): improve watch page layout --- .../GolfWatchApps/GolfWatchAppGaming1v1.tsx | 48 ++++++++++++++-------- .../GolfWatchAppGamingMultiplayer.tsx | 12 +++--- 2 files changed, 37 insertions(+), 23 deletions(-) (limited to 'frontend/app/components/GolfWatchApps') diff --git a/frontend/app/components/GolfWatchApps/GolfWatchAppGaming1v1.tsx b/frontend/app/components/GolfWatchApps/GolfWatchAppGaming1v1.tsx index f72397d..4a7fe8a 100644 --- a/frontend/app/components/GolfWatchApps/GolfWatchAppGaming1v1.tsx +++ b/frontend/app/components/GolfWatchApps/GolfWatchAppGaming1v1.tsx @@ -2,15 +2,18 @@ import { useAtomValue } from "jotai"; import { gamingLeftTimeSecondsAtom, latestGameStatesAtom, + calcCodeSize, } from "../../states/watch"; import type { PlayerProfile } from "../../types/PlayerProfile"; +import BorderedContainer from "../BorderedContainer"; +import SubmitStatusLabel from "../SubmitStatusLabel"; +import ThreeColumnLayout from "../ThreeColumnLayout"; +import TitledColumn from "../TitledColumn"; +import UserIcon from "../UserIcon"; import CodeBlock from "../Gaming/CodeBlock"; import LeftTime from "../Gaming/LeftTime"; -import Problem from "../Gaming/Problem"; +import ProblemColumn from "../Gaming/ProblemColumn"; import ScoreBar from "../Gaming/ScoreBar"; -import SubmitResult from "../Gaming/SubmitResult"; -import ThreeColumnLayout from "../ThreeColumnLayout"; -import UserIcon from "../UserIcon"; type Props = { gameDisplayName: string; @@ -43,6 +46,9 @@ export default function GolfWatchAppGaming1v1({ const scoreB = stateB?.score ?? null; const statusB = stateB?.status ?? "none"; + const codeSizeA = calcCodeSize(codeA); + const codeSizeB = calcCodeSize(codeB); + const topBg = gameResult ? gameResult === "winA" ? "bg-orange-400" @@ -102,19 +108,27 @@ export default function GolfWatchAppGaming1v1({ bgB="bg-purple-400" /> - -
-
- - -
- -
- + }> + +
+ コードサイズ: {codeSizeA} +
+ +
+
+ + }> + +
+ コードサイズ: {codeSizeB} +
+ +
+
); diff --git a/frontend/app/components/GolfWatchApps/GolfWatchAppGamingMultiplayer.tsx b/frontend/app/components/GolfWatchApps/GolfWatchAppGamingMultiplayer.tsx index 06a2376..a6b9464 100644 --- a/frontend/app/components/GolfWatchApps/GolfWatchAppGamingMultiplayer.tsx +++ b/frontend/app/components/GolfWatchApps/GolfWatchAppGamingMultiplayer.tsx @@ -2,8 +2,9 @@ import { useAtomValue } from "jotai"; import type { components } from "../../api/schema"; import { gamingLeftTimeSecondsAtom } from "../../states/watch"; import LeftTime from "../Gaming/LeftTime"; -import Problem from "../Gaming/Problem"; +import ProblemColumn from "../Gaming/ProblemColumn"; import RankingTable from "../Gaming/RankingTable"; +import TitledColumn from "../TitledColumn"; import TwoColumnLayout from "../TwoColumnLayout"; type RankingEntry = components["schemas"]["RankingEntry"]; @@ -27,7 +28,7 @@ export default function GolfWatchAppGamingMultiplayer({ return (
-
+
{gameDisplayName}
@@ -36,15 +37,14 @@ export default function GolfWatchAppGamingMultiplayer({
- -
-
順位表
+ -
+
); -- cgit v1.2.3-70-g09d2