diff --git a/frontend/src/components/GameCard/GameCard.tsx b/frontend/src/components/GameCard/GameCard.tsx index 5c8c3ee..ac4c524 100644 --- a/frontend/src/components/GameCard/GameCard.tsx +++ b/frontend/src/components/GameCard/GameCard.tsx @@ -18,6 +18,13 @@ export function GameCard({ game, isFavorite, onToggleFavorite, view = 'list' }: const maxGenres = view === 'grid' ? 1 : view === 'list' ? 2 : undefined; const meta = [year, game.genres.slice(0, maxGenres).join(', ')].filter(Boolean).join(' · '); + // albert: + // fix: bildestørrelse + // Leona, gjerne se over at det funker som det skal og evt. endre hvis du er uenig + const imgSuffix = game.backgroundImage?.split("/media/")[1]; + const imgSize = view==='list'? "200" : view==='grid'? "420": "640"; + const imgURL = `https://media.rawg.io/media/resize/${imgSize}/-/${imgSuffix}`; + return (
{game.backgroundImage ? ( @@ -25,7 +32,7 @@ export function GameCard({ game, isFavorite, onToggleFavorite, view = 'list' }: // loading hindrer at layouten hopper og sparer data ved lange lister. + `https://media.rawg.io/media/resize/420/-/${src?.split("/media/")[1]}` + ); return (