feat: add my benefits page

This commit is contained in:
Christel Westerberg
2024-04-08 09:27:51 +02:00
parent 0a3292a354
commit 8ca4767806
10 changed files with 180 additions and 2 deletions

View File

@@ -0,0 +1,57 @@
import type { Preamble } from "./preamble"
import type { AllRequestResponse } from "./utils/all"
import type { MyPageBlocksEnum, Typename } from "./utils/typename"
type Shortcuts = {
title: string
subtitle: string
external_link: {
href: string
title: string
}
}
type PersonalBenefitsBlock = {
is_visible: boolean
}
type NextLevelBlock = {
title: string
subtitle: string
}
export type Blocks =
| Typename<NextLevelBlock, MyPageBlocksEnum.MyPageBlocksNextLevelBlock>
| Typename<
PersonalBenefitsBlock,
MyPageBlocksEnum.MyPageBlocksPersonalBenefitsBlock
>
| Typename<Shortcuts, MyPageBlocksEnum.MyPageBlocksShortcuts>
export type Breadcrumb = {
href: string
title: string
}
export type Breadcrumbs = {
parents: Breadcrumb[]
title: string
}
export type BenefitPage = {
content: Blocks[]
breadcrumbs: Breadcrumbs
code_defined_route: string
preamble: Preamble
system: {
created_at: string
uid: string
updated_at: string
}
title: string
url: string
}
export type GetBenefitsPageData = {
all_my_page: AllRequestResponse<BenefitPage>
}

View File

@@ -16,3 +16,10 @@ export type BlocksTypename = keyof typeof BlocksTypenameEnum
export type Typename<T, K> = T & {
__typename: K
}
export enum MyPageBlocksEnum {
MyPageBlocksNextLevelBlock = "MyPageBlocksNextLevelBlock",
MyPageBlocksPersonalBenefitsBlock = "MyPageBlocksPersonalBenefitsBlock",
MyPageBlocksShortcuts = "MyPageBlocksShortcuts",
}
export type MyPageBlocksTypename = keyof typeof MyPageBlocksEnum