web: right-size card images and load the first ones eagerly

This commit is contained in:
ponas committed 2026-10-14 02:02:26 +02:00
1 parent 4c05c3c8c3
commit e3e4a613c5
6 files changed
+61 -9

No files matched your search

+10 -1
View File
@@ -3,7 +3,14 @@ import styles from "./venueItem.module.scss";
import Link from "next/link";
import { Image } from "@/components/general/Image";
export const VenueItem = ({ venue }: { venue: VenueFragment }) => {
export const VenueItem = ({
venue,
priority,
}: {
venue: VenueFragment;
// above the fold: load the image right away
priority?: boolean;
}) => {
const featuredImage: any = venue.featuredImage;
const { capacitySitting, capacityStanding, usedFor } = venue;
@@ -27,6 +34,8 @@ export const VenueItem = ({ venue }: { venue: VenueFragment }) => {
width={0}
height={0}
sizes="(max-width: 600px) 100vw, (max-width: 900px) 50vw, 35vw"
loading={priority ? "eager" : undefined}
fetchPriority={priority ? "high" : undefined}
/>
)}
</div>