From defcb0e0bcf0beef69c7f94f683878a666140326 Mon Sep 17 00:00:00 2001 From: code002lover Date: Thu, 4 Dec 2025 19:13:17 +0100 Subject: [PATCH] feat: display game thumbnails using GameImage component across game and person detail lists. --- frontend/src/GameFilter.tsx | 4 +-- frontend/src/GameImage.tsx | 56 ++++++++++++++++++---------------- frontend/src/GameList.tsx | 15 +++------ frontend/src/PersonDetails.tsx | 44 ++++++++++++++++++-------- 4 files changed, 68 insertions(+), 51 deletions(-) diff --git a/frontend/src/GameFilter.tsx b/frontend/src/GameFilter.tsx index 83252a3..c4f97c8 100644 --- a/frontend/src/GameFilter.tsx +++ b/frontend/src/GameFilter.tsx @@ -142,9 +142,7 @@ export function GameFilter() { ✓ All {selectedPeople.size} selected would play -
- -
+ ))} diff --git a/frontend/src/GameImage.tsx b/frontend/src/GameImage.tsx index d53e96b..affbd9b 100644 --- a/frontend/src/GameImage.tsx +++ b/frontend/src/GameImage.tsx @@ -9,36 +9,40 @@ export function GameImage({ game }: GameImageProps) { if (error) { return ( -
- No Image Available +
+
+ No Image Available +
); } return ( - {`${game} setError(true)} - style={{ - width: "100%", - height: "auto", - borderRadius: "8px", - marginTop: "0.5rem", - objectFit: "cover", - }} - /> +
+ {`${game} setError(true)} + style={{ + width: "100%", + height: "auto", + borderRadius: "8px", + marginTop: "0.5rem", + objectFit: "cover", + }} + /> +
); } diff --git a/frontend/src/GameList.tsx b/frontend/src/GameList.tsx index 95e56aa..f4aba16 100644 --- a/frontend/src/GameList.tsx +++ b/frontend/src/GameList.tsx @@ -2,6 +2,7 @@ import { useState, useEffect } from "react"; import { Game, Source, GameList as GameListProto } from "../items"; import { Link } from "react-router-dom"; import { apiFetch } from "./api"; +import { GameImage } from "./GameImage"; export function GameList() { const [games, setGames] = useState([]); @@ -439,19 +440,13 @@ export function GameList() { style={{ textDecoration: "none", color: "inherit", - display: "block", + display: "flex", + justifyContent: "space-between", + alignItems: "center", }} > {game.title} -
- {game.source === Source.STEAM ? "Steam" : "Roblox"} -
+ ))} diff --git a/frontend/src/PersonDetails.tsx b/frontend/src/PersonDetails.tsx index e022669..ce67ffc 100644 --- a/frontend/src/PersonDetails.tsx +++ b/frontend/src/PersonDetails.tsx @@ -1,5 +1,5 @@ import { useState, useEffect } from "react"; -import { useParams } from "react-router-dom"; +import { Link, useParams } from "react-router-dom"; import { Person, AddOpinionRequest, @@ -9,6 +9,7 @@ import { AuthStatusResponse, } from "../items"; import { apiFetch } from "./api"; +import { GameImage } from "./GameImage"; export const PersonDetails = () => { const { name } = useParams<{ name: string }>(); @@ -116,21 +117,23 @@ export const PersonDetails = () => {

{person.name}

    {person.opinion.map((op, i) => ( -
  • {op.title} -
    - {op.wouldPlay ? "Would Play" : "Would Not Play"} -
    -
  • + + + ))}
@@ -192,6 +195,23 @@ export const PersonDetails = () => { Add +
+ + {gameTitle} + + +
)}