From 8c7d882dfa67bcef37a4f39be6f1ca57f160b816 Mon Sep 17 00:00:00 2001
From: nsfisis <nsfisis@gmail.com>
Date: Mon, 12 Aug 2024 00:32:06 +0900
Subject: feat(frontend): improve play page styling

---
 frontend/app/routes/golf.$gameId.play.tsx | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

(limited to 'frontend/app/routes/golf.$gameId.play.tsx')

diff --git a/frontend/app/routes/golf.$gameId.play.tsx b/frontend/app/routes/golf.$gameId.play.tsx
index 3712df2..ea1b8fd 100644
--- a/frontend/app/routes/golf.$gameId.play.tsx
+++ b/frontend/app/routes/golf.$gameId.play.tsx
@@ -15,7 +15,7 @@ export const meta: MetaFunction<typeof loader> = ({ data }) => [
 ];
 
 export async function loader({ params, request }: LoaderFunctionArgs) {
-	const { token } = await ensureUserLoggedIn(request);
+	const { token, user } = await ensureUserLoggedIn(request);
 
 	const fetchGame = async () => {
 		return (await apiGetGame(token, Number(params.gameId))).game;
@@ -27,16 +27,17 @@ export async function loader({ params, request }: LoaderFunctionArgs) {
 	const [game, sockToken] = await Promise.all([fetchGame(), fetchSockToken()]);
 	return {
 		game,
+		player: user,
 		sockToken,
 	};
 }
 
 export default function GolfPlay() {
-	const { game, sockToken } = useLoaderData<typeof loader>();
+	const { game, player, sockToken } = useLoaderData<typeof loader>();
 
 	return (
 		<ClientOnly fallback={<GolfPlayAppConnecting />}>
-			{() => <GolfPlayApp game={game} sockToken={sockToken} />}
+			{() => <GolfPlayApp game={game} player={player} sockToken={sockToken} />}
 		</ClientOnly>
 	);
 }
-- 
cgit v1.2.3-70-g09d2

