From 928094565bb784a6b08e747468b11a9accfc7805 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Josip=20Boj=C4=8Di=C4=87?= Date: Tue, 17 Feb 2026 23:38:02 +0100 Subject: [PATCH 1/2] Don't lazy load gift card images --- app/components/wallet-card.tsx | 1 - 1 file changed, 1 deletion(-) diff --git a/app/components/wallet-card.tsx b/app/components/wallet-card.tsx index 2a29d69c..14588168 100644 --- a/app/components/wallet-card.tsx +++ b/app/components/wallet-card.tsx @@ -103,7 +103,6 @@ export function WalletCardBackgroundImage({ {alt} From d571529f551b5cbfb47738bdf699ceccea86775d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Josip=20Boj=C4=8Di=C4=87?= Date: Tue, 17 Feb 2026 23:51:32 +0100 Subject: [PATCH 2/2] Preload gift card images on gift cards route --- app/features/gift-cards/use-discover-cards.ts | 2 ++ app/routes/_protected.gift-cards.tsx | 10 +++++++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/app/features/gift-cards/use-discover-cards.ts b/app/features/gift-cards/use-discover-cards.ts index 65bd59d7..7d4e1505 100644 --- a/app/features/gift-cards/use-discover-cards.ts +++ b/app/features/gift-cards/use-discover-cards.ts @@ -57,6 +57,8 @@ export const GIFT_CARDS: GiftCardInfo[] = [ }, ]; +export const GIFT_CARD_IMAGES = GIFT_CARDS.map((card) => card.image); + /** * Returns the gift card image for a given URL, if one exists. */ diff --git a/app/routes/_protected.gift-cards.tsx b/app/routes/_protected.gift-cards.tsx index 06b8d11e..d619339d 100644 --- a/app/routes/_protected.gift-cards.tsx +++ b/app/routes/_protected.gift-cards.tsx @@ -1,5 +1,13 @@ -import { Outlet } from 'react-router'; +import { type LinksFunction, Outlet } from 'react-router'; import '~/features/gift-cards/transitions.css'; +import { GIFT_CARD_IMAGES } from '~/features/gift-cards/use-discover-cards'; + +export const links: LinksFunction = () => + GIFT_CARD_IMAGES.map((imageUrl) => ({ + rel: 'preload', + href: imageUrl, + as: 'image', + })); export default function GiftCardsLayout() { return ;