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
+3 -2
View File
@@ -1,8 +1,9 @@
import type { User } from "@/types/user"
import { Shortcut } from "@/types/requests/myPages/accountpage"
import { PageLink } from "@/types/requests/utils/pageLink"
import { ReactNode } from "react"
export type ShortcutsProps = {
shortcuts: User["shortcuts"]
shortcuts: { url: string; title: string }[]
title: string | ReactNode
subtitle?: string
}
+30 -12
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