diff --git a/components/Loyalty/Blocks/DynamicContent/OverviewTable/BenefitCard/index.tsx b/components/Loyalty/Blocks/DynamicContent/OverviewTable/BenefitCard/index.tsx index 75f8d748c..0e655233d 100644 --- a/components/Loyalty/Blocks/DynamicContent/OverviewTable/BenefitCard/index.tsx +++ b/components/Loyalty/Blocks/DynamicContent/OverviewTable/BenefitCard/index.tsx @@ -19,7 +19,12 @@ export default function BenefitCard({
- + <Title + as="h5" + level="h2" + textTransform={"regular"} + className={styles.benefitCardTitle} + > {title} diff --git a/components/Loyalty/Blocks/DynamicContent/OverviewTable/BenefitValue/benefitValue.module.css b/components/Loyalty/Blocks/DynamicContent/OverviewTable/BenefitValue/benefitValue.module.css index 2f3bb7240..8d9bc24f1 100644 --- a/components/Loyalty/Blocks/DynamicContent/OverviewTable/BenefitValue/benefitValue.module.css +++ b/components/Loyalty/Blocks/DynamicContent/OverviewTable/BenefitValue/benefitValue.module.css @@ -14,6 +14,6 @@ } .benefitValueDetails { - font-size: var(--typography-Footnote-Regular-fontSize); + font-size: var(--typography-Caption-Regular-fontSize); text-align: center; } diff --git a/components/Loyalty/Blocks/DynamicContent/OverviewTable/LargeTable/index.tsx b/components/Loyalty/Blocks/DynamicContent/OverviewTable/LargeTable/index.tsx index 1b0b0248b..046512e74 100644 --- a/components/Loyalty/Blocks/DynamicContent/OverviewTable/LargeTable/index.tsx +++ b/components/Loyalty/Blocks/DynamicContent/OverviewTable/LargeTable/index.tsx @@ -1,19 +1,43 @@ +import { ChevronDown } from "react-feather" + +import Image from "@/components/Image" +import Title from "@/components/TempDesignSystem/Text/Title" + import BenefitValue from "../BenefitValue" import LevelSummary from "../LevelSummary" import styles from "./largeTable.module.css" -import { LargeTableProps } from "@/types/components/loyalty/blocks" +import { + BenefitTableHeaderProps, + LargeTableProps, +} from "@/types/components/loyalty/blocks" export default function LargeTable({ levels }: LargeTableProps) { return ( + + + ) + })} + ) @@ -24,11 +48,11 @@ export default function LargeTable({ levels }: LargeTableProps) { {levels[0].benefits.map((benefit, index) => { return ( - {levels.map((level) => { return ( @@ -44,3 +68,26 @@ export default function LargeTable({ levels }: LargeTableProps) {
+ + {levels.map((level) => { + return ( + + {level.name} +
{levels.map((level) => { return ( - +
- {benefit.name} - - {benefit.description} - + +
) } + +function BenefitTableHeader({ name, description }: BenefitTableHeaderProps) { + return ( +
+ +
+ + {name} + + + + +
+
+

{description}

+
+ ) +} diff --git a/components/Loyalty/Blocks/DynamicContent/OverviewTable/LargeTable/largeTable.module.css b/components/Loyalty/Blocks/DynamicContent/OverviewTable/LargeTable/largeTable.module.css index e1a76f39b..dc36578ea 100644 --- a/components/Loyalty/Blocks/DynamicContent/OverviewTable/LargeTable/largeTable.module.css +++ b/components/Loyalty/Blocks/DynamicContent/OverviewTable/LargeTable/largeTable.module.css @@ -6,26 +6,79 @@ .thead { background-color: var(--Base-Surface-Secondary-Normal); +} + +.iconRow { + background-color: var(--Base-Surface-Secondary-Normal); + border-bottom: none; position: sticky; top: 0; + z-index: 1; } -.th, -.td { +.verticalTableHeader { + width: 242px; +} + +.iconTh { border: 1px solid var(--Base-Border-Subtle); - padding: var(--Spacing-x3) var(--Spacing-x2); + border-bottom: none; + padding: var(--Spacing-x3) var(--Spacing-x2) var(--Spacing-x-one-and-half); } -.th { +.summaryTh { + border: 1px solid var(--Base-Border-Subtle); + border-top: none; font-size: var(--typography-Caption-Regular-fontSize); font-weight: 400; + padding: 0 var(--Spacing-x3) var(--Spacing-x2); } .td { + border: 1px solid var(--Base-Border-Subtle); font-size: var(--typography-Footnote-Regular-fontSize); + /* padding: var(--Spacing-x3) var(--Spacing-x2); */ text-align: center; } .tr:nth-child(odd) { background-color: var(--Base-Background-Primary-Elevated, #faf6f2); } + +.benefitTh { + border: 1px solid var(--Base-Border-Subtle); + padding: var(--Spacing-x3) var(--Spacing-x2); + font-size: var(--typography-Caption-Regular-fontSize); + font-weight: 400; +} + +.details[open] .chevron { + transform: rotate(180deg); +} + +.benefitHeader { + display: grid; + gap: var(--Spacing-x1); + grid-template-columns: 1fr auto; + text-align: start; +} + +.benefitDescription { + margin: 0; + padding-top: var(--Spacing-x1); + text-align: start; + padding-right: calc(24px + var(--Spacing-x1)); +} + +.chevron { + display: flex; + align-self: start; +} + +.summary::-webkit-details-marker { + display: none; +} + +.summary { + list-style: none; +} diff --git a/components/Loyalty/Blocks/DynamicContent/OverviewTable/LevelSummary/index.tsx b/components/Loyalty/Blocks/DynamicContent/OverviewTable/LevelSummary/index.tsx index b270da342..fb5c3ce33 100644 --- a/components/Loyalty/Blocks/DynamicContent/OverviewTable/LevelSummary/index.tsx +++ b/components/Loyalty/Blocks/DynamicContent/OverviewTable/LevelSummary/index.tsx @@ -7,7 +7,6 @@ import { LevelSummaryProps } from "@/types/components/loyalty/blocks" export default function LevelSummary({ level }: LevelSummaryProps) { return (
- {level.name} {level.requirement}

{level.description}

diff --git a/components/Loyalty/Blocks/DynamicContent/OverviewTable/index.tsx b/components/Loyalty/Blocks/DynamicContent/OverviewTable/index.tsx index 2d78835d0..d9b89f31e 100644 --- a/components/Loyalty/Blocks/DynamicContent/OverviewTable/index.tsx +++ b/components/Loyalty/Blocks/DynamicContent/OverviewTable/index.tsx @@ -6,6 +6,7 @@ import { useIntl } from "react-intl" import { Lang } from "@/constants/languages" +import Image from "@/components/Image" import Select from "@/components/TempDesignSystem/Form/Select" import levelsData from "./data/EN.json" @@ -59,6 +60,16 @@ export default function OverviewTable() { const [selectedLevelB, setSelectedLevelB] = useState(getLevelByTier(2)) const [selectedLevelC, setSelectedLevelC] = useState(getLevelByTier(3)) + const defaultLevelA = levelsData.levels.find( + (level) => level.tier === selectedLevelA.tier + ) as ComparisonLevel + const defaultLevelB = levelsData.levels.find( + (level) => level.tier === selectedLevelB.tier + ) as ComparisonLevel + const defaultLevelC = levelsData.levels.find( + (level) => level.tier === selectedLevelC.tier + ) as ComparisonLevel + function handleSelectChange( callback: Dispatch> ) { @@ -97,6 +108,14 @@ export default function OverviewTable() { defaultSelectedKey={selectedLevelA.tier} onSelect={handleSelectChange(setSelectedLevelA)} /> + {defaultLevelA.name} + + {defaultLevelB.name} + + {defaultLevelA.name} + + {defaultLevelB.name} + + {defaultLevelC.name} +