Skip to content

[FIX] Favourites layout #2864

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

Merged
merged 2 commits into from
Jul 16, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion src/backend/storeManagers/gog/library.ts
Original file line number Diff line number Diff line change
Expand Up @@ -636,7 +636,10 @@ export async function gogToUnifiedInfo(
store_url: galaxyProductInfo?.links.product_card,
developer: info.game.developers.map((dev) => dev.name).join(', '),
app_name: String(info.external_id),
art_cover: `https:${galaxyProductInfo?.images.logo2x}`,
art_cover:
info.game?.logo?.url_format
?.replace('{formatter}', '')
.replace('{ext}', 'jpg') || `https:${galaxyProductInfo?.images.logo2x}`,
art_square: info.game.vertical_cover.url_format
.replace('{formatter}', '')
.replace('{ext}', 'jpg'),
Expand Down
8 changes: 5 additions & 3 deletions src/frontend/screens/Library/components/GamesList/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ interface Props {
) => void
onlyInstalled?: boolean
isRecent?: boolean
isFavourite?: boolean
}

const GamesList = ({
Expand All @@ -24,7 +25,8 @@ const GamesList = ({
handleGameCardClick,
isFirstLane = false,
onlyInstalled = false,
isRecent = false
isRecent = false,
isFavourite = false
}: Props): JSX.Element => {
const { gameUpdates } = useContext(ContextProvider)
const { t } = useTranslation()
Expand Down Expand Up @@ -92,7 +94,7 @@ const GamesList = ({
{!!library.length &&
library.map((gameInfo, index) => {
const { app_name, is_installed, runner } = gameInfo
const isJustPlayed = isRecent && index === 0
const isJustPlayed = (isFavourite || isRecent) && index === 0
let is_dlc = false
if (gameInfo.runner !== 'sideload') {
is_dlc = gameInfo.install.is_dlc ?? false
Expand All @@ -108,7 +110,7 @@ const GamesList = ({
const hasUpdate = is_installed && gameUpdates?.includes(app_name)
return (
<GameCard
key={app_name}
key={`${runner}_${app_name}${isFirstLane ? '_firstlane' : ''}`}
hasUpdate={hasUpdate}
buttonClick={() => {
if (gameInfo.runner !== 'sideload')
Expand Down
1 change: 1 addition & 0 deletions src/frontend/screens/Library/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -366,6 +366,7 @@ export default React.memo(function Library(): JSX.Element {
<GamesList
library={favourites}
handleGameCardClick={handleModal}
isFavourite
isFirstLane
/>
</>
Expand Down