From 5d527dfc8e198dc4cdb61d9972535fbdb94b239c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20F=C3=B6rtsch?= Date: Thu, 12 Mar 2026 11:18:05 +0100 Subject: [PATCH] add game UI to host view Co-Authored-By: Claude Opus 4.6 --- packages/client/src/routes/host.$roomCode.tsx | 40 ++++++++++++++++++- 1 file changed, 38 insertions(+), 2 deletions(-) diff --git a/packages/client/src/routes/host.$roomCode.tsx b/packages/client/src/routes/host.$roomCode.tsx index 461e5ef..398703c 100644 --- a/packages/client/src/routes/host.$roomCode.tsx +++ b/packages/client/src/routes/host.$roomCode.tsx @@ -2,6 +2,10 @@ import { createFileRoute } from "@tanstack/react-router" import { useWebSocket } from "@/hooks/use-websocket" import { useRoomStore } from "@/stores/room-store" import { PlayerList } from "@/components/player-list" +import { PredictionsForm } from "@/components/predictions-form" +import { DishList } from "@/components/dish-list" +import { DishHost } from "@/components/dish-host" +import { DishResults } from "@/components/dish-results" import { RoomHeader } from "@/components/room-header" import { Button } from "@/components/ui/button" import { Tabs, TabsContent, TabsList, TabsTrigger } from "@/components/ui/tabs" @@ -22,7 +26,7 @@ const nextActLabels: Partial> = { function HostView() { const { roomCode } = Route.useParams() const { send } = useWebSocket(roomCode) - const { room, mySessionId, connectionStatus } = useRoomStore() + const { room, mySessionId, connectionStatus, gameState } = useRoomStore() if (!room) { return ( @@ -47,8 +51,30 @@ function HostView() { + {gameState && (room.currentAct === "lobby" || room.currentAct === "act1") && ( +
+ + send({ type: "submit_prediction", ...prediction }) + } + /> + + send({ type: "submit_dish_guess", dishId, guessedCountry }) + } + /> +
+ )} + {gameState?.dishResults && ( + + )} - {/* Game UI will be added in later plans */}
@@ -78,6 +104,16 @@ function HostView() { )} + {gameState && (room.currentAct === "lobby" || room.currentAct === "act1") && ( + + send({ type: "add_dish", name, correctCountry }) + } + onReveal={() => send({ type: "reveal_dishes" })} + /> + )}