fix(SW-302): add back imageWidth fix

This commit is contained in:
Matilda Landström
2024-10-01 12:55:40 +02:00
parent 40c6ed0f20
commit c3fbd35cff

View File

@@ -11,7 +11,6 @@ import { cardVariants } from "./variants"
import styles from "./card.module.css"
import type { ImageVaultAsset } from "@/types/components/imageVault"
import type { CardProps } from "./card"
export default function Card({
@@ -32,12 +31,12 @@ export default function Card({
imageHeight = imageHeight || 320
/*imageWidth =
imageWidth =
imageWidth ||
(backgroundImage
(backgroundImage && "dimensions" in backgroundImage
? backgroundImage.dimensions.aspectRatio * imageHeight
: 420)
*/
return (
<article
className={cardVariants({
@@ -51,7 +50,7 @@ export default function Card({
src={backgroundImage.url}
className={styles.image}
alt={backgroundImage.meta.alt || backgroundImage.title}
width={420}
width={imageWidth}
height={imageHeight}
/>
</div>