-
-
Notifications
You must be signed in to change notification settings - Fork 480
Fix Issue #2466 GamePage image is missing logo when available #3245
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,10 +6,17 @@ import fallbackImage from 'frontend/assets/heroic_card.jpg' | |
|
||
interface Props extends React.ImgHTMLAttributes<HTMLImageElement> { | ||
art_square: string | ||
logo?: string | undefined | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. do we need the |
||
store: string | ||
} | ||
|
||
function GamePicture({ art_square, store, className, ...props }: Props) { | ||
function GamePicture({ | ||
art_square, | ||
logo = undefined, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. same here as the other places, I'd just call this |
||
store, | ||
className, | ||
...props | ||
}: Props) { | ||
function getImageFormatting() { | ||
if (art_square === 'fallback' || !art_square) | ||
return { src: fallbackImage, fallback: fallbackImage } | ||
|
@@ -27,13 +34,22 @@ function GamePicture({ art_square, store, className, ...props }: Props) { | |
|
||
return ( | ||
<div className="gamePicture"> | ||
<CachedImage | ||
alt="cover-art" | ||
className={`gameImg ${className}`} | ||
src={src} | ||
fallback={fallback} | ||
{...props} | ||
/> | ||
{ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. are these |
||
<CachedImage | ||
alt="cover-art" | ||
className={`gameImg ${className}`} | ||
src={src} | ||
fallback={fallback} | ||
{...props} | ||
/> | ||
} | ||
{logo && ( | ||
<CachedImage | ||
alt="logo" | ||
src={`${logo}?h=400&resize=1&w=300`} | ||
className={`gameLogo`} | ||
/> | ||
)} | ||
</div> | ||
) | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe we can just use
art_logo
everywhere? it makes it easier to understand that it's the same thing that comes from the gameInfo and we already useart_...
for the other images, makes it more consistentThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
also, I think there's no need to do the
= undefined
since it will be undefined if it is undefined anywayI see we have this in GameCard, but in that component we do rename other properties like cover or appName and I think we can ignore the
= undefined
there too (not something to change in this PR though)