feat: add blocks for loyalty page
This commit is contained in:
@@ -1,10 +1,11 @@
|
||||
import { PageLink } from "./myPages/navigation"
|
||||
import { Edges } from "./utils/edges"
|
||||
import type { AllRequestResponse } from "./utils/all"
|
||||
import type { Typename } from "./utils/typename"
|
||||
import type { RTEDocument } from "../rte/node"
|
||||
import type { Embeds } from "./embeds"
|
||||
import type { ContactField } from "./contactConfig"
|
||||
import { Contact, SidebarContent } from "../components/loyalty/sidebar"
|
||||
import {
|
||||
CardGrid,
|
||||
Content,
|
||||
DynamicContentBlock,
|
||||
} from "../components/loyalty/blocks"
|
||||
|
||||
export enum SidebarTypenameEnum {
|
||||
LoyaltyPageSidebarJoinLoyaltyContact = "LoyaltyPageSidebarJoinLoyaltyContact",
|
||||
@@ -13,24 +14,11 @@ export enum SidebarTypenameEnum {
|
||||
|
||||
export type SidebarTypename = keyof typeof SidebarTypenameEnum
|
||||
|
||||
type SidebarContent = {
|
||||
content: {
|
||||
embedded_itemsConnection: Edges<Embeds>
|
||||
json: RTEDocument
|
||||
}
|
||||
}
|
||||
|
||||
type Contact = {
|
||||
contact: {
|
||||
contact_fields: ContactField[]
|
||||
}
|
||||
}
|
||||
|
||||
enum JoinLoyaltyContactTypenameEnum {
|
||||
export enum JoinLoyaltyContactTypenameEnum {
|
||||
LoyaltyPageSidebarJoinLoyaltyContactBlockContactContact = "LoyaltyPageSidebarJoinLoyaltyContactBlockContactContact",
|
||||
}
|
||||
|
||||
type JoinLoyaltyContactEnum = Typename<
|
||||
export type JoinLoyaltyContactEnum = Typename<
|
||||
Contact,
|
||||
JoinLoyaltyContactTypenameEnum.LoyaltyPageSidebarJoinLoyaltyContactBlockContactContact
|
||||
>
|
||||
@@ -57,43 +45,10 @@ export enum LoyaltyBlocksTypenameEnum {
|
||||
LoyaltyPageBlocksContent = "LoyaltyPageBlocksContent",
|
||||
}
|
||||
|
||||
type CardGrid = {
|
||||
card_grid: {
|
||||
heading: string
|
||||
preamble: string
|
||||
cards: {
|
||||
referenceConnection: Edges<PageLink>
|
||||
heading: string
|
||||
preamble: string
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
type Content = {
|
||||
content: {
|
||||
embedded_itemsConnection: Edges<Embeds>
|
||||
json: RTEDocument
|
||||
}
|
||||
}
|
||||
|
||||
type LoyaltyComponent = "loyalty_levels" | "how_it_works" | "overview_table"
|
||||
|
||||
type DynamicContent = {
|
||||
dynamic_content: {
|
||||
title: string
|
||||
preamble?: string
|
||||
component: LoyaltyComponent
|
||||
link: {
|
||||
text?: string
|
||||
page: Edges<PageLink>
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
export type Blocks =
|
||||
| Typename<CardGrid, LoyaltyBlocksTypenameEnum.LoyaltyPageBlocksCardGrid>
|
||||
| Typename<
|
||||
DynamicContent,
|
||||
DynamicContentBlock,
|
||||
LoyaltyBlocksTypenameEnum.LoyaltyPageBlocksDynamicContent
|
||||
>
|
||||
| Typename<Content, LoyaltyBlocksTypenameEnum.LoyaltyPageBlocksContent>
|
||||
|
||||
Reference in New Issue
Block a user