feat(WEB-112): adjust current-blocks-page to new model
This commit is contained in:
42
components/Current/Aside/Puff/index.tsx
Normal file
42
components/Current/Aside/Puff/index.tsx
Normal file
@@ -0,0 +1,42 @@
|
|||||||
|
import { renderOptions } from "./renderOptions"
|
||||||
|
|
||||||
|
import Image from "@/components/Image"
|
||||||
|
import JsonToHtml from "@/components/JsonToHtml"
|
||||||
|
|
||||||
|
import styles from "./puff.module.css"
|
||||||
|
|
||||||
|
import type { PuffProps } from "@/types/components/current/asides/puff"
|
||||||
|
|
||||||
|
export default function Puff({
|
||||||
|
imageConnection,
|
||||||
|
link,
|
||||||
|
text,
|
||||||
|
title,
|
||||||
|
}: PuffProps) {
|
||||||
|
return (
|
||||||
|
<a className={styles.link} href={link.href}>
|
||||||
|
<article>
|
||||||
|
{imageConnection.edges.map((image) => (
|
||||||
|
<Image
|
||||||
|
alt={image.node.title}
|
||||||
|
className={styles.image}
|
||||||
|
height={image.node.dimension.height}
|
||||||
|
key={image.node.system.uid}
|
||||||
|
src={image.node.url}
|
||||||
|
width={image.node.dimension.width}
|
||||||
|
/>
|
||||||
|
))}
|
||||||
|
<section className={styles.content}>
|
||||||
|
<header>
|
||||||
|
<h3 className={styles.heading}>{title}</h3>
|
||||||
|
</header>
|
||||||
|
<JsonToHtml
|
||||||
|
embeds={[]}
|
||||||
|
nodes={text.json.children}
|
||||||
|
renderOptions={renderOptions}
|
||||||
|
/>
|
||||||
|
</section>
|
||||||
|
</article>
|
||||||
|
</a>
|
||||||
|
)
|
||||||
|
}
|
||||||
@@ -1,74 +0,0 @@
|
|||||||
import { renderOptions } from "./renderOptions"
|
|
||||||
|
|
||||||
import Image from "@/components/Image"
|
|
||||||
import JsonToHtml from "@/components/JsonToHtml"
|
|
||||||
import Link from "next/link"
|
|
||||||
|
|
||||||
import styles from "./puff.module.css"
|
|
||||||
|
|
||||||
import type { PuffProps } from "@/types/components/current/asides/puff"
|
|
||||||
|
|
||||||
export default function Puff({
|
|
||||||
imageConnection,
|
|
||||||
is_internal,
|
|
||||||
link,
|
|
||||||
pageConnection,
|
|
||||||
text,
|
|
||||||
title,
|
|
||||||
}: PuffProps) {
|
|
||||||
if (is_internal) {
|
|
||||||
const page = pageConnection.edges[0]
|
|
||||||
if (!page?.node?.url) {
|
|
||||||
return null
|
|
||||||
}
|
|
||||||
return (
|
|
||||||
<Link className={styles.link} href={`/${page.node.system.locale}${page.node.url}`}>
|
|
||||||
<PuffContent
|
|
||||||
imageConnection={imageConnection}
|
|
||||||
text={text}
|
|
||||||
title={title}
|
|
||||||
/>
|
|
||||||
</Link>
|
|
||||||
)
|
|
||||||
}
|
|
||||||
return (
|
|
||||||
<a className={styles.link} href={link.href} target="_blank">
|
|
||||||
<PuffContent
|
|
||||||
imageConnection={imageConnection}
|
|
||||||
text={text}
|
|
||||||
title={title}
|
|
||||||
/>
|
|
||||||
</a>
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
function PuffContent({
|
|
||||||
imageConnection,
|
|
||||||
text,
|
|
||||||
title,
|
|
||||||
}: Pick<PuffProps, "imageConnection" | "text" | "title">) {
|
|
||||||
return (
|
|
||||||
<article>
|
|
||||||
{imageConnection.edges.map((image) => (
|
|
||||||
<Image
|
|
||||||
alt={image.node.title}
|
|
||||||
className={styles.image}
|
|
||||||
height={image.node.dimension.height}
|
|
||||||
key={image.node.system.uid}
|
|
||||||
src={image.node.url}
|
|
||||||
width={image.node.dimension.width}
|
|
||||||
/>
|
|
||||||
))}
|
|
||||||
<section className={styles.content}>
|
|
||||||
<header>
|
|
||||||
<h3 className={styles.heading}>{title}</h3>
|
|
||||||
</header>
|
|
||||||
<JsonToHtml
|
|
||||||
embeds={text.embedded_itemsConnection.edges}
|
|
||||||
nodes={text.json.children}
|
|
||||||
renderOptions={renderOptions}
|
|
||||||
/>
|
|
||||||
</section>
|
|
||||||
</article>
|
|
||||||
)
|
|
||||||
}
|
|
||||||
@@ -1,16 +0,0 @@
|
|||||||
import Puff from "./Puff"
|
|
||||||
|
|
||||||
import type { PuffsProps } from "@/types/components/current/asides/puffs"
|
|
||||||
|
|
||||||
export default function Puffs({ puffs }: PuffsProps) {
|
|
||||||
if (!puffs.length) {
|
|
||||||
return null
|
|
||||||
}
|
|
||||||
return (
|
|
||||||
<>
|
|
||||||
{puffs.map((puff) => (
|
|
||||||
<Puff key={puff.node.system.uid} {...puff.node} />
|
|
||||||
))}
|
|
||||||
</>
|
|
||||||
)
|
|
||||||
}
|
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
import Puffs from "./Puffs"
|
import Puff from "./Puff"
|
||||||
import Contacts from "./Contacts"
|
import Contacts from "./Contacts"
|
||||||
|
|
||||||
import { AsideTypenameEnum } from "@/types/requests/utils/typename"
|
import { AsideTypenameEnum } from "@/types/requests/utils/typename"
|
||||||
@@ -25,9 +25,9 @@ export default function Aside({ blocks }: AsideProps) {
|
|||||||
)
|
)
|
||||||
case AsideTypenameEnum.CurrentBlocksPageAsidePuff:
|
case AsideTypenameEnum.CurrentBlocksPageAsidePuff:
|
||||||
return (
|
return (
|
||||||
<Puffs
|
<Puff
|
||||||
key={`block-${idx}`}
|
key={`block-${idx}`}
|
||||||
puffs={block.puff.puffConnection.edges}
|
{...block.puff}
|
||||||
/>
|
/>
|
||||||
)
|
)
|
||||||
default:
|
default:
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
import Link from "next/link"
|
|
||||||
import { cva } from "class-variance-authority"
|
import { cva } from "class-variance-authority"
|
||||||
import { BlockListItemsEnum } from "@/types/requests/blocks/list"
|
import { BlockListItemsEnum } from "@/types/requests/blocks/list"
|
||||||
|
|
||||||
@@ -63,27 +62,6 @@ export default function ListItem({ listItem }: { listItem: ListItem }) {
|
|||||||
)}
|
)}
|
||||||
</li>
|
</li>
|
||||||
)
|
)
|
||||||
case BlockListItemsEnum.CurrentBlocksPageBlocksListBlockListItemsListItemInternalLink:
|
|
||||||
const link = listItem.list_item_internal_link.pageConnection.edges[0]
|
|
||||||
const linkUrlWithLocale = `/${link.node.system.locale}${link.node.url}`
|
|
||||||
return (
|
|
||||||
<li
|
|
||||||
key={link.node.system.uid}
|
|
||||||
className={listItemStyle({
|
|
||||||
type: listItem.list_item_internal_link.list_item_style,
|
|
||||||
})}
|
|
||||||
>
|
|
||||||
<Link href={linkUrlWithLocale} className={styles.link}>
|
|
||||||
{listItem.list_item_internal_link.link_text}
|
|
||||||
</Link>
|
|
||||||
{listItem.list_item_internal_link.subtitle && (
|
|
||||||
<span>
|
|
||||||
<br />
|
|
||||||
{listItem.list_item_internal_link.subtitle}
|
|
||||||
</span>
|
|
||||||
)}
|
|
||||||
</li>
|
|
||||||
)
|
|
||||||
|
|
||||||
default:
|
default:
|
||||||
return null
|
return null
|
||||||
|
|||||||
@@ -1,17 +1,18 @@
|
|||||||
import type { ListProps } from "@/types/requests/blocks/list"
|
import ListItem from "./ListItem"
|
||||||
|
|
||||||
import styles from "./list.module.css"
|
import styles from "./list.module.css"
|
||||||
import ListItem from "./ListItem"
|
|
||||||
|
import type { ListProps } from "@/types/requests/blocks/list"
|
||||||
|
|
||||||
export default function List({ list }: ListProps) {
|
export default function List({ list }: ListProps) {
|
||||||
return (
|
return (
|
||||||
<div>
|
<>
|
||||||
{list.title ? <h2 className={styles.title}>{list.title}</h2> : null}
|
{list.title ? <h2 className={styles.title}>{list.title}</h2> : null}
|
||||||
<ul className={styles.ul}>
|
<ul className={styles.ul}>
|
||||||
{list.list_items.map((item, i) => (
|
{list.list_items.map((item, i) => (
|
||||||
<ListItem listItem={item} key={`list-item-${i}`} />
|
<ListItem listItem={item} key={`list-item-${i}`} />
|
||||||
))}
|
))}
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,11 +1,16 @@
|
|||||||
.title {
|
.title {
|
||||||
|
color: #483729;
|
||||||
font-family: BrandonText-Bold, Arial, Helvetica, sans-serif;
|
font-family: BrandonText-Bold, Arial, Helvetica, sans-serif;
|
||||||
font-size: 1.375rem;
|
font-size: 1.375rem;
|
||||||
line-height: 1.1em;
|
|
||||||
text-transform: uppercase;
|
|
||||||
font-weight: 400;
|
font-weight: 400;
|
||||||
color: #483729;
|
line-height: 1.1em;
|
||||||
margin-bottom: 1rem;
|
margin-bottom: 1rem;
|
||||||
|
margin-top: 2rem;
|
||||||
|
text-transform: uppercase;
|
||||||
|
}
|
||||||
|
|
||||||
|
.title:first-child {
|
||||||
|
margin-top: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.ul {
|
.ul {
|
||||||
@@ -64,4 +69,4 @@
|
|||||||
.title {
|
.title {
|
||||||
font-size: 1.625rem;
|
font-size: 1.625rem;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -12,8 +12,8 @@ import type { ContentPageProps } from "@/types/components/current/contentPage"
|
|||||||
export default function ContentPage({ data }: ContentPageProps) {
|
export default function ContentPage({ data }: ContentPageProps) {
|
||||||
const page = data.all_current_blocks_page.items[0]
|
const page = data.all_current_blocks_page.items[0]
|
||||||
const images = page.hero?.imagesConnection
|
const images = page.hero?.imagesConnection
|
||||||
const breadcrumbs = page.breadcrumbs.parentsConnection
|
const breadcrumbs = page.breadcrumbs.parents
|
||||||
const parent = breadcrumbs.edges.at(-1)
|
const parent = breadcrumbs.at(-1)
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
|
|||||||
@@ -2,7 +2,6 @@
|
|||||||
import { useState } from "react"
|
import { useState } from "react"
|
||||||
|
|
||||||
import Image from "@/components/Image"
|
import Image from "@/components/Image"
|
||||||
import Link from "next/link"
|
|
||||||
// import Mobile from "../LanguageSwitcher/Mobile"
|
// import Mobile from "../LanguageSwitcher/Mobile"
|
||||||
|
|
||||||
import styles from "./mainMenu.module.css"
|
import styles from "./mainMenu.module.css"
|
||||||
@@ -40,7 +39,7 @@ export default function MainMenu({ frontpageLinkText, homeHref, links, logo, top
|
|||||||
<span className={styles.hiddenAccessible}>Menu</span>
|
<span className={styles.hiddenAccessible}>Menu</span>
|
||||||
</button>
|
</button>
|
||||||
|
|
||||||
<Link
|
<a
|
||||||
className={styles.logoLink}
|
className={styles.logoLink}
|
||||||
href={homeHref}
|
href={homeHref}
|
||||||
id="scandic-logo"
|
id="scandic-logo"
|
||||||
@@ -59,7 +58,7 @@ export default function MainMenu({ frontpageLinkText, homeHref, links, logo, top
|
|||||||
src={logo.url}
|
src={logo.url}
|
||||||
width={logo.dimension.width}
|
width={logo.dimension.width}
|
||||||
/>
|
/>
|
||||||
</Link>
|
</a>
|
||||||
|
|
||||||
<nav>
|
<nav>
|
||||||
<ul
|
<ul
|
||||||
@@ -67,26 +66,26 @@ export default function MainMenu({ frontpageLinkText, homeHref, links, logo, top
|
|||||||
data-collapsable="main-menu"
|
data-collapsable="main-menu"
|
||||||
id="main-menu"
|
id="main-menu"
|
||||||
>
|
>
|
||||||
{links.map(({ link }) => (
|
{links.map(link => (
|
||||||
<li
|
<li
|
||||||
className={styles.li}
|
className={styles.li}
|
||||||
key={link.href}
|
key={link.href}
|
||||||
>
|
>
|
||||||
<Link
|
<a
|
||||||
className={styles.link}
|
className={styles.link}
|
||||||
href={link.href}
|
href={link.href}
|
||||||
>
|
>
|
||||||
{link.title}
|
{link.title}
|
||||||
</Link>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
))}
|
))}
|
||||||
|
|
||||||
<ul className={styles.mobileList}>
|
<ul className={styles.mobileList}>
|
||||||
{topMenuMobileLinks.map(({ link }) => (
|
{topMenuMobileLinks.map(({ link }) => (
|
||||||
<li className={styles.mobileLi} key={link.href}>
|
<li className={styles.mobileLi} key={link.href}>
|
||||||
<Link className={styles.mobileLink} href={link.href}>
|
<a className={styles.mobileLink} href={link.href}>
|
||||||
{link.title}
|
{link.title}
|
||||||
</Link>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
))}
|
))}
|
||||||
</ul>
|
</ul>
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
// import Desktop from "../LanguageSwitcher/Desktop"
|
// import Desktop from "../LanguageSwitcher/Desktop"
|
||||||
import Link from "next/link"
|
|
||||||
|
|
||||||
import styles from "./topMenu.module.css"
|
import styles from "./topMenu.module.css"
|
||||||
|
|
||||||
@@ -13,12 +12,12 @@ export default function TopMenu({ frontpageLinkText, homeHref, links }: TopMenuP
|
|||||||
return (
|
return (
|
||||||
<div className={styles.topMenu}>
|
<div className={styles.topMenu}>
|
||||||
<div className={styles.container}>
|
<div className={styles.container}>
|
||||||
<Link
|
<a
|
||||||
className={styles.homeLink}
|
className={styles.homeLink}
|
||||||
href={homeHref}
|
href={homeHref}
|
||||||
>
|
>
|
||||||
{frontpageLinkText}
|
{frontpageLinkText}
|
||||||
</Link>
|
</a>
|
||||||
|
|
||||||
<ul className={styles.list}>
|
<ul className={styles.list}>
|
||||||
{/* <li className="nav-secondary__item hidden-xxsmall hidden-xsmall hidden-small">
|
{/* <li className="nav-secondary__item hidden-xxsmall hidden-xsmall hidden-small">
|
||||||
@@ -26,12 +25,12 @@ export default function TopMenu({ frontpageLinkText, homeHref, links }: TopMenuP
|
|||||||
</li> */}
|
</li> */}
|
||||||
{links.map(({ link }) => (
|
{links.map(({ link }) => (
|
||||||
<li key={link.href}>
|
<li key={link.href}>
|
||||||
<Link
|
<a
|
||||||
className={styles.link}
|
className={styles.link}
|
||||||
href={link.href}
|
href={link.href}
|
||||||
>
|
>
|
||||||
{link.title}
|
{link.title}
|
||||||
</Link>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
))}
|
))}
|
||||||
</ul>
|
</ul>
|
||||||
|
|||||||
@@ -1,5 +1,3 @@
|
|||||||
import Link from "next/link"
|
|
||||||
|
|
||||||
import styles from "./breadcrumbs.module.css"
|
import styles from "./breadcrumbs.module.css"
|
||||||
|
|
||||||
import type { BreadcrumbsProps } from "@/types/components/current/breadcrumbs"
|
import type { BreadcrumbsProps } from "@/types/components/current/breadcrumbs"
|
||||||
@@ -14,20 +12,20 @@ export default function Breadcrumbs({
|
|||||||
<ul className={styles.list}>
|
<ul className={styles.list}>
|
||||||
{parent ? (
|
{parent ? (
|
||||||
<li className={styles.parent}>
|
<li className={styles.parent}>
|
||||||
<Link href={`/${parent.node.system.locale}${parent.node.url}`}>
|
<a href={parent.href}>
|
||||||
{parent.node.breadcrumbs?.title ?? parent.node.title}
|
{parent.title}
|
||||||
</Link>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
) : null}
|
) : null}
|
||||||
{breadcrumbs.edges.map((breadcrumb) => (
|
{breadcrumbs.map((breadcrumb) => (
|
||||||
<li
|
<li
|
||||||
className={styles.li}
|
className={styles.li}
|
||||||
itemProp="breadcrumb"
|
itemProp="breadcrumb"
|
||||||
key={breadcrumb.node.title}
|
key={breadcrumb.href}
|
||||||
>
|
>
|
||||||
<Link className={styles.link} href={`/${breadcrumb.node.system.locale}${breadcrumb.node.url}`}>
|
<a className={styles.link} href={breadcrumb.href}>
|
||||||
{breadcrumb.node.breadcrumbs?.title ?? breadcrumb.node.title}
|
{breadcrumb.title}
|
||||||
</Link>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
))}
|
))}
|
||||||
<li className={styles.currentPage}>
|
<li className={styles.currentPage}>
|
||||||
|
|||||||
@@ -1,5 +1,3 @@
|
|||||||
import Link from "next/link"
|
|
||||||
|
|
||||||
import type { SubnavMobileProps } from "@/types/components/current/subnavMobile"
|
import type { SubnavMobileProps } from "@/types/components/current/subnavMobile"
|
||||||
|
|
||||||
export default async function SubnavMobile({
|
export default async function SubnavMobile({
|
||||||
@@ -13,16 +11,16 @@ export default async function SubnavMobile({
|
|||||||
<ul className="breadcrumb-list hidden-small hidden-medium hidden-large">
|
<ul className="breadcrumb-list hidden-small hidden-medium hidden-large">
|
||||||
{parent ? (
|
{parent ? (
|
||||||
<li className="breadcrumb-list__parent hidden-medium hidden-large">
|
<li className="breadcrumb-list__parent hidden-medium hidden-large">
|
||||||
<Link href={`/${parent.node.system.locale}${parent.node.url}`}>
|
<a href={parent.href}>
|
||||||
{parent.node.breadcrumbs?.title ?? parent.node.title}
|
{parent.title}
|
||||||
</Link>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
) : null}
|
) : null}
|
||||||
{breadcrumbs.edges.map((breadcrumb) => (
|
{breadcrumbs.map((breadcrumb) => (
|
||||||
<li className="breadcrumb-list__body" key={breadcrumb.node.url}>
|
<li className="breadcrumb-list__body" key={breadcrumb.href}>
|
||||||
<Link href={`/${breadcrumb.node.system.locale}${breadcrumb.node.url}`}>
|
<a href={breadcrumb.href}>
|
||||||
{breadcrumb.node.breadcrumbs?.title ?? breadcrumb.node.title}
|
{breadcrumb.title}
|
||||||
</Link>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
))}
|
))}
|
||||||
<li className="breadcrumb-list__body">
|
<li className="breadcrumb-list__body">
|
||||||
|
|||||||
@@ -2,13 +2,6 @@
|
|||||||
|
|
||||||
fragment PuffAside on CurrentBlocksPageAsidePuff {
|
fragment PuffAside on CurrentBlocksPageAsidePuff {
|
||||||
puff {
|
puff {
|
||||||
puffConnection {
|
...Puff
|
||||||
totalCount
|
|
||||||
edges {
|
|
||||||
node {
|
|
||||||
...Puff
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,3 @@
|
|||||||
#import "../PageLinks.graphql"
|
|
||||||
|
|
||||||
fragment ListItem on CurrentBlocksPageBlocksListBlockListItemsListItem {
|
fragment ListItem on CurrentBlocksPageBlocksListBlockListItemsListItem {
|
||||||
list_item {
|
list_item {
|
||||||
list_item_style
|
list_item_style
|
||||||
@@ -19,30 +17,12 @@ fragment ListItemExternalLink on CurrentBlocksPageBlocksListBlockListItemsListIt
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fragment ListItemInternalLink on CurrentBlocksPageBlocksListBlockListItemsListItemInternalLink {
|
|
||||||
list_item_internal_link {
|
|
||||||
link_text
|
|
||||||
list_item_style
|
|
||||||
subtitle
|
|
||||||
pageConnection {
|
|
||||||
totalCount
|
|
||||||
edges {
|
|
||||||
node {
|
|
||||||
__typename
|
|
||||||
...CurrentBlocksPageLink
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
fragment ListBlock on CurrentBlocksPageBlocksList {
|
fragment ListBlock on CurrentBlocksPageBlocksList {
|
||||||
list {
|
list {
|
||||||
list_items {
|
list_items {
|
||||||
__typename
|
__typename
|
||||||
...ListItem
|
...ListItem
|
||||||
...ListItemExternalLink
|
...ListItemExternalLink
|
||||||
...ListItemInternalLink
|
|
||||||
}
|
}
|
||||||
title
|
title
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,11 +2,9 @@
|
|||||||
|
|
||||||
fragment PuffBlock on CurrentBlocksPageBlocksPuffs {
|
fragment PuffBlock on CurrentBlocksPageBlocksPuffs {
|
||||||
puffs {
|
puffs {
|
||||||
# We have to manually add a limit since Contentstack handles its complexity calculation in a certain way
|
puffs {
|
||||||
puffsConnection(limit: 9) {
|
... on CurrentBlocksPageBlocksPuffsBlockPuffsPuff {
|
||||||
totalCount
|
puff {
|
||||||
edges {
|
|
||||||
node {
|
|
||||||
...Puff
|
...Puff
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
#import "../Image.graphql"
|
#import "../Image.graphql"
|
||||||
#import "../PageLinks.graphql"
|
|
||||||
|
|
||||||
fragment TextBlock on CurrentBlocksPageBlocksText {
|
fragment TextBlock on CurrentBlocksPageBlocksText {
|
||||||
text {
|
text {
|
||||||
@@ -9,7 +8,6 @@ fragment TextBlock on CurrentBlocksPageBlocksText {
|
|||||||
edges {
|
edges {
|
||||||
node {
|
node {
|
||||||
__typename
|
__typename
|
||||||
...CurrentBlocksPageLink
|
|
||||||
...Image
|
...Image
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,19 +1,9 @@
|
|||||||
#import "./PageLinks.graphql"
|
|
||||||
|
|
||||||
fragment Breadcrumbs on CurrentBlocksPage {
|
fragment Breadcrumbs on CurrentBlocksPage {
|
||||||
breadcrumbs {
|
breadcrumbs {
|
||||||
title
|
parents {
|
||||||
parentsConnection {
|
href
|
||||||
edges {
|
title
|
||||||
node {
|
|
||||||
... on CurrentBlocksPage {
|
|
||||||
breadcrumbs {
|
|
||||||
title
|
|
||||||
}
|
|
||||||
...CurrentBlocksPageLink
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
title
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
#import "./Image.graphql"
|
#import "./Image.graphql"
|
||||||
#import "./PageLinks.graphql"
|
|
||||||
|
|
||||||
fragment Hero on Hero {
|
fragment Hero on Hero {
|
||||||
imagesConnection {
|
imagesConnection {
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
#import "./Image.graphql"
|
#import "./Image.graphql"
|
||||||
#import "./PageLinks.graphql"
|
|
||||||
|
|
||||||
fragment Preamble on CurrentBlocksPage {
|
fragment Preamble on CurrentBlocksPage {
|
||||||
preamble {
|
preamble {
|
||||||
@@ -9,7 +8,6 @@ fragment Preamble on CurrentBlocksPage {
|
|||||||
edges {
|
edges {
|
||||||
node {
|
node {
|
||||||
__typename
|
__typename
|
||||||
...CurrentBlocksPageLink
|
|
||||||
...Image
|
...Image
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
#import "./Image.graphql"
|
#import "./Image.graphql"
|
||||||
#import "./PageLinks.graphql"
|
|
||||||
|
|
||||||
fragment Puff on Puff {
|
fragment Puff on Puff {
|
||||||
imageConnection {
|
imageConnection {
|
||||||
@@ -9,33 +8,12 @@ fragment Puff on Puff {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
is_internal
|
|
||||||
link {
|
link {
|
||||||
href
|
href
|
||||||
title
|
title
|
||||||
}
|
}
|
||||||
pageConnection {
|
|
||||||
edges {
|
|
||||||
node {
|
|
||||||
__typename
|
|
||||||
...CurrentBlocksPageLink
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
system {
|
|
||||||
uid
|
|
||||||
}
|
|
||||||
text {
|
text {
|
||||||
json
|
json
|
||||||
embedded_itemsConnection {
|
|
||||||
totalCount
|
|
||||||
edges {
|
|
||||||
node {
|
|
||||||
__typename
|
|
||||||
...Image
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
title
|
title
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -27,13 +27,13 @@ query GetCurrentBlockPage($locale: String!, $url: String!) {
|
|||||||
...Hero
|
...Hero
|
||||||
}
|
}
|
||||||
...Preamble
|
...Preamble
|
||||||
title
|
|
||||||
url
|
|
||||||
system {
|
system {
|
||||||
uid
|
|
||||||
created_at
|
created_at
|
||||||
|
uid
|
||||||
updated_at
|
updated_at
|
||||||
}
|
}
|
||||||
|
title
|
||||||
|
url
|
||||||
}
|
}
|
||||||
total
|
total
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,8 +1,7 @@
|
|||||||
import type { Breadcrumb } from "@/types/requests/currentBlockPage"
|
import type { Breadcrumb } from "@/types/requests/currentBlockPage"
|
||||||
import type { Edges, Node } from "@/types/requests/utils/edges"
|
|
||||||
|
|
||||||
export type BreadcrumbsProps = {
|
export type BreadcrumbsProps = {
|
||||||
breadcrumbs: Edges<Breadcrumb>
|
breadcrumbs: Breadcrumb[]
|
||||||
parent?: Node<Breadcrumb>
|
parent?: Breadcrumb
|
||||||
title: string
|
title: string
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,8 +1,7 @@
|
|||||||
import type { Breadcrumb } from "@/types/requests/currentBlockPage"
|
import type { Breadcrumb } from "@/types/requests/currentBlockPage"
|
||||||
import type { Edges, Node } from "@/types/requests/utils/edges"
|
|
||||||
|
|
||||||
export type SubnavMobileProps = {
|
export type SubnavMobileProps = {
|
||||||
breadcrumbs: Edges<Breadcrumb>
|
breadcrumbs: Breadcrumb[]
|
||||||
parent?: Node<Breadcrumb>
|
parent?: Breadcrumb
|
||||||
title: string
|
title: string
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,8 +1,5 @@
|
|||||||
import type { Puff } from "../puff"
|
import type { Puff } from "../puff"
|
||||||
import type { Edges } from "../utils/edges"
|
|
||||||
|
|
||||||
export type PuffAside = {
|
export type PuffAside = {
|
||||||
puff: {
|
puff: Puff
|
||||||
puffConnection: Edges<Puff>
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,3 @@
|
|||||||
import type { Edges } from "../utils/edges"
|
|
||||||
import type { PageLink } from "../utils/pageLink"
|
|
||||||
import type { Typename } from "../utils/typename"
|
import type { Typename } from "../utils/typename"
|
||||||
|
|
||||||
enum ListItemStyleEnum {
|
enum ListItemStyleEnum {
|
||||||
@@ -12,7 +10,6 @@ type ListItemStyle = keyof typeof ListItemStyleEnum
|
|||||||
export enum BlockListItemsEnum {
|
export enum BlockListItemsEnum {
|
||||||
CurrentBlocksPageBlocksListBlockListItemsListItem = "CurrentBlocksPageBlocksListBlockListItemsListItem",
|
CurrentBlocksPageBlocksListBlockListItemsListItem = "CurrentBlocksPageBlocksListBlockListItemsListItem",
|
||||||
CurrentBlocksPageBlocksListBlockListItemsListItemExternalLink = "CurrentBlocksPageBlocksListBlockListItemsListItemExternalLink",
|
CurrentBlocksPageBlocksListBlockListItemsListItemExternalLink = "CurrentBlocksPageBlocksListBlockListItemsListItemExternalLink",
|
||||||
CurrentBlocksPageBlocksListBlockListItemsListItemInternalLink = "CurrentBlocksPageBlocksListBlockListItemsListItemInternalLink",
|
|
||||||
}
|
}
|
||||||
|
|
||||||
type ExternalLinkListItem = Typename<
|
type ExternalLinkListItem = Typename<
|
||||||
@@ -29,18 +26,6 @@ type ExternalLinkListItem = Typename<
|
|||||||
BlockListItemsEnum.CurrentBlocksPageBlocksListBlockListItemsListItemExternalLink
|
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<
|
type RegularListItem = Typename<
|
||||||
{
|
{
|
||||||
list_item: {
|
list_item: {
|
||||||
@@ -54,7 +39,6 @@ type RegularListItem = Typename<
|
|||||||
|
|
||||||
export type ListItem =
|
export type ListItem =
|
||||||
| ExternalLinkListItem
|
| ExternalLinkListItem
|
||||||
| InternalLinkListItem
|
|
||||||
| RegularListItem
|
| RegularListItem
|
||||||
|
|
||||||
export type List = {
|
export type List = {
|
||||||
|
|||||||
@@ -1,8 +1,9 @@
|
|||||||
import type { Edges } from "../utils/edges"
|
|
||||||
import type { Puff } from "../puff"
|
import type { Puff } from "../puff"
|
||||||
|
|
||||||
export type PuffBlock = {
|
export type PuffBlock = {
|
||||||
puffs: {
|
puffs: {
|
||||||
puffsConnection: Edges<Puff>
|
puffs: {
|
||||||
|
puff: Puff
|
||||||
|
}[]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -13,8 +13,6 @@ import type {
|
|||||||
Typename,
|
Typename,
|
||||||
PagesTypenameEnum,
|
PagesTypenameEnum,
|
||||||
} from "./utils/typename"
|
} from "./utils/typename"
|
||||||
import type { EmbedEnum } from "./utils/embeds"
|
|
||||||
import type { Edges } from "./utils/edges"
|
|
||||||
|
|
||||||
export type Asides =
|
export type Asides =
|
||||||
| Typename<Contact, AsideTypenameEnum.CurrentBlocksPageAsideContact>
|
| Typename<Contact, AsideTypenameEnum.CurrentBlocksPageAsideContact>
|
||||||
@@ -25,26 +23,13 @@ export type Blocks =
|
|||||||
| Typename<PuffBlock, BlocksTypenameEnum.CurrentBlocksPageBlocksPuffs>
|
| Typename<PuffBlock, BlocksTypenameEnum.CurrentBlocksPageBlocksPuffs>
|
||||||
| Typename<Text, BlocksTypenameEnum.CurrentBlocksPageBlocksText>
|
| Typename<Text, BlocksTypenameEnum.CurrentBlocksPageBlocksText>
|
||||||
|
|
||||||
interface SharedBreadcrumb {
|
export type Breadcrumb = {
|
||||||
breadcrumbs: {
|
href: string
|
||||||
title?: string
|
|
||||||
} | null
|
|
||||||
system: {
|
|
||||||
locale: string
|
|
||||||
uid: string
|
|
||||||
}
|
|
||||||
title: string
|
title: string
|
||||||
url: string
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface CurrentBlocksPageBreadcrumb extends SharedBreadcrumb {
|
|
||||||
__typename: EmbedEnum.CurrentBlocksPage
|
|
||||||
}
|
|
||||||
|
|
||||||
export type Breadcrumb = CurrentBlocksPageBreadcrumb
|
|
||||||
|
|
||||||
export type Breadcrumbs = {
|
export type Breadcrumbs = {
|
||||||
parentsConnection: Edges<Breadcrumb>
|
parents: Breadcrumb[]
|
||||||
title: string
|
title: string
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -55,13 +40,13 @@ export type BlockPage = {
|
|||||||
breadcrumbs: Breadcrumbs
|
breadcrumbs: Breadcrumbs
|
||||||
hero: Hero
|
hero: Hero
|
||||||
preamble: Preamble
|
preamble: Preamble
|
||||||
title: string
|
|
||||||
url: string
|
|
||||||
system: {
|
system: {
|
||||||
uid: string
|
|
||||||
created_at: string
|
created_at: string
|
||||||
|
uid: string
|
||||||
updated_at: string
|
updated_at: string
|
||||||
}
|
}
|
||||||
|
title: string
|
||||||
|
url: string
|
||||||
}
|
}
|
||||||
|
|
||||||
export type GetCurrentBlockPageData = {
|
export type GetCurrentBlockPageData = {
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
import type { SysAsset } from "./utils/asset"
|
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"
|
import type { Image } from "../image"
|
||||||
|
|
||||||
export type HeaderLink = {
|
export type HeaderLink = {
|
||||||
link: {
|
href: string
|
||||||
href: string
|
title: string
|
||||||
title: string
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export type TopMenuHeaderLink = {
|
export type TopMenuHeaderLink = {
|
||||||
|
|||||||
@@ -1,22 +1,14 @@
|
|||||||
import type { Image } from "../image"
|
import type { Image } from "../image"
|
||||||
import type { Edges } from "./utils/edges"
|
import type { Edges } from "./utils/edges"
|
||||||
import type { Embeds } from "./embeds"
|
|
||||||
import type { PageLink } from "./utils/pageLink"
|
|
||||||
import type { RTEDocument } from "../rte/node"
|
import type { RTEDocument } from "../rte/node"
|
||||||
|
|
||||||
export type Puff = {
|
export type Puff = {
|
||||||
imageConnection: Edges<Image>
|
imageConnection: Edges<Image>
|
||||||
is_internal: boolean
|
|
||||||
link: {
|
link: {
|
||||||
href: string
|
href: string
|
||||||
title: string
|
title: string
|
||||||
}
|
}
|
||||||
pageConnection: Edges<PageLink>
|
|
||||||
system: {
|
|
||||||
uid: string
|
|
||||||
}
|
|
||||||
text: {
|
text: {
|
||||||
embedded_itemsConnection: Edges<Embeds>
|
|
||||||
json: RTEDocument
|
json: RTEDocument
|
||||||
}
|
}
|
||||||
title: string
|
title: string
|
||||||
|
|||||||
@@ -7,7 +7,6 @@ export type AsideTypename = keyof typeof AsideTypenameEnum
|
|||||||
|
|
||||||
export enum BlocksTypenameEnum {
|
export enum BlocksTypenameEnum {
|
||||||
CurrentBlocksPageBlocksList = "CurrentBlocksPageBlocksList",
|
CurrentBlocksPageBlocksList = "CurrentBlocksPageBlocksList",
|
||||||
CurrentBlocksPageBlocksPreamble = "CurrentBlocksPageBlocksPreamble",
|
|
||||||
CurrentBlocksPageBlocksPuffs = "CurrentBlocksPageBlocksPuffs",
|
CurrentBlocksPageBlocksPuffs = "CurrentBlocksPageBlocksPuffs",
|
||||||
CurrentBlocksPageBlocksText = "CurrentBlocksPageBlocksText",
|
CurrentBlocksPageBlocksText = "CurrentBlocksPageBlocksText",
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user