fix: breakout current page tsx
This commit is contained in:
53
components/Current/ContentPage/index.tsx
Normal file
53
components/Current/ContentPage/index.tsx
Normal file
@@ -0,0 +1,53 @@
|
||||
import Aside from "@/components/Current/Aside"
|
||||
import Blocks from "@/components/Current/Blocks"
|
||||
import Header from "@/components/Current/Header"
|
||||
import Hero from "@/components/Current/Hero"
|
||||
import Preamble from "@/components/Current/Preamble"
|
||||
import Section from "@/components/Current/Section"
|
||||
import SubnavMobile from "@/components/Current/SubnavMobile"
|
||||
import { Lang } from "@/types/lang"
|
||||
import { GetCurrentBlockPageData } from "@/types/requests/currentBlockPage"
|
||||
|
||||
type ContentPageProps = {
|
||||
data: GetCurrentBlockPageData
|
||||
uri: string
|
||||
lang: Lang
|
||||
}
|
||||
|
||||
export default function ContentPage({ data, lang, uri }: ContentPageProps) {
|
||||
const page = data.all_current_blocks_page.items[0]
|
||||
const images = page.hero?.imagesConnection
|
||||
const breadcrumbs = page.breadcrumbs.parentsConnection
|
||||
const parent = breadcrumbs.edges.at(-1)
|
||||
|
||||
return (
|
||||
<>
|
||||
<Header lang={lang} pathname={uri} />
|
||||
{images?.totalCount ? <Hero images={images.edges} /> : null}
|
||||
<main className="main l-sections-wrapper" id="maincontent" role="main">
|
||||
<input
|
||||
id="lbl-personalized-areas"
|
||||
name="lbl-personalized-areas"
|
||||
type="hidden"
|
||||
value=""
|
||||
/>
|
||||
<SubnavMobile
|
||||
breadcrumbs={breadcrumbs}
|
||||
parent={parent}
|
||||
title={page.breadcrumbs.title}
|
||||
/>
|
||||
<Preamble
|
||||
breadcrumbs={breadcrumbs}
|
||||
breadcrumbParent={parent}
|
||||
breadcrumbTitle={page.breadcrumbs.title}
|
||||
preamble={page.preamble}
|
||||
title={page.title}
|
||||
/>
|
||||
<Section>
|
||||
<Blocks blocks={page.blocks} />
|
||||
<Aside blocks={page.aside} />
|
||||
</Section>
|
||||
</main>
|
||||
</>
|
||||
)
|
||||
}
|
||||
Reference in New Issue
Block a user