From 1fd0e7164a74931473e9019c645bdb1b232e9f38 Mon Sep 17 00:00:00 2001 From: Arvid Norlin Date: Mon, 20 May 2024 14:14:29 +0200 Subject: [PATCH] feat: add initial version of Loyalty Overview Table --- .../DynamicContent/OverviewTable/index.tsx | 142 +++++++++++++++- .../OverviewTable/overviewTable.module.css | 157 ++++++++++++++++++ .../Loyalty/Blocks/DynamicContent/index.tsx | 1 - 3 files changed, 298 insertions(+), 2 deletions(-) create mode 100644 components/Loyalty/Blocks/DynamicContent/OverviewTable/overviewTable.module.css diff --git a/components/Loyalty/Blocks/DynamicContent/OverviewTable/index.tsx b/components/Loyalty/Blocks/DynamicContent/OverviewTable/index.tsx index c90c221e6..489250ba1 100644 --- a/components/Loyalty/Blocks/DynamicContent/OverviewTable/index.tsx +++ b/components/Loyalty/Blocks/DynamicContent/OverviewTable/index.tsx @@ -1,3 +1,143 @@ +"use client" + +import { useState } from "react" + +import { _ } from "@/lib/translation" + +import CheckCircle from "@/components/Icons/CheckCircle" +import ChevronDown from "@/components/Icons/ChevronDown" +import Image from "@/components/Image" +import Title from "@/components/Title" + +import styles from "./overviewTable.module.css" + export default function OverviewTable() { - return
+ const options = [ + { value: "a", label: "a" }, + { value: "b", label: "b" }, + ] + return ( +
+ + {_("7 delightful levels of friendship")} + +
+

+ Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do + eiusmod tempor incididunt ut labore et dolore magna aliqua. Arcu risus + quis varius quam quisque id diam vel. Rhoncus urna neque viverra + justo. Mattis aliquam faucibus purus in massa. Id cursus metus aliquam + eleifend mi in nulla posuere. +

+
+
+
+
+
+
+ + +
+
+ + + + +
+
+ ) +} + +type SelectProps = { + options: { + label: string + value: string + }[] +} + +function Select({ options }: SelectProps) { + console.log({ options }) + return ( +
+ + + + + +
+ ) +} + +function LevelSummary({ level }: { level: string }) { + return ( +
+ level + 10 000p or X nights +

+ Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod + tempor incididunt ut labore et dolore magna aliqua. Arcu risus quis + varius quam quisque id diam vel. Rhoncus urna neque viverra justo. + Mattis aliquam faucibus purus in massa. Id cursus metus aliquam eleifend + mi in nulla posuere. +

+
+ ) +} + +function PerkCard() { + const [isExpanded, setIsExpanded] = useState(false) + return ( +
+
+
+ +
+ + title + + + + +
+
+

+ Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do + eiusmod tempor incididunt ut labore et dolore magna aliqua. Sed + adipiscing diam donec adipiscing tristique risus nec feugiat. +

+
+
+
+
+ +
+
+ +
+
+
+ ) } diff --git a/components/Loyalty/Blocks/DynamicContent/OverviewTable/overviewTable.module.css b/components/Loyalty/Blocks/DynamicContent/OverviewTable/overviewTable.module.css new file mode 100644 index 000000000..9386b0711 --- /dev/null +++ b/components/Loyalty/Blocks/DynamicContent/OverviewTable/overviewTable.module.css @@ -0,0 +1,157 @@ +.container { + background-color: var(--Main-Brand-PalePeach); +} + +.title { + font-family: var(--typography-Title1-Desktop-fontFamily), inherit; +} + +.preamble { + color: var(--Base-Text-Primary-High-contrast); + font-size: var(--typography-Body-Regular-fontSize); + line-height: 150%; +} + +.columns { + display: flex; + flex-direction: column; + gap: 1.6rem; + padding: 1.6rem; + position: relative; +} + +.columnHeaderContainer { + display: grid; + grid-template-columns: 1fr 1fr; + gap: 1.6rem; + z-index: 2; +} + +.columnHeader { + display: flex; + flex-direction: column; + gap: 1.6rem; +} + +.selectContainer { + position: relative; + width: 100%; +} + +.selectLabel { + color: var(--Base-Text-UI-Placeholder); + position: absolute; + top: 7px; + left: 1.6rem; +} + +.select { + appearance: none; + border: 1px solid var(--Base-Input-Controls-Border-Normal, #b8a79a); + border-radius: 8px; + padding: 1.6rem; + width: 100%; +} + +.selectChevron { + display: flex; + align-items: center; + position: absolute; + right: 1.6rem; + bottom: 1.6rem; +} + +.leftColumn { + background-color: var(--Main-Brand-PalePeach); + position: absolute; + top: 0; + bottom: 0; + left: 0; + right: 50%; + z-index: 1; +} + +.rightColumn { + background-color: var(--Base-Background-Normal); + position: absolute; + position: absolute; + top: 0; + bottom: 0; + left: 50%; + right: 0; + z-index: 1; + border-top-left-radius: 8px; +} + +.levelSummary { + display: flex; + flex-direction: column; + align-items: center; + gap: 1.6rem; +} + +.levelRequirements { + background-color: var(--Main-Brand-Burgundy); + border-radius: 8px; + color: #f7e1d5; + padding: 4px 8px; +} + +.levelSummaryText { + color: var(--Main-Brand-Burgundy); + font-size: var(--typography-Footnote-Regular-fontSize); + line-height: 150%; + margin: 0; +} + +.perkCard { + background-color: var(--Main-Grey-White); + border: 1px solid var(--Base-Border-Subtle); + border-radius: 0.4rem; + color: var(--Main-Brand-Burgundy); + padding: 0 1.6rem; + z-index: 2; +} + +.details[open] .chevron { + transform: rotate(180deg); +} + +.chevron { + display: flex; + align-items: center; +} + +.summary::-webkit-details-marker { + display: none; +} + +.summary { + list-style: none; +} + +.perkCardHeader { + display: grid; + grid-template-columns: 1fr auto; +} + +.perkCardDescription { + line-height: 150%; +} + +.perkInfo { + border-bottom: 1px solid var(--Base-Border-Subtle); + padding: 1.5rem 0; +} + +.perkComparison { + display: grid; + grid-template-columns: 1fr 1fr; +} + +.comparisonItem { + display: flex; + justify-content: center; + align-items: center; + padding: 1rem; +} diff --git a/components/Loyalty/Blocks/DynamicContent/index.tsx b/components/Loyalty/Blocks/DynamicContent/index.tsx index d9e01cc03..3e8db8392 100644 --- a/components/Loyalty/Blocks/DynamicContent/index.tsx +++ b/components/Loyalty/Blocks/DynamicContent/index.tsx @@ -20,7 +20,6 @@ function DynamicComponentBlock({ component }: DynamicComponentProps) { case LoyaltyComponentEnum.loyalty_levels: return case LoyaltyComponentEnum.overview_table: - // TODO: IMPLEMENT OVERVIEW TABLE! return default: return null