web: set high fetch priority for top two featured events (above the fold on mobile)

This commit is contained in:
2026-05-20 00:05:09 +02:00
parent e4c0558527
commit 7f95d8e252
2 changed files with 11 additions and 2 deletions
+3
View File
@@ -22,6 +22,7 @@ export const EventItem = ({
mode,
size,
imageLoading,
imageFetchPriority,
}: {
event:
| SingularEvent
@@ -31,6 +32,7 @@ export const EventItem = ({
mode: "list" | "calendar" | "singular-time-only";
size?: "small" | "medium" | "large";
imageLoading?: "eager" | "lazy";
imageFetchPriority?: "high" | "low" | "auto";
}) => {
const futureOccurrences = getFutureOccurrences(event);
const groupedOccurrences = groupConsecutiveDates(
@@ -55,6 +57,7 @@ export const EventItem = ({
height={0}
sizes="(max-width: 900px) 100vw, 25vw"
loading={imageLoading}
fetchPriority={imageFetchPriority}
/>
)}
</div>
+8 -2
View File
@@ -9,8 +9,14 @@ export const FeaturedEvents = ({ events }: { events: EventListItemFragment[] })
<section className={styles.featuredEvents}>
<SectionHeader heading="Arrangementer" link="/arrangementer" linkText="Se alle arrangementer" />
<ul className={styles.eventList}>
{events.slice(0, 3).map((event) => (
<EventItem key={event.id} event={event} mode="list" imageLoading="eager" />
{events.slice(0, 3).map((event, index) => (
<EventItem
key={event.id}
event={event}
mode="list"
imageLoading="eager"
imageFetchPriority={index < 2 ? "high" : undefined}
/>
))}
</ul>
<SectionFooter link="/arrangementer" linkText="Se alle arrangementer" />