fix: remove template

This commit is contained in:
Christel Westerberg
2024-02-12 13:59:57 +01:00
parent 86dd453c85
commit f7abe2c482
4 changed files with 21 additions and 40 deletions

View File

@@ -2,5 +2,5 @@ CMS_ACCESS_TOKEN=""
CMS_API_KEY=""
CMS_ENVIRONMENT="development"
CMS_URL="https://eu-graphql.contentstack.com/stacks/${CMS_API_KEY}?environment=${CMS_ENVIRONMENT}"
CMS_PREVIEW_URL="graphql-preview.contentstack.com/stacks/${CMS_API_KEY}?environment=${CMS_ENVIRONMENT}";
CMS_PREVIEW_URL="https://graphql-preview.contentstack.com/stacks/${CMS_API_KEY}?environment=${CMS_ENVIRONMENT}";
CMS_PREVIEW_TOKEN=""

View File

@@ -19,15 +19,17 @@ export default async function CurrentContentPage({
searchParams,
}: PageArgs<LangParams, UriParams>) {
try {
console.log({ searchParams });
if (!searchParams.uri) {
throw new Error("Bad URI")
}
const response = await request<GetCurrentBlockPageData>(GetCurrentBlockPage, {
locale: params.lang,
url: searchParams.uri,
})
const response = await request<GetCurrentBlockPageData>(
GetCurrentBlockPage,
{
locale: params.lang,
url: searchParams.uri,
}
)
if (!response.data?.all_current_blocks_page?.total) {
console.log("#### DATA ####")
@@ -45,13 +47,18 @@ export default async function CurrentContentPage({
<>
<Header lang={params.lang} pathname={searchParams.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} />
<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}

View File

@@ -1,17 +0,0 @@
import Header from "@/components/Current/Header";
import type { LangParams, PageArgs, UriParams } from "@/types/params";
export default function CurrentContentpageTemplate({ children, params, searchParams }: React.PropsWithChildren<PageArgs<LangParams, UriParams>>) {
// if (!searchParams.uri) {
// throw new Error("Bad URI");
// }
return (
<>
{/* <Header lang={params.lang} pathname={searchParams.uri} /> */}
{children}
</>
);
}

View File

@@ -22,10 +22,6 @@ export default function RootLayout({
return (
<html lang={params.lang}>
<head>
{/* <Script
data-cookieconsent="ignore"
src="/Static/dist/js/head.js?85c84c9e24ae8da3e7af"
/> */}
<Script
data-cookieconsent="ignore"
src="/Static/dist/js/inline.js?00133e5a37de35c51a5d"
@@ -46,11 +42,6 @@ export default function RootLayout({
data-cookieconsent="ignore"
src="/Static/dist/js/ng/main.js?1705409330990"
/>
{/* <Script
data-cookieconsent="ignore"
src="/Static/dist/js/main-ng.js?336b801d6b38eff10884"
strategy="lazyOnload"
/> */}
</head>
<body>
<InitLivePreview />
@@ -60,5 +51,5 @@ export default function RootLayout({
<Footer lang={params.lang} />
</body>
</html>
);
)
}