feat(SW-285): ship support for dynamic content
This commit is contained in:
@@ -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);
|
||||
}
|
||||
@@ -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>
|
||||
)
|
||||
}
|
||||
Reference in New Issue
Block a user