From 7d387bf868e2470e8010b5f8d1563da56b5a8b3d Mon Sep 17 00:00:00 2001 From: nsfisis Date: Thu, 20 Mar 2025 20:58:39 +0900 Subject: refactor(frontend): TwoColumnLayout/ThreeColumnLayout --- frontend/app/components/GolfPlayApps/GolfPlayAppGaming.tsx | 7 ++++--- .../app/components/GolfWatchApps/GolfWatchAppGaming1v1.tsx | 5 +++-- .../GolfWatchApps/GolfWatchAppGamingMultiplayer.tsx | 5 +++-- frontend/app/components/ThreeColumnLayout.tsx | 13 +++++++++++++ frontend/app/components/TwoColumnLayout.tsx | 13 +++++++++++++ 5 files changed, 36 insertions(+), 7 deletions(-) create mode 100644 frontend/app/components/ThreeColumnLayout.tsx create mode 100644 frontend/app/components/TwoColumnLayout.tsx (limited to 'frontend') diff --git a/frontend/app/components/GolfPlayApps/GolfPlayAppGaming.tsx b/frontend/app/components/GolfPlayApps/GolfPlayAppGaming.tsx index 69da5d9..b1b6f80 100644 --- a/frontend/app/components/GolfPlayApps/GolfPlayAppGaming.tsx +++ b/frontend/app/components/GolfPlayApps/GolfPlayAppGaming.tsx @@ -1,7 +1,6 @@ import { useAtomValue } from "jotai"; import React, { useRef, useState } from "react"; import { Link } from "react-router"; -import SubmitButton from "../../components/SubmitButton"; import { gamingLeftTimeSecondsAtom, scoreAtom, @@ -11,7 +10,9 @@ import type { PlayerProfile } from "../../types/PlayerProfile"; import BorderedContainer from "../BorderedContainer"; import LeftTime from "../Gaming/LeftTime"; import Problem from "../Gaming/Problem"; +import SubmitButton from "../SubmitButton"; import SubmitStatusLabel from "../SubmitStatusLabel"; +import ThreeColumnLayout from "../ThreeColumnLayout"; import UserIcon from "../UserIcon"; function calcCodeSize(code: string): number { @@ -87,7 +88,7 @@ export default function GolfPlayAppGaming({ -
+
- + ); } diff --git a/frontend/app/components/GolfWatchApps/GolfWatchAppGaming1v1.tsx b/frontend/app/components/GolfWatchApps/GolfWatchAppGaming1v1.tsx index 8e2b565..081212e 100644 --- a/frontend/app/components/GolfWatchApps/GolfWatchAppGaming1v1.tsx +++ b/frontend/app/components/GolfWatchApps/GolfWatchAppGaming1v1.tsx @@ -9,6 +9,7 @@ import LeftTime from "../Gaming/LeftTime"; import Problem from "../Gaming/Problem"; import ScoreBar from "../Gaming/ScoreBar"; import SubmitResult from "../Gaming/SubmitResult"; +import ThreeColumnLayout from "../ThreeColumnLayout"; import UserIcon from "../UserIcon"; type Props = { @@ -106,7 +107,7 @@ export default function GolfWatchAppGaming1v1({ bgA="bg-orange-400" bgB="bg-purple-400" /> -
+
@@ -120,7 +121,7 @@ export default function GolfWatchAppGaming1v1({ />
-
+
); } diff --git a/frontend/app/components/GolfWatchApps/GolfWatchAppGamingMultiplayer.tsx b/frontend/app/components/GolfWatchApps/GolfWatchAppGamingMultiplayer.tsx index f3a377b..06a2376 100644 --- a/frontend/app/components/GolfWatchApps/GolfWatchAppGamingMultiplayer.tsx +++ b/frontend/app/components/GolfWatchApps/GolfWatchAppGamingMultiplayer.tsx @@ -4,6 +4,7 @@ import { gamingLeftTimeSecondsAtom } from "../../states/watch"; import LeftTime from "../Gaming/LeftTime"; import Problem from "../Gaming/Problem"; import RankingTable from "../Gaming/RankingTable"; +import TwoColumnLayout from "../TwoColumnLayout"; type RankingEntry = components["schemas"]["RankingEntry"]; @@ -34,7 +35,7 @@ export default function GolfWatchAppGamingMultiplayer({
-
+ 順位表
- + ); } diff --git a/frontend/app/components/ThreeColumnLayout.tsx b/frontend/app/components/ThreeColumnLayout.tsx new file mode 100644 index 0000000..42533b7 --- /dev/null +++ b/frontend/app/components/ThreeColumnLayout.tsx @@ -0,0 +1,13 @@ +import React from "react"; + +type Props = { + children: React.ReactNode; +}; + +export default function ThreeColumnLayout({ children }: Props) { + return ( +
+ {children} +
+ ); +} diff --git a/frontend/app/components/TwoColumnLayout.tsx b/frontend/app/components/TwoColumnLayout.tsx new file mode 100644 index 0000000..980bf4d --- /dev/null +++ b/frontend/app/components/TwoColumnLayout.tsx @@ -0,0 +1,13 @@ +import React from "react"; + +type Props = { + children: React.ReactNode; +}; + +export default function TwoColumnLayout({ children }: Props) { + return ( +
+ {children} +
+ ); +} -- cgit v1.2.3-70-g09d2