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} 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 ;