fix(SW-302): add Card image gradient as prop

This commit is contained in:
Matilda Landström
2024-10-01 14:02:22 +02:00
parent e7f6cc7268
commit 42cf49deae
3 changed files with 4 additions and 1 deletions

View File

@@ -103,6 +103,7 @@ export default function MegaMenu({
scriptedTopTitle={card.scripted_top_title} scriptedTopTitle={card.scripted_top_title}
onPrimaryButtonClick={handleNavigate} onPrimaryButtonClick={handleNavigate}
onSecondaryButtonClick={handleNavigate} onSecondaryButtonClick={handleNavigate}
imageGradient
theme="image" theme="image"
/> />
</div> </div>

View File

@@ -25,6 +25,7 @@ export interface CardProps
bodyText?: string | null bodyText?: string | null
imageHeight?: number imageHeight?: number
imageWidth?: number imageWidth?: number
imageGradient?: boolean
onPrimaryButtonClick?: () => void onPrimaryButtonClick?: () => void
onSecondaryButtonClick?: () => void onSecondaryButtonClick?: () => void
backgroundImage?: ImageVaultAsset | ApiImage backgroundImage?: ImageVaultAsset | ApiImage

View File

@@ -24,6 +24,7 @@ export default function Card({
backgroundImage, backgroundImage,
imageHeight, imageHeight,
imageWidth, imageWidth,
imageGradient,
onPrimaryButtonClick, onPrimaryButtonClick,
onSecondaryButtonClick, onSecondaryButtonClick,
}: CardProps) { }: CardProps) {
@@ -45,7 +46,7 @@ export default function Card({
})} })}
> >
{backgroundImage && ( {backgroundImage && (
<div className={styles.imageWrapper}> <div className={imageGradient ? styles.imageWrapper : ""}>
<Image <Image
src={backgroundImage.url} src={backgroundImage.url}
className={styles.image} className={styles.image}