From 6031c81f5394acf315b277302a7fd18ea288b506 Mon Sep 17 00:00:00 2001
From: nsfisis <nsfisis@gmail.com>
Date: Mon, 19 Aug 2024 04:40:08 +0900
Subject: refactor(frontend): extract UserIcon component

---
 frontend/app/components/GolfPlayApps/GolfPlayAppGaming.tsx | 13 +++++--------
 1 file changed, 5 insertions(+), 8 deletions(-)

(limited to 'frontend/app/components/GolfPlayApps/GolfPlayAppGaming.tsx')

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>
-- 
cgit v1.3.1

