Improve run creation workflow with filters, local box art, and sticky nav

Use local /boxart/{slug}.png images instead of database boxArtUrl with
color-swatch fallback. Add region filter pills and run-status checkboxes
(hide active/completed) to GameGrid. Move the Next button into a sticky
top bar showing selected game summary so it's always visible. Capitalize
region names in all display locations.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-02-07 21:29:14 +01:00
parent 4c0b45984f
commit 7dbf3772df
7 changed files with 199 additions and 46 deletions

View File

@@ -1,3 +1,4 @@
import { useState } from 'react'
import type { Game } from '../types'
const DEFAULT_COLOR = '#6366f1' // indigo-500
@@ -10,6 +11,8 @@ interface GameCardProps {
export function GameCard({ game, selected, onSelect }: GameCardProps) {
const backgroundColor = game.color ?? DEFAULT_COLOR
const [imgError, setImgError] = useState(false)
const boxArtSrc = `/boxart/${game.slug}.png`
return (
<button
@@ -19,11 +22,12 @@ export function GameCard({ game, selected, onSelect }: GameCardProps) {
selected ? 'ring-2 ring-blue-500 scale-105 shadow-lg' : 'shadow'
}`}
>
{game.boxArtUrl ? (
{!imgError ? (
<img
src={game.boxArtUrl}
src={boxArtSrc}
alt={game.name}
className="w-full h-48 object-cover"
onError={() => setImgError(true)}
/>
) : (
<div
@@ -41,7 +45,7 @@ export function GameCard({ game, selected, onSelect }: GameCardProps) {
</h3>
<div className="flex items-center gap-2 mt-1">
<span className="text-xs px-2 py-0.5 rounded-full bg-gray-100 dark:bg-gray-700 text-gray-600 dark:text-gray-400">
{game.region}
{game.region.charAt(0).toUpperCase() + game.region.slice(1)}
</span>
{game.releaseYear && (
<span className="text-xs text-gray-500 dark:text-gray-400">