Merged in feature/SW-3365-blurry-images (pull request #2746)
Feature/SW-3365 reduce upscaling of images (fix blurry images) * fix: handle when images are wider than 3:2 but rendered in a 3:2 container * use dimensions everywhere applicable * fall back to using <img sizes='auto' /> if possible * imageLoader: never nest * remove empty test file Approved-by: Anton Gunnarsson Approved-by: Matilda Landström
This commit is contained in:
@@ -42,7 +42,13 @@ function ImageGallery({
|
||||
const intl = useIntl()
|
||||
const [isOpen, setIsOpen] = useState(false)
|
||||
const [imageError, setImageError] = useState(false)
|
||||
const imageProps = fill ? { fill, sizes } : { height, width: height * 1.5 }
|
||||
const imageProps = fill
|
||||
? {
|
||||
fill,
|
||||
sizes:
|
||||
sizes ?? 'auto, (max-width: 400px) 100vw, (min-width: 401px) 500px',
|
||||
}
|
||||
: { height, width: height * 1.5 }
|
||||
|
||||
if (!images || images.length === 0 || imageError) {
|
||||
return <ImageFallback />
|
||||
|
||||
Reference in New Issue
Block a user