From 4b28b1eb8ee6177a8009b89ac2200b3b753bc5b1 Mon Sep 17 00:00:00 2001 From: nsfisis Date: Fri, 21 Mar 2025 10:55:10 +0900 Subject: feat(frontend): support mobile layout --- frontend/app/components/Gaming/LeftTime.tsx | 2 +- frontend/app/components/GolfPlayApp.tsx | 2 +- .../components/GolfPlayApps/GolfPlayAppGaming.tsx | 7 +++-- .../GolfWatchApps/GolfWatchAppGaming1v1.tsx | 34 ++++++++++++++-------- frontend/app/components/ThreeColumnLayout.tsx | 2 +- frontend/app/components/TitledColumn.tsx | 5 ++-- frontend/app/components/TwoColumnLayout.tsx | 2 +- 7 files changed, 34 insertions(+), 20 deletions(-) (limited to 'frontend/app') diff --git a/frontend/app/components/Gaming/LeftTime.tsx b/frontend/app/components/Gaming/LeftTime.tsx index a31c6b2..5013c76 100644 --- a/frontend/app/components/Gaming/LeftTime.tsx +++ b/frontend/app/components/Gaming/LeftTime.tsx @@ -22,5 +22,5 @@ export default function LeftTime({ sec }: Props) { leftTime = `${m.toString().padStart(2, "0")}:${s.toString().padStart(2, "0")}`; } - return
{leftTime}
; + return
{leftTime}
; } diff --git a/frontend/app/components/GolfPlayApp.tsx b/frontend/app/components/GolfPlayApp.tsx index 71b40ce..25b81af 100644 --- a/frontend/app/components/GolfPlayApp.tsx +++ b/frontend/app/components/GolfPlayApp.tsx @@ -55,8 +55,8 @@ export default function GolfPlayApp({ game, player, initialGameState }: Props) { }; const onCodeChange = useDebouncedCallback(async (code: string) => { - console.log("player:c2s:code"); if (game.game_type === "1v1") { + console.log("player:c2s:code"); await apiClient.postGamePlayCode(game.game_id, code); } }, 1000); diff --git a/frontend/app/components/GolfPlayApps/GolfPlayAppGaming.tsx b/frontend/app/components/GolfPlayApps/GolfPlayAppGaming.tsx index b9b3159..b40f3c3 100644 --- a/frontend/app/components/GolfPlayApps/GolfPlayAppGaming.tsx +++ b/frontend/app/components/GolfPlayApps/GolfPlayAppGaming.tsx @@ -65,8 +65,10 @@ export default function GolfPlayAppGaming({
-
{score}
-
{playerProfile.displayName}
+
{score}
+
+ {playerProfile.displayName} +
{playerProfile.iconPath && ( diff --git a/frontend/app/components/GolfWatchApps/GolfWatchAppGaming1v1.tsx b/frontend/app/components/GolfWatchApps/GolfWatchAppGaming1v1.tsx index ce12dca..a17b301 100644 --- a/frontend/app/components/GolfWatchApps/GolfWatchAppGaming1v1.tsx +++ b/frontend/app/components/GolfWatchApps/GolfWatchAppGaming1v1.tsx @@ -66,18 +66,20 @@ export default function GolfWatchAppGaming1v1({ return (
-
+
- {playerProfileA?.iconPath && ( + {playerProfileB?.iconPath && ( )} -
{playerProfileA?.displayName}
+
+ {playerProfileB?.displayName} +
-
{scoreA}
+
{scoreB}
{gameDisplayName}
@@ -93,10 +95,12 @@ export default function GolfWatchAppGaming1v1({ )}
-
-
{scoreB}
+
+
{scoreB}
-
{playerProfileB?.displayName}
+
+ {playerProfileB?.displayName} +
{playerProfileB?.iconPath && ( - }> + } + className="order-2 md:order-1" + > - + - }> + } + className="order-3" + > diff --git a/frontend/app/components/ThreeColumnLayout.tsx b/frontend/app/components/ThreeColumnLayout.tsx index 42533b7..d2a5ba5 100644 --- a/frontend/app/components/ThreeColumnLayout.tsx +++ b/frontend/app/components/ThreeColumnLayout.tsx @@ -6,7 +6,7 @@ type Props = { export default function ThreeColumnLayout({ children }: Props) { return ( -
+
{children}
); diff --git a/frontend/app/components/TitledColumn.tsx b/frontend/app/components/TitledColumn.tsx index 4272ad4..a26271b 100644 --- a/frontend/app/components/TitledColumn.tsx +++ b/frontend/app/components/TitledColumn.tsx @@ -3,11 +3,12 @@ import React from "react"; type Props = { children: React.ReactNode; title: React.ReactNode; + className?: string; }; -export default function TitledColumn({ children, title }: Props) { +export default function TitledColumn({ children, title, className }: Props) { return ( -
+
{title}
{children}
diff --git a/frontend/app/components/TwoColumnLayout.tsx b/frontend/app/components/TwoColumnLayout.tsx index 980bf4d..68eab32 100644 --- a/frontend/app/components/TwoColumnLayout.tsx +++ b/frontend/app/components/TwoColumnLayout.tsx @@ -6,7 +6,7 @@ type Props = { export default function TwoColumnLayout({ children }: Props) { return ( -
+
{children}
); -- cgit v1.2.3-70-g09d2