diff --git a/apps/scandic-web/components/TempDesignSystem/Card/card.module.css b/apps/scandic-web/components/TempDesignSystem/Card/card.module.css index e5ed857cd..ced594ee9 100644 --- a/apps/scandic-web/components/TempDesignSystem/Card/card.module.css +++ b/apps/scandic-web/components/TempDesignSystem/Card/card.module.css @@ -20,13 +20,13 @@ height: 100%; } -.imageWrapper { +.imageContainer { display: flex; width: 100%; height: 100%; } -.imageWrapper::after { +.imageGradient::after { background: linear-gradient( 180deg, rgba(0, 0, 0, 0) 0%, diff --git a/apps/scandic-web/components/TempDesignSystem/Card/card.ts b/apps/scandic-web/components/TempDesignSystem/Card/card.ts index 7f58c2f89..6c6f4e740 100644 --- a/apps/scandic-web/components/TempDesignSystem/Card/card.ts +++ b/apps/scandic-web/components/TempDesignSystem/Card/card.ts @@ -24,8 +24,6 @@ export interface CardProps scriptedTopTitle?: string | null heading?: string | null bodyText?: string | null - imageHeight?: number - imageWidth?: number imageGradient?: boolean onPrimaryButtonClick?: () => void onSecondaryButtonClick?: () => void diff --git a/apps/scandic-web/components/TempDesignSystem/Card/index.tsx b/apps/scandic-web/components/TempDesignSystem/Card/index.tsx index 779febd6b..0473bac89 100644 --- a/apps/scandic-web/components/TempDesignSystem/Card/index.tsx +++ b/apps/scandic-web/components/TempDesignSystem/Card/index.tsx @@ -1,3 +1,4 @@ +import { cx } from "class-variance-authority" import Link from "next/link" import Image from "@/components/Image" @@ -27,8 +28,6 @@ export default function Card({ className, theme, backgroundImage, - imageHeight, - imageWidth, imageGradient, onPrimaryButtonClick, onSecondaryButtonClick, @@ -39,16 +38,6 @@ export default function Card({ const scriptFontColor = getScriptFontColor(theme) const bodyFontColor = getBodyFontColor(theme) - imageHeight = imageHeight || 320 - - imageWidth = - imageWidth || - (backgroundImage?.dimensions - ? backgroundImage.dimensions.aspectRatio >= 1 - ? backgroundImage.dimensions.aspectRatio * imageHeight - : imageHeight / backgroundImage.dimensions.aspectRatio - : 420) - return (
{backgroundImage && ( -
+
{backgroundImage.meta.alt