diff options
| author | nsfisis <nsfisis@gmail.com> | 2024-08-22 00:46:06 +0900 |
|---|---|---|
| committer | nsfisis <nsfisis@gmail.com> | 2024-08-22 00:59:04 +0900 |
| commit | 922bc6a1f52d8f01600e9a61ce31963075ec59a5 (patch) | |
| tree | 9fdd2c8d3d01841ca7130504b8f9261116bc45e6 /frontend/app/components/GolfPlayApps | |
| parent | 43d40d375c355837de83501c3f1c122b2bf589bb (diff) | |
| download | iosdc-japan-2024-albatross-922bc6a1f52d8f01600e9a61ce31963075ec59a5.tar.gz iosdc-japan-2024-albatross-922bc6a1f52d8f01600e9a61ce31963075ec59a5.tar.zst iosdc-japan-2024-albatross-922bc6a1f52d8f01600e9a61ce31963075ec59a5.zip | |
refactor(frontend): organize PlayerInfo
Diffstat (limited to 'frontend/app/components/GolfPlayApps')
| -rw-r--r-- | frontend/app/components/GolfPlayApps/GolfPlayAppGaming.tsx | 16 | ||||
| -rw-r--r-- | frontend/app/components/GolfPlayApps/GolfPlayAppWaiting.tsx | 10 |
2 files changed, 13 insertions, 13 deletions
diff --git a/frontend/app/components/GolfPlayApps/GolfPlayAppGaming.tsx b/frontend/app/components/GolfPlayApps/GolfPlayAppGaming.tsx index e6cb7e9..38516bc 100644 --- a/frontend/app/components/GolfPlayApps/GolfPlayAppGaming.tsx +++ b/frontend/app/components/GolfPlayApps/GolfPlayAppGaming.tsx @@ -1,7 +1,7 @@ import { Link } from "@remix-run/react"; import React, { useRef } from "react"; import SubmitButton from "../../components/SubmitButton"; -import type { PlayerInfo } from "../../models/PlayerInfo"; +import type { PlayerInfo } from "../../types/PlayerInfo"; import BorderedContainer from "../BorderedContainer"; import SubmitResult from "../Gaming/SubmitResult"; import UserIcon from "../UserIcon"; @@ -10,7 +10,7 @@ type Props = { gameDisplayName: string; gameDurationSeconds: number; leftTimeSeconds: number; - playerInfo: Omit<PlayerInfo, "code">; + playerInfo: PlayerInfo; problemTitle: string; problemDescription: string; onCodeChange: (code: string) => void; @@ -55,15 +55,15 @@ export default function GolfPlayAppGaming({ </div> <Link to={"/dashboard"}> <div className="flex gap-4 my-auto font-bold"> - <div className="text-6xl">{playerInfo.score}</div> + <div className="text-6xl">{playerInfo.state.score}</div> <div className="text-end"> <div className="text-gray-100">Player 1</div> - <div className="text-2xl">{playerInfo.displayName}</div> + <div className="text-2xl">{playerInfo.profile.displayName}</div> </div> - {playerInfo.iconPath && ( + {playerInfo.profile.iconPath && ( <UserIcon - iconPath={playerInfo.iconPath} - displayName={playerInfo.displayName!} + iconPath={playerInfo.profile.iconPath} + displayName={playerInfo.profile.displayName} className="w-12 h-12 my-auto" /> )} @@ -88,7 +88,7 @@ export default function GolfPlayAppGaming({ </div> <div className="p-4"> <SubmitResult - result={playerInfo.submitResult} + result={playerInfo.state.submitResult} submitButton={ <SubmitButton onClick={handleSubmitButtonClick}> 提出 diff --git a/frontend/app/components/GolfPlayApps/GolfPlayAppWaiting.tsx b/frontend/app/components/GolfPlayApps/GolfPlayAppWaiting.tsx index a31e5f4..706dc8f 100644 --- a/frontend/app/components/GolfPlayApps/GolfPlayAppWaiting.tsx +++ b/frontend/app/components/GolfPlayApps/GolfPlayAppWaiting.tsx @@ -1,14 +1,14 @@ -import { PlayerInfo } from "../../models/PlayerInfo"; -import PlayerProfile from "../PlayerProfile"; +import type { PlayerProfile } from "../../types/PlayerProfile"; +import PlayerNameAndIcon from "../PlayerNameAndIcon"; type Props = { gameDisplayName: string; - playerInfo: Omit<PlayerInfo, "code">; + playerProfile: PlayerProfile; }; export default function GolfPlayAppWaiting({ gameDisplayName, - playerInfo, + playerProfile, }: Props) { return ( <div className="min-h-screen bg-gray-100 flex flex-col font-bold text-center"> @@ -16,7 +16,7 @@ export default function GolfPlayAppWaiting({ <div className="text-4xl">{gameDisplayName}</div> </div> <div className="grow grid mx-auto text-black"> - <PlayerProfile playerInfo={playerInfo} label="You" /> + <PlayerNameAndIcon label="You" profile={playerProfile} /> </div> </div> ); |
