From 922bc6a1f52d8f01600e9a61ce31963075ec59a5 Mon Sep 17 00:00:00 2001 From: nsfisis Date: Thu, 22 Aug 2024 00:46:06 +0900 Subject: refactor(frontend): organize PlayerInfo --- .../GolfWatchApps/GolfWatchAppGaming.tsx | 38 +++++++++++----------- .../GolfWatchApps/GolfWatchAppWaiting.tsx | 18 +++++----- 2 files changed, 27 insertions(+), 29 deletions(-) (limited to 'frontend/app/components/GolfWatchApps') diff --git a/frontend/app/components/GolfWatchApps/GolfWatchAppGaming.tsx b/frontend/app/components/GolfWatchApps/GolfWatchAppGaming.tsx index 28babff..a23a972 100644 --- a/frontend/app/components/GolfWatchApps/GolfWatchAppGaming.tsx +++ b/frontend/app/components/GolfWatchApps/GolfWatchAppGaming.tsx @@ -1,4 +1,4 @@ -import { PlayerInfo } from "../../models/PlayerInfo"; +import type { PlayerInfo } from "../../types/PlayerInfo"; import BorderedContainer from "../BorderedContainer"; import CodeBlock from "../Gaming/CodeBlock"; import ScoreBar from "../Gaming/ScoreBar"; @@ -49,43 +49,43 @@ export default function GolfWatchAppGaming({
- {playerInfoA.iconPath && ( + {playerInfoA.profile.iconPath && ( )}
Player 1
-
{playerInfoA.displayName}
+
{playerInfoA.profile.displayName}
-
{playerInfoA.score}
+
{playerInfoA.state.score}
{gameDisplayName}
{gameResult ? gameResult === "winA" - ? `勝者 ${playerInfoA.displayName}` + ? `勝者 ${playerInfoA.profile.displayName}` : gameResult === "winB" - ? `勝者 ${playerInfoB.displayName}` + ? `勝者 ${playerInfoB.profile.displayName}` : "引き分け" : leftTime}
-
{playerInfoB.score}
+
{playerInfoB.state.score}
Player 2
-
{playerInfoB.displayName}
+
{playerInfoB.profile.displayName}
- {playerInfoB.iconPath && ( + {playerInfoB.profile.iconPath && ( )} @@ -93,17 +93,17 @@ export default function GolfWatchAppGaming({
- +
- - + +
@@ -112,7 +112,7 @@ export default function GolfWatchAppGaming({ {problemDescription}
- +
); diff --git a/frontend/app/components/GolfWatchApps/GolfWatchAppWaiting.tsx b/frontend/app/components/GolfWatchApps/GolfWatchAppWaiting.tsx index faa9485..0e964e3 100644 --- a/frontend/app/components/GolfWatchApps/GolfWatchAppWaiting.tsx +++ b/frontend/app/components/GolfWatchApps/GolfWatchAppWaiting.tsx @@ -1,18 +1,16 @@ -import { PlayerInfo as FullPlayerInfo } from "../../models/PlayerInfo"; -import PlayerProfile from "../PlayerProfile"; - -type PlayerInfo = Pick; +import type { PlayerProfile } from "../../types/PlayerProfile"; +import PlayerNameAndIcon from "../PlayerNameAndIcon"; type Props = { gameDisplayName: string; - playerInfoA: PlayerInfo; - playerInfoB: PlayerInfo; + playerProfileA: PlayerProfile; + playerProfileB: PlayerProfile; }; export default function GolfWatchAppWaiting({ gameDisplayName, - playerInfoA, - playerInfoB, + playerProfileA, + playerProfileB, }: Props) { return (
@@ -20,9 +18,9 @@ export default function GolfWatchAppWaiting({
{gameDisplayName}
- +
vs.
- +
); -- cgit v1.2.3-70-g09d2