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
26 lines
443 B
TypeScript
26 lines
443 B
TypeScript
import Image from "@scandic-hotels/design-system/Image"
|
|
|
|
import styles from "./hero.module.css"
|
|
|
|
import type { HeroProps } from "./hero"
|
|
|
|
export default async function Hero({
|
|
alt,
|
|
src,
|
|
focalPoint,
|
|
dimensions,
|
|
}: HeroProps) {
|
|
return (
|
|
<Image
|
|
className={styles.hero}
|
|
alt={alt}
|
|
height={480}
|
|
width={1196}
|
|
src={src}
|
|
focalPoint={focalPoint}
|
|
dimensions={dimensions}
|
|
priority
|
|
/>
|
|
)
|
|
}
|