Files
web/apps/scandic-web/components/TempDesignSystem/LoyaltyCard/index.tsx
Joakim Jäderberg 7eb74ea239 Merged in chore/replace-deprecated-body (pull request #3300)
Replace deprecated <Body> with <Typography>

* chore: replace deprecated body component

* refactor: replace Body component with Typography across various components

* merge


Approved-by: Bianca Widstam
Approved-by: Matilda Landström
2025-12-09 12:45:34 +00:00

71 lines
1.8 KiB
TypeScript

import { MaterialIcon } from "@scandic-hotels/design-system/Icons/MaterialIcon"
import Image from "@scandic-hotels/design-system/Image"
import Link from "@scandic-hotels/design-system/OldDSLink"
import Title from "@scandic-hotels/design-system/Title"
import { Typography } from "@scandic-hotels/design-system/Typography"
import { loyaltyCardVariants } from "./variants"
import styles from "./loyaltyCard.module.css"
import type { LoyaltyCardProps } from "./loyaltyCard"
export default function LoyaltyCard({
link,
image,
heading,
bodyText,
theme = "white",
className,
}: LoyaltyCardProps) {
return (
<article
className={loyaltyCardVariants({
className,
theme,
})}
>
{image ? (
<Image
src={image.url}
width={180}
height={160}
className={styles.image}
alt={image.meta.alt || image.title}
focalPoint={image.focalPoint}
dimensions={image.dimensions}
/>
) : null}
<Title as="h4" level="h3" textAlign="center">
{heading}
</Title>
{!!bodyText && (
<Typography
variant="Body/Paragraph/mdRegular"
className={styles.bodyText}
>
<p>{bodyText}</p>
</Typography>
)}
<div className={styles.buttonContainer}>
{link ? (
<Link
className={styles.link}
href={link.href}
target={link.openInNewTab ? "_blank" : undefined}
textDecoration="underline"
>
<MaterialIcon
icon="arrow_right"
color="CurrentColor"
className={styles.icon}
size={20}
/>
{link.title}
</Link>
) : null}
</div>
</article>
)
}