feat: add initial version of Loyalty Overview Table
This commit is contained in:
@@ -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() {
|
export default function OverviewTable() {
|
||||||
return <div></div>
|
const options = [
|
||||||
|
{ value: "a", label: "a" },
|
||||||
|
{ value: "b", label: "b" },
|
||||||
|
]
|
||||||
|
return (
|
||||||
|
<div className={styles.container}>
|
||||||
|
<Title
|
||||||
|
as="h1"
|
||||||
|
level="h1"
|
||||||
|
className={styles.title}
|
||||||
|
weight="semiBold"
|
||||||
|
uppercase
|
||||||
|
>
|
||||||
|
{_("7 delightful levels of friendship")}
|
||||||
|
</Title>
|
||||||
|
<div>
|
||||||
|
<p className={styles.preamble}>
|
||||||
|
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.
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
<div className={styles.columns}>
|
||||||
|
<div className={styles.leftColumn} />
|
||||||
|
<div className={styles.rightColumn} />
|
||||||
|
<div className={styles.columnHeaderContainer}>
|
||||||
|
<div className={styles.columnHeader}>
|
||||||
|
<Select options={options} />
|
||||||
|
<LevelSummary level={"1"} />
|
||||||
|
</div>
|
||||||
|
<div className={styles.columnHeader}>
|
||||||
|
<Select options={options} />
|
||||||
|
<LevelSummary level={"2"} />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<PerkCard />
|
||||||
|
<PerkCard />
|
||||||
|
<PerkCard />
|
||||||
|
<PerkCard />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
type SelectProps = {
|
||||||
|
options: {
|
||||||
|
label: string
|
||||||
|
value: string
|
||||||
|
}[]
|
||||||
|
}
|
||||||
|
|
||||||
|
function Select({ options }: SelectProps) {
|
||||||
|
console.log({ options })
|
||||||
|
return (
|
||||||
|
<div className={styles.selectContainer}>
|
||||||
|
<select className={styles.select}>
|
||||||
|
{options.map((option) => (
|
||||||
|
<option key={option.label} value={option.value}>
|
||||||
|
{option.label}
|
||||||
|
</option>
|
||||||
|
))}
|
||||||
|
</select>
|
||||||
|
<label className={styles.selectLabel} htmlFor="">
|
||||||
|
{_("Level")}
|
||||||
|
</label>
|
||||||
|
<span className={styles.selectChevron}>
|
||||||
|
<ChevronDown />
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
function LevelSummary({ level }: { level: string }) {
|
||||||
|
return (
|
||||||
|
<div className={styles.levelSummary}>
|
||||||
|
<Image
|
||||||
|
src="/_static/icons/loyaltylevels/new-friend.svg"
|
||||||
|
alt="level"
|
||||||
|
height={50}
|
||||||
|
width={100}
|
||||||
|
/>
|
||||||
|
<span className={styles.levelRequirements}>10 000p or X nights</span>
|
||||||
|
<p className={styles.levelSummaryText}>
|
||||||
|
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.
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
function PerkCard() {
|
||||||
|
const [isExpanded, setIsExpanded] = useState(false)
|
||||||
|
return (
|
||||||
|
<div className={styles.perkCard}>
|
||||||
|
<div className={styles.perkInfo}>
|
||||||
|
<details className={styles.details}>
|
||||||
|
<summary className={styles.summary}>
|
||||||
|
<hgroup className={styles.perkCardHeader}>
|
||||||
|
<Title as="h5" level="h2" className={styles.perkCardTitle}>
|
||||||
|
title
|
||||||
|
</Title>
|
||||||
|
<span className={styles.chevron}>
|
||||||
|
<ChevronDown />
|
||||||
|
</span>
|
||||||
|
</hgroup>
|
||||||
|
</summary>
|
||||||
|
<p className={styles.perkCardDescription}>
|
||||||
|
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.
|
||||||
|
</p>
|
||||||
|
</details>
|
||||||
|
</div>
|
||||||
|
<div className={styles.perkComparison}>
|
||||||
|
<div className={styles.comparisonItem}>
|
||||||
|
<CheckCircle />
|
||||||
|
</div>
|
||||||
|
<div className={styles.comparisonItem}>
|
||||||
|
<CheckCircle />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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;
|
||||||
|
}
|
||||||
@@ -20,7 +20,6 @@ function DynamicComponentBlock({ component }: DynamicComponentProps) {
|
|||||||
case LoyaltyComponentEnum.loyalty_levels:
|
case LoyaltyComponentEnum.loyalty_levels:
|
||||||
return <LoyaltyLevels />
|
return <LoyaltyLevels />
|
||||||
case LoyaltyComponentEnum.overview_table:
|
case LoyaltyComponentEnum.overview_table:
|
||||||
// TODO: IMPLEMENT OVERVIEW TABLE!
|
|
||||||
return <OverviewTable />
|
return <OverviewTable />
|
||||||
default:
|
default:
|
||||||
return null
|
return null
|
||||||
|
|||||||
Reference in New Issue
Block a user