Skip to content

Commit 82ab634

Browse files
fix(event): add fallback image when no featuredEventPhoto are set (#551)
Co-authored-by: malves.externe <malves.externe@bedrockstreaming.com>
1 parent 4ed402e commit 82ab634

File tree

5 files changed

+11
-5
lines changed

5 files changed

+11
-5
lines changed

modules/event/components/EventCard.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ export const EventCard: FC<Props> = ({ event }) => {
3434

3535
<div className={styles.venue}>
3636
<Image
37-
src={event.featuredEventPhoto.highResUrl}
37+
src={event.featuredEventPhoto?.highResUrl ?? '/lyonjs.webp'}
3838
alt={event.title}
3939
className={styles.picture}
4040
loading="lazy"

modules/event/components/EventDetail.tsx

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,13 @@ export const EventDetail: React.FC<Props> = async ({ event }) => {
5151
<ReactMarkdown>{event.description}</ReactMarkdown>
5252
</div>
5353
<div className={styles.sideContent}>
54-
<Image src={event.featuredEventPhoto.highResUrl} alt="" className={styles.image} width={240} height={150} />
54+
<Image
55+
src={event.featuredEventPhoto?.highResUrl ?? '/lyonjs.webp'}
56+
alt=""
57+
className={styles.image}
58+
width={240}
59+
height={150}
60+
/>
5561
{event.venues && <Location venue={Array.isArray(event.venues) ? event.venues[0] : event.venues} />}
5662
</div>
5763
{replays}

modules/event/components/EventMarkup.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ export const EventMarkup: React.FC<Props> = ({ event }) => {
4444
availability: 'https://schema.org/InStock',
4545
},
4646
image: [
47-
event.featuredEventPhoto.highResUrl,
47+
event.featuredEventPhoto?.highResUrl ?? '/lyonjs.webp',
4848
...(event.photoAlbum ? event.photoAlbum.photoSample.map((image) => image.source) : []),
4949
],
5050
description: event.description,

modules/event/components/EventTile.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ export const EventTile: React.FC<Props> = ({ event }) => {
1313

1414
return (
1515
<article className={styles.eventTile} aria-label={event.title}>
16-
<Image src={event.featuredEventPhoto.highResUrl} alt="" width={160} height={90} />
16+
<Image src={event.featuredEventPhoto?.highResUrl ?? '/lyonjs.webp'} alt="" width={160} height={90} />
1717
<div className={styles.content}>
1818
<h2>{event.title}</h2>
1919
<div className={styles.time}>{formattedDayAndMonth}</div>

modules/event/types.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ export type Event = {
3535
description: string;
3636
eventUrl: string;
3737
dateTime: string;
38-
featuredEventPhoto: {
38+
featuredEventPhoto?: {
3939
highResUrl: string;
4040
};
4141
rsvps: {

0 commit comments

Comments
 (0)