From 0ccfe16a670d7efae8d01dc756b2d33477215204 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20F=C3=B6rtsch?= Date: Mon, 2 Mar 2026 21:57:52 +0100 Subject: [PATCH] full-height discover layout, info button on cards, game state dot Co-Authored-By: Claude Opus 4.6 --- .../discover/components/card-stack.tsx | 2 +- .../components/game-discover-card.tsx | 27 ++++++++++++++++--- src/routes/__root.tsx | 2 +- src/routes/discover/index.tsx | 24 ++++++++--------- 4 files changed, 37 insertions(+), 18 deletions(-) diff --git a/src/features/discover/components/card-stack.tsx b/src/features/discover/components/card-stack.tsx index 7e0da0d..058167c 100644 --- a/src/features/discover/components/card-stack.tsx +++ b/src/features/discover/components/card-stack.tsx @@ -31,7 +31,7 @@ export function CardStack({ games, onSwipeLeft, onSwipeRight }: CardStackProps) const visibleCards = games.slice(0, 3) return ( -
+
{visibleCards.map((game, i) => { const isTop = i === 0 const scale = 1 - i * 0.05 diff --git a/src/features/discover/components/game-discover-card.tsx b/src/features/discover/components/game-discover-card.tsx index a6e48ad..efd9e2f 100644 --- a/src/features/discover/components/game-discover-card.tsx +++ b/src/features/discover/components/game-discover-card.tsx @@ -1,6 +1,8 @@ -import { formatPlaytime } from "@/features/games/schema" +import { formatPlaytime, gameStateColors } from "@/features/games/schema" import { Badge } from "@/shared/components/ui/badge" import type { Game } from "@/shared/db/schema" +import { useNavigate } from "@tanstack/react-router" +import { Info } from "lucide-react" interface GameDiscoverCardProps { game: Game @@ -11,17 +13,34 @@ function getSteamHeaderImage(sourceId: string): string { } export function GameDiscoverCard({ game }: GameDiscoverCardProps) { + const navigate = useNavigate() const imageUrl = game.source === "steam" ? getSteamHeaderImage(game.source_id) : null + const dotColor = game.game_state !== "not_set" ? gameStateColors[game.game_state] : null return ( -
- {imageUrl && {game.title}} -
+
+ {imageUrl && ( + {game.title} + )} +

{game.title}

{game.source} + {dotColor && ( + + )} +
{game.playtime_hours > 0 && (

diff --git a/src/routes/__root.tsx b/src/routes/__root.tsx index ff4f44b..673882f 100644 --- a/src/routes/__root.tsx +++ b/src/routes/__root.tsx @@ -18,7 +18,7 @@ function RootLayout() { const navigate = useNavigate() return ( -

+
diff --git a/src/routes/discover/index.tsx b/src/routes/discover/index.tsx index dcc3597..d22acbd 100644 --- a/src/routes/discover/index.tsx +++ b/src/routes/discover/index.tsx @@ -15,27 +15,27 @@ function DiscoverPage() { useDiscover() return ( -
-

{t("discover.title")}

- +
-
- {isDone ? ( - - ) : unseenGames.length === 0 ? ( -

{t("discover.empty")}

- ) : ( -
+ {isDone ? ( + + ) : unseenGames.length === 0 ? ( +

{t("discover.empty")}

+ ) : ( + <> +
+
+
- )} -
+ + )}
) }