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