Merged in fix/hotel-rooms (pull request #1288)

fix: Rooms images on hotel pages

* fix: Rooms images on hotel pages


Approved-by: Fredrik Thorsson
Approved-by: Matilda Landström
This commit is contained in:
Erik Tiekstra
2025-02-10 09:15:48 +00:00
parent e51950c8b2
commit 918887a63f
3 changed files with 5 additions and 2 deletions

View File

@@ -36,7 +36,8 @@ export function RoomCard({ room }: RoomCardProps) {
{ id: "{title} - Image gallery" },
{ title: name }
)}
height={200}
fill
sizes="(min-width: 768px) 320px, 100vw"
/>
</div>
<div className={styles.content}>

View File

@@ -18,11 +18,12 @@ function ImageGallery({
title,
fill,
height = 280,
sizes,
}: ImageGalleryProps) {
const intl = useIntl()
const [lightboxIsOpen, setLightboxIsOpen] = useState(false)
const [imageError, setImageError] = useState(false)
const imageProps = fill ? { fill } : { height, width: height * 1.5 }
const imageProps = fill ? { fill, sizes } : { height, width: height * 1.5 }
if (!images || images.length === 0 || imageError) {
return <div className={styles.imagePlaceholder} />

View File

@@ -11,4 +11,5 @@ export type ImageGalleryProps = {
fill?: boolean
width?: number
height?: number
sizes?: string
}