feat: add card grid component

This commit is contained in:
Christel Westerberg
2024-04-26 08:19:19 +02:00
parent 2ddabf1e50
commit 00f30811cf
33 changed files with 575 additions and 121 deletions

View File

@@ -1,47 +1,46 @@
import { Embeds } from "@/types/requests/embeds"
import { DynamicContentBlock } from "@/types/requests/loyaltyPage"
import { PageLink } from "@/types/requests/myPages/navigation"
import { Edges } from "@/types/requests/utils/edges"
import { RTEDocument } from "@/types/rte/node"
export enum LoyaltyComponentEnum {
loyalty_levels = "loyalty_levels",
how_it_works = "how_it_works",
overview_table = "overview_table",
}
export type LoyaltyComponent = keyof typeof LoyaltyComponentEnum
export type DynamicContentBlock = {
dynamic_content: {
title: string
preamble?: string
component: LoyaltyComponent
link: {
text?: string
page: Edges<PageLink>
}
}
}
export type DynamicContentProps = {
dynamicContent: DynamicContentBlock["dynamic_content"]
}
type Card = {
referenceConnection: Edges<PageLink>
title?: string
subtitle?: string
open_in_new_tab: boolean
}
export type CardProps = { card: Card }
export type CardGrid = {
card_grid: {
heading: string
preamble: string
cards: {
referenceConnection: Edges<PageLink>
heading: string
preamble: string
}
title?: string
subtitle?: string
cards: Card[]
}
}
export type CardGridProps = CardGrid
export type Content = {
content: {
embedded_itemsConnection: Edges<Embeds>
json: RTEDocument
}
}
export type LevelCardProps = {
level: {
tier: number
name: string
requiredPoints: number
requiredNights: string
topBenefits: string[]
logo: string
}
}

View File

@@ -1,6 +1,6 @@
import { ContactFields } from "@/types/requests/contactConfig"
import { Embeds } from "@/types/requests/embeds"
import { JoinLoyaltyContactEnum } from "@/types/requests/loyaltyPage"
import { JoinLoyaltyContactContact } from "@/types/requests/loyaltyPage"
import { Edges } from "@/types/requests/utils/edges"
import { RTEDocument } from "@/types/rte/node"
@@ -16,5 +16,5 @@ export type Contact = {
}
export type ContactProps = {
contactBlock: JoinLoyaltyContactEnum[]
contactBlock: JoinLoyaltyContactContact[]
}