diff --git a/src/features/discovery/Shelves.tsx b/src/features/discovery/Shelves.tsx index b832554..c495179 100644 --- a/src/features/discovery/Shelves.tsx +++ b/src/features/discovery/Shelves.tsx @@ -8,10 +8,10 @@ const ROWS: { key: keyof ShelvesData; title: string; note?: string }[] = [ { key: "featured", title: "Featured" }, { key: "staff", title: "Staff picks" }, { key: "new", title: "New this week", note: "Every new game shows here first" }, - { key: "most_played", title: "Most played", note: "Players who stay, not just players who click" }, - { key: "most_improved", title: "Most improved", note: "Growing the fastest" }, ]; +const PER_SHELF = 5; // one row of the same cards as the games grid + /** The homepage shelves (PRD A1): a row of games per shelf, from /discover/shelves. A shelf with no games isn't shown. */ export default function Shelves({ games, user }: PagePartProps) { const [shelves, setShelves] = useState(null); @@ -22,7 +22,7 @@ export default function Shelves({ games, user }: PagePartProps) { }, [user?.id]); if (!shelves || !games) return null; const bySlug = new Map(games.map((g) => [g.slug, g])); - const rows = ROWS.map((r) => ({ ...r, games: shelves[r.key].map((n) => bySlug.get(n)).filter((g): g is Game => !!g) })).filter((r) => r.games.length > 0); + const rows = ROWS.map((r) => ({ ...r, games: shelves[r.key].map((n) => bySlug.get(n)).filter((g): g is Game => !!g).slice(0, PER_SHELF) })).filter((r) => r.games.length > 0); if (rows.length === 0) return null; return (
@@ -31,13 +31,15 @@ export default function Shelves({ games, user }: PagePartProps) {

{r.title} {r.note && {r.note}}