diff options
| author | nsfisis <nsfisis@gmail.com> | 2024-08-19 04:40:08 +0900 |
|---|---|---|
| committer | nsfisis <nsfisis@gmail.com> | 2024-08-19 04:40:08 +0900 |
| commit | 6031c81f5394acf315b277302a7fd18ea288b506 (patch) | |
| tree | 30377a3435445f48ce5de342d240990994cf2e71 /frontend/app/components/GolfPlayApps/GolfPlayAppGaming.tsx | |
| parent | f662c0832f1f7f45a4e1a926f3ec5a1d21e80fa7 (diff) | |
| download | phperkaigi-2025-albatross-6031c81f5394acf315b277302a7fd18ea288b506.tar.gz phperkaigi-2025-albatross-6031c81f5394acf315b277302a7fd18ea288b506.tar.zst phperkaigi-2025-albatross-6031c81f5394acf315b277302a7fd18ea288b506.zip | |
refactor(frontend): extract UserIcon component
Diffstat (limited to 'frontend/app/components/GolfPlayApps/GolfPlayAppGaming.tsx')
| -rw-r--r-- | frontend/app/components/GolfPlayApps/GolfPlayAppGaming.tsx | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/frontend/app/components/GolfPlayApps/GolfPlayAppGaming.tsx b/frontend/app/components/GolfPlayApps/GolfPlayAppGaming.tsx index e9139ba..e6cb7e9 100644 --- a/frontend/app/components/GolfPlayApps/GolfPlayAppGaming.tsx +++ b/frontend/app/components/GolfPlayApps/GolfPlayAppGaming.tsx @@ -4,6 +4,7 @@ import SubmitButton from "../../components/SubmitButton"; import type { PlayerInfo } from "../../models/PlayerInfo"; import BorderedContainer from "../BorderedContainer"; import SubmitResult from "../Gaming/SubmitResult"; +import UserIcon from "../UserIcon"; type Props = { gameDisplayName: string; @@ -60,14 +61,10 @@ export default function GolfPlayAppGaming({ <div className="text-2xl">{playerInfo.displayName}</div> </div> {playerInfo.iconPath && ( - <img - src={ - process.env.NODE_ENV === "development" - ? `http://localhost:8002/iosdc-japan/2024/code-battle${playerInfo.iconPath}` - : `/iosdc-japan/2024/code-battle${playerInfo.iconPath}` - } - alt={`${playerInfo.displayName} のアイコン`} - className="w-12 h-12 rounded-full my-auto border-4 border-white" + <UserIcon + iconPath={playerInfo.iconPath} + displayName={playerInfo.displayName!} + className="w-12 h-12 my-auto" /> )} </div> |
