Merged in fix/SW-2822-missing-meetingroom-images (pull request #2151)
fix: meeting rooms with missing images * fix: meeting rooms with missing images Approved-by: Linus Flood
This commit is contained in:
@@ -29,7 +29,7 @@ export default function MeetingRoomCard({ room }: MeetingRoomCardProps) {
|
|||||||
})
|
})
|
||||||
|
|
||||||
const maxSeatings = Math.max(...roomSeatings)
|
const maxSeatings = Math.max(...roomSeatings)
|
||||||
const image = room.content.images[0]
|
const image = room.content.images.at(0)
|
||||||
|
|
||||||
function handleShowMore() {
|
function handleShowMore() {
|
||||||
setOpened((state) => !state)
|
setOpened((state) => !state)
|
||||||
@@ -38,8 +38,8 @@ export default function MeetingRoomCard({ room }: MeetingRoomCardProps) {
|
|||||||
return (
|
return (
|
||||||
<article className={styles.card}>
|
<article className={styles.card}>
|
||||||
<Image
|
<Image
|
||||||
src={image.imageSizes.small}
|
src={image?.imageSizes.small || fallbackImage}
|
||||||
alt={image.metaData.altText || image.metaData.altText_En || ""}
|
alt={image?.metaData.altText || image?.metaData.altText_En || ""}
|
||||||
className={styles.image}
|
className={styles.image}
|
||||||
width={386}
|
width={386}
|
||||||
height={200}
|
height={200}
|
||||||
@@ -169,3 +169,6 @@ export default function MeetingRoomCard({ room }: MeetingRoomCardProps) {
|
|||||||
</article>
|
</article>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const fallbackImage =
|
||||||
|
"data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw=="
|
||||||
|
|||||||
Reference in New Issue
Block a user