feat: add initial rendering of Account page data

This commit is contained in:
Arvid Norlin
2024-04-18 12:48:57 +02:00
parent 1543065d27
commit ed2cc59a87
7 changed files with 121 additions and 29 deletions

View File

@@ -1,10 +1,18 @@
import { AllRequestResponse } from "../utils/all"
import type { TypenameInterface } from "../utils/typename"
import type { Typename } from "../utils/typename"
import type { Edges } from "../utils/edges"
import { PageLink } from "../utils/pageLink"
export type PageLink = {
url: string
title: string
export enum DynamicContentComponents {
membership_overview = "membership_overview",
benefits = "benefits",
previous_stays = "previous_stays",
upcoming_stays = "upcoming_stays",
}
export enum ContentEntries {
AccountPageContentDynamicContent = "AccountPageContentDynamicContent",
AccountPageContentShortcuts = "AccountPageContentShortcuts",
}
export type Shortcut = {
@@ -12,19 +20,29 @@ export type Shortcut = {
linkConnection: Edges<PageLink>
}
export type Shortcuts = {
title: string
preamble: string
shortcuts: Shortcut[]
}
export type DynamicContent = {
component: string
component: DynamicContentComponents
title: string
link: { linkConnection: Edges<PageLink>; link_text: string }
}
export type AccountPageContentItem = {}
export type AccountPageDynamicContent = Typename<
{ dynamic_content: DynamicContent },
ContentEntries.AccountPageContentDynamicContent
>
export type AccountPageContentShortcuts = Typename<
{
title: string
preamble: string
shortcuts: { shortcuts: Shortcut[] }
},
ContentEntries.AccountPageContentShortcuts
>
export type AccountPageContentItem =
| AccountPageDynamicContent
| AccountPageContentShortcuts
export type AccountPage = {
url: string