feat(WEB-112): adjust current-blocks-page to new model
This commit is contained in:
@@ -1,8 +1,7 @@
|
||||
import type { Breadcrumb } from "@/types/requests/currentBlockPage"
|
||||
import type { Edges, Node } from "@/types/requests/utils/edges"
|
||||
|
||||
export type BreadcrumbsProps = {
|
||||
breadcrumbs: Edges<Breadcrumb>
|
||||
parent?: Node<Breadcrumb>
|
||||
breadcrumbs: Breadcrumb[]
|
||||
parent?: Breadcrumb
|
||||
title: string
|
||||
}
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
import type { Breadcrumb } from "@/types/requests/currentBlockPage"
|
||||
import type { Edges, Node } from "@/types/requests/utils/edges"
|
||||
|
||||
export type SubnavMobileProps = {
|
||||
breadcrumbs: Edges<Breadcrumb>
|
||||
parent?: Node<Breadcrumb>
|
||||
breadcrumbs: Breadcrumb[]
|
||||
parent?: Breadcrumb
|
||||
title: string
|
||||
}
|
||||
|
||||
@@ -1,8 +1,5 @@
|
||||
import type { Puff } from "../puff"
|
||||
import type { Edges } from "../utils/edges"
|
||||
|
||||
export type PuffAside = {
|
||||
puff: {
|
||||
puffConnection: Edges<Puff>
|
||||
}
|
||||
puff: Puff
|
||||
}
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
import type { Edges } from "../utils/edges"
|
||||
import type { PageLink } from "../utils/pageLink"
|
||||
import type { Typename } from "../utils/typename"
|
||||
|
||||
enum ListItemStyleEnum {
|
||||
@@ -12,7 +10,6 @@ type ListItemStyle = keyof typeof ListItemStyleEnum
|
||||
export enum BlockListItemsEnum {
|
||||
CurrentBlocksPageBlocksListBlockListItemsListItem = "CurrentBlocksPageBlocksListBlockListItemsListItem",
|
||||
CurrentBlocksPageBlocksListBlockListItemsListItemExternalLink = "CurrentBlocksPageBlocksListBlockListItemsListItemExternalLink",
|
||||
CurrentBlocksPageBlocksListBlockListItemsListItemInternalLink = "CurrentBlocksPageBlocksListBlockListItemsListItemInternalLink",
|
||||
}
|
||||
|
||||
type ExternalLinkListItem = Typename<
|
||||
@@ -29,18 +26,6 @@ type ExternalLinkListItem = Typename<
|
||||
BlockListItemsEnum.CurrentBlocksPageBlocksListBlockListItemsListItemExternalLink
|
||||
>
|
||||
|
||||
type InternalLinkListItem = Typename<
|
||||
{
|
||||
list_item_internal_link: {
|
||||
link_text?: string
|
||||
list_item_style: ListItemStyle
|
||||
subtitle?: string
|
||||
pageConnection: Edges<PageLink>
|
||||
}
|
||||
},
|
||||
BlockListItemsEnum.CurrentBlocksPageBlocksListBlockListItemsListItemInternalLink
|
||||
>
|
||||
|
||||
type RegularListItem = Typename<
|
||||
{
|
||||
list_item: {
|
||||
@@ -54,7 +39,6 @@ type RegularListItem = Typename<
|
||||
|
||||
export type ListItem =
|
||||
| ExternalLinkListItem
|
||||
| InternalLinkListItem
|
||||
| RegularListItem
|
||||
|
||||
export type List = {
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
import type { Edges } from "../utils/edges"
|
||||
import type { Puff } from "../puff"
|
||||
|
||||
export type PuffBlock = {
|
||||
puffs: {
|
||||
puffsConnection: Edges<Puff>
|
||||
puffs: {
|
||||
puff: Puff
|
||||
}[]
|
||||
}
|
||||
}
|
||||
|
||||
@@ -13,8 +13,6 @@ import type {
|
||||
Typename,
|
||||
PagesTypenameEnum,
|
||||
} from "./utils/typename"
|
||||
import type { EmbedEnum } from "./utils/embeds"
|
||||
import type { Edges } from "./utils/edges"
|
||||
|
||||
export type Asides =
|
||||
| Typename<Contact, AsideTypenameEnum.CurrentBlocksPageAsideContact>
|
||||
@@ -25,26 +23,13 @@ export type Blocks =
|
||||
| Typename<PuffBlock, BlocksTypenameEnum.CurrentBlocksPageBlocksPuffs>
|
||||
| Typename<Text, BlocksTypenameEnum.CurrentBlocksPageBlocksText>
|
||||
|
||||
interface SharedBreadcrumb {
|
||||
breadcrumbs: {
|
||||
title?: string
|
||||
} | null
|
||||
system: {
|
||||
locale: string
|
||||
uid: string
|
||||
}
|
||||
export type Breadcrumb = {
|
||||
href: string
|
||||
title: string
|
||||
url: string
|
||||
}
|
||||
|
||||
export interface CurrentBlocksPageBreadcrumb extends SharedBreadcrumb {
|
||||
__typename: EmbedEnum.CurrentBlocksPage
|
||||
}
|
||||
|
||||
export type Breadcrumb = CurrentBlocksPageBreadcrumb
|
||||
|
||||
export type Breadcrumbs = {
|
||||
parentsConnection: Edges<Breadcrumb>
|
||||
parents: Breadcrumb[]
|
||||
title: string
|
||||
}
|
||||
|
||||
@@ -55,13 +40,13 @@ export type BlockPage = {
|
||||
breadcrumbs: Breadcrumbs
|
||||
hero: Hero
|
||||
preamble: Preamble
|
||||
title: string
|
||||
url: string
|
||||
system: {
|
||||
uid: string
|
||||
created_at: string
|
||||
uid: string
|
||||
updated_at: string
|
||||
}
|
||||
title: string
|
||||
url: string
|
||||
}
|
||||
|
||||
export type GetCurrentBlockPageData = {
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
import type { SysAsset } from "./utils/asset"
|
||||
import type { PageLinkType } from "./utils/pageLink"
|
||||
|
||||
export type Embeds = PageLinkType | SysAsset
|
||||
export type Embeds = SysAsset
|
||||
|
||||
@@ -2,10 +2,8 @@ import type { Edges } from "./utils/edges"
|
||||
import type { Image } from "../image"
|
||||
|
||||
export type HeaderLink = {
|
||||
link: {
|
||||
href: string
|
||||
title: string
|
||||
}
|
||||
href: string
|
||||
title: string
|
||||
}
|
||||
|
||||
export type TopMenuHeaderLink = {
|
||||
|
||||
@@ -1,22 +1,14 @@
|
||||
import type { Image } from "../image"
|
||||
import type { Edges } from "./utils/edges"
|
||||
import type { Embeds } from "./embeds"
|
||||
import type { PageLink } from "./utils/pageLink"
|
||||
import type { RTEDocument } from "../rte/node"
|
||||
|
||||
export type Puff = {
|
||||
imageConnection: Edges<Image>
|
||||
is_internal: boolean
|
||||
link: {
|
||||
href: string
|
||||
title: string
|
||||
}
|
||||
pageConnection: Edges<PageLink>
|
||||
system: {
|
||||
uid: string
|
||||
}
|
||||
text: {
|
||||
embedded_itemsConnection: Edges<Embeds>
|
||||
json: RTEDocument
|
||||
}
|
||||
title: string
|
||||
|
||||
@@ -7,7 +7,6 @@ export type AsideTypename = keyof typeof AsideTypenameEnum
|
||||
|
||||
export enum BlocksTypenameEnum {
|
||||
CurrentBlocksPageBlocksList = "CurrentBlocksPageBlocksList",
|
||||
CurrentBlocksPageBlocksPreamble = "CurrentBlocksPageBlocksPreamble",
|
||||
CurrentBlocksPageBlocksPuffs = "CurrentBlocksPageBlocksPuffs",
|
||||
CurrentBlocksPageBlocksText = "CurrentBlocksPageBlocksText",
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user