feat(SW-285): ship support for dynamic content

This commit is contained in:
Chuma McPhoy
2024-09-02 20:01:48 +02:00
parent e88e4d92bf
commit 1c2a34591b
35 changed files with 5125 additions and 0 deletions

View File

@@ -0,0 +1,19 @@
.benefitValueContainer {
display: flex;
flex-direction: column;
align-items: center;
gap: var(--Spacing-x-half);
padding: 0 var(--Spacing-x4) 0 var(--Spacing-x4);
text-wrap: balance;
}
.benefitValue {
font-size: var(--typography-Body-Bold-fontSize);
font-weight: var(--typography-Body-Bold-fontWeight);
}
.benefitValueDetails {
font-size: var(--typography-Footnote-Regular-fontSize);
text-align: center;
color: var(--UI-Grey-80);
}

View File

@@ -0,0 +1,26 @@
import { Minus } from "react-feather"
import CheckCircle from "@/components/Icons/CheckCircle"
import styles from "./benefitValue.module.css"
import type { BenefitValueProps } from "@/types/components/loyalty/blocks"
export default function BenefitValue({ benefit }: BenefitValueProps) {
if (!benefit.unlocked) {
return <Minus color="var(--UI-Grey-40)" />
}
if (!benefit.value) {
return <CheckCircle height={32} width={32} color="green" />
}
return (
<div className={styles.benefitValueContainer}>
<span className={styles.benefitValue}>{benefit.value}</span>
{benefit.valueDetails && (
<span className={styles.benefitValueDetails}>
{benefit.valueDetails}
</span>
)}
</div>
)
}