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
+34 -16
View File
@@ -1,24 +1,16 @@
import { CardGrid, Content } from "../components/loyalty/blocks"
import { Contact, SidebarContent } from "../components/loyalty/sidebar"
import { PageLink } from "./myPages/navigation"
import { Edges } from "./utils/edges"
import type { AllRequestResponse } from "./utils/all"
import type { Typename } from "./utils/typename"
import { Contact, SidebarContent } from "../components/loyalty/sidebar"
import {
CardGrid,
Content,
DynamicContentBlock,
} from "../components/loyalty/blocks"
export enum SidebarTypenameEnum {
LoyaltyPageSidebarJoinLoyaltyContact = "LoyaltyPageSidebarJoinLoyaltyContact",
LoyaltyPageSidebarContent = "LoyaltyPageSidebarContent",
}
export type SidebarTypename = keyof typeof SidebarTypenameEnum
export enum JoinLoyaltyContactTypenameEnum {
LoyaltyPageSidebarJoinLoyaltyContactBlockContactContact = "LoyaltyPageSidebarJoinLoyaltyContactBlockContactContact",
}
export type JoinLoyaltyContactEnum = Typename<
export type JoinLoyaltyContactContact = Typename<
Contact,
JoinLoyaltyContactTypenameEnum.LoyaltyPageSidebarJoinLoyaltyContactBlockContactContact
>
@@ -27,11 +19,17 @@ export type JoinLoyaltyContact = {
join_loyalty_contact: {
title?: string
preamble?: string
contact: JoinLoyaltyContactEnum[]
login_button_text: string
contact: JoinLoyaltyContactContact[]
}
}
export enum SidebarTypenameEnum {
LoyaltyPageSidebarJoinLoyaltyContact = "LoyaltyPageSidebarJoinLoyaltyContact",
LoyaltyPageSidebarContent = "LoyaltyPageSidebarContent",
}
export type SidebarTypename = keyof typeof SidebarTypenameEnum
export type Sidebar =
| Typename<SidebarContent, SidebarTypenameEnum.LoyaltyPageSidebarContent>
| Typename<
@@ -39,6 +37,26 @@ export type Sidebar =
SidebarTypenameEnum.LoyaltyPageSidebarJoinLoyaltyContact
>
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
subtitle?: string
component: LoyaltyComponent
link: {
text?: string
pageConnection: Edges<PageLink>
}
}
}
export enum LoyaltyBlocksTypenameEnum {
LoyaltyPageBlocksDynamicContent = "LoyaltyPageBlocksDynamicContent",
LoyaltyPageBlocksCardGrid = "LoyaltyPageBlocksCardGrid",