fix(SW-302): add back imageWidth fix
This commit is contained in:
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user