diff --git a/apps/web/src/components/multiplayer/MultiplayerScoreScreen.tsx b/apps/web/src/components/multiplayer/MultiplayerScoreScreen.tsx deleted file mode 100644 index 5e95588..0000000 --- a/apps/web/src/components/multiplayer/MultiplayerScoreScreen.tsx +++ /dev/null @@ -1,114 +0,0 @@ -import { useNavigate } from "@tanstack/react-router"; -import type { LobbyPlayer } from "@lila/shared"; - -type MultiplayerScoreScreenProps = { - players: LobbyPlayer[]; - winnerIds: string[]; - currentUserId: string; - lobbyCode: string; -}; - -export const MultiplayerScoreScreen = ({ - players, - winnerIds, - currentUserId, - lobbyCode, -}: MultiplayerScoreScreenProps) => { - const navigate = useNavigate(); - - const sortedPlayers = [...players].sort((a, b) => b.score - a.score); - - const isWinner = winnerIds.includes(currentUserId); - const isTie = winnerIds.length > 1; - - const winnerNames = winnerIds - .map((id) => players.find((p) => p.userId === id)?.user.name ?? id) - .join(" and "); - - return ( -
-
- {/* Result header */} -
-

- {isTie ? "It's a tie!" : isWinner ? "You win! 🎉" : "Game over"} -

-

- {isTie ? `${winnerNames} tied` : `${winnerNames} wins!`} -

-
- -
- - {/* Score list */} -
- {sortedPlayers.map((player, index) => { - const isCurrentUser = player.userId === currentUserId; - const isPlayerWinner = winnerIds.includes(player.userId); - return ( -
-
- - {index + 1}. - - - {player.user.name} - {isCurrentUser && ( - - (you) - - )} - - {isPlayerWinner && ( - - 👑 - - )} -
- - {player.score} pts - -
- ); - })} -
- -
- - {/* Actions */} -
- - -
-
-
- ); -}; diff --git a/apps/web/src/routes/__root.tsx b/apps/web/src/routes/__root.tsx index 0add685..e7fe4b0 100644 --- a/apps/web/src/routes/__root.tsx +++ b/apps/web/src/routes/__root.tsx @@ -17,24 +17,20 @@ const RootLayout = () => { Home - - Play - - - Multiplayer + + About
{session ? ( -

Click to copy

-
- -
- - {/* Player list */} -
-

- Players ({lobby.players.length}) -

-
    - {lobby.players.map((player) => ( -
  • - - {player.user.name} - {player.userId === lobby.hostUserId && ( - - host - - )} -
  • - ))} -
-
- - {/* Error */} - {error &&

{error}

} - - {/* Start button — host only */} - {isHost && ( - - )} - - {/* Non-host waiting message */} - {!isHost && ( -

- Waiting for host to start the game... -

- )} -
-
- ); +function RouteComponent() { + return
Hello "/multiplayer/lobby/$code"!
} diff --git a/packages/shared/src/schemas/lobby.ts b/packages/shared/src/schemas/lobby.ts index c9687c4..7b7b7d5 100644 --- a/packages/shared/src/schemas/lobby.ts +++ b/packages/shared/src/schemas/lobby.ts @@ -27,9 +27,6 @@ export const JoinLobbyResponseSchema = LobbySchema; export type JoinLobbyResponse = z.infer; -export const GameRouteSearchSchema = z.object({ lobbyId: z.uuid() }); -export type GameRouteSearch = z.infer; - // ---------------------------------------------------------------------------- // WebSocket: Client → Server // ----------------------------------------------------------------------------