feat(SW-285): ship support for dynamic content
This commit is contained in:
@@ -0,0 +1,56 @@
|
||||
.benefitCard {
|
||||
padding-bottom: var(--Spacing-x-one-and-half);
|
||||
z-index: 2;
|
||||
grid-column: 1/3;
|
||||
}
|
||||
|
||||
.benefitCardHeader {
|
||||
display: grid;
|
||||
grid-template-columns: 1fr auto;
|
||||
}
|
||||
|
||||
.benefitCardDescription {
|
||||
font-size: var(--typography-Caption-Regular-fontSize);
|
||||
line-height: 150%;
|
||||
padding-right: var(--Spacing-x4);
|
||||
}
|
||||
|
||||
.benefitInfo {
|
||||
padding-bottom: var(--Spacing-x-one-and-half);
|
||||
}
|
||||
|
||||
.benefitComparison {
|
||||
display: grid;
|
||||
grid-template-columns: 1fr 1fr;
|
||||
}
|
||||
|
||||
.comparisonItem {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
padding-top: var(--Spacing-x-one-and-half);
|
||||
}
|
||||
|
||||
.details[open] .chevron {
|
||||
transform: rotate(180deg);
|
||||
}
|
||||
|
||||
.chevron {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
color: var(--UI-Grey-80);
|
||||
}
|
||||
|
||||
.summary::-webkit-details-marker {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.summary {
|
||||
list-style: none;
|
||||
}
|
||||
|
||||
@media screen and (min-width: 950px) {
|
||||
.benefitComparison {
|
||||
grid-template-columns: 1fr 1fr 1fr;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,53 @@
|
||||
import { ChevronDown } from "react-feather"
|
||||
|
||||
import Title from "@/components/TempDesignSystem/Text/Title"
|
||||
|
||||
import BenefitValue from "../BenefitValue"
|
||||
|
||||
import styles from "./benefitCard.module.css"
|
||||
|
||||
import type { BenefitCardProps } from "@/types/components/loyalty/blocks"
|
||||
|
||||
export default function BenefitCard({
|
||||
comparedValues,
|
||||
title,
|
||||
description,
|
||||
}: BenefitCardProps) {
|
||||
return (
|
||||
<div className={styles.benefitCard}>
|
||||
<div className={styles.benefitInfo}>
|
||||
<details className={styles.details}>
|
||||
<summary className={styles.summary}>
|
||||
<hgroup className={styles.benefitCardHeader}>
|
||||
<Title
|
||||
as="h5"
|
||||
level="h2"
|
||||
textTransform={"regular"}
|
||||
className={styles.benefitCardTitle}
|
||||
>
|
||||
{title}
|
||||
</Title>
|
||||
<span className={styles.chevron}>
|
||||
<ChevronDown />
|
||||
</span>
|
||||
</hgroup>
|
||||
</summary>
|
||||
<p
|
||||
className={styles.benefitCardDescription}
|
||||
dangerouslySetInnerHTML={{ __html: description }}
|
||||
/>
|
||||
</details>
|
||||
</div>
|
||||
<div className={styles.benefitComparison}>
|
||||
{comparedValues.map((benefit, idx) => (
|
||||
<div
|
||||
key={`${benefit.valueDetails}-${idx}`}
|
||||
className={styles.comparisonItem}
|
||||
>
|
||||
<BenefitValue benefit={benefit} />
|
||||
</div>
|
||||
))}
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
Reference in New Issue
Block a user