diff --git a/src/app/(main)/[lang]/[...path]/page.tsx b/src/app/(main)/[lang]/[...path]/page.tsx
index fcf222f5f..628c964e0 100644
--- a/src/app/(main)/[lang]/[...path]/page.tsx
+++ b/src/app/(main)/[lang]/[...path]/page.tsx
@@ -7,6 +7,7 @@ import CustomerCasesPreview from "src/components/customerCases/CustomerCasesPrev
import CustomErrorMessage from "src/components/customErrorMessage/CustomErrorMessage";
import Legal from "src/components/legal/Legal";
import LegalPreview from "src/components/legal/LegalPreview";
+import PageHeader from "src/components/navigation/header/PageHeader";
import { homeLink } from "src/components/utils/linkTypes";
import { getDraftModeInfo } from "src/utils/draftmode";
import { fetchPageDataFromParams } from "src/utils/pageData";
@@ -77,60 +78,68 @@ async function Page({ params }: Props) {
return Page404;
}
- const { queryResponse, docType } = pageData;
+ const { queryResponse, docType, pathTranslations } = pageData;
- switch (docType) {
- case "pageBuilder":
- return (
- <>
- {queryResponse.data?.sections?.map((section, index) => (
-
- ))}
- >
- );
- case "compensations":
- return isDraftMode ? (
-
- ) : (
-
- );
- case "customerCasesPage":
- return isDraftMode ? (
-
- ) : (
-
- );
- case "customerCase":
- return (
- // TODO: implement customer case detail page
-
+ {(() => {
+ switch (docType) {
+ case "pageBuilder":
+ return (
+ <>
+ {queryResponse.data?.sections?.map((section, index) => (
+
+ ))}
+ >
+ );
+ case "compensations":
+ return isDraftMode ? (
+
+ ) : (
+
+ );
+ case "customerCasesPage":
+ return isDraftMode ? (
+
+ ) : (
+
+ );
+ case "customerCase":
+ return (
+ // TODO: implement customer case detail page
+
+ {JSON.stringify(pageData, null, 2)}
+
+ );
+ case "legalDocument":
+ return isDraftMode ? (
+
+ ) : (
+
+ );
+ }
+ return Page404;
+ })()}
+
+ >
+ );
}
export default Page;
diff --git a/src/app/(main)/[lang]/layout.tsx b/src/app/(main)/[lang]/layout.tsx
index fa07aa0cc..f0b4ad3d7 100644
--- a/src/app/(main)/[lang]/layout.tsx
+++ b/src/app/(main)/[lang]/layout.tsx
@@ -3,8 +3,6 @@ import { draftMode } from "next/headers";
import Footer from "src/components/navigation/footer/Footer";
import FooterPreview from "src/components/navigation/footer/FooterPreview";
-import { Header } from "src/components/navigation/header/Header";
-import HeaderPreview from "src/components/navigation/header/HeaderPreview";
import SkipToMain from "src/components/skipToMain/SkipToMain";
import { getDraftModeInfo } from "src/utils/draftmode";
import { BrandAssets } from "studio/lib/interfaces/brandAssets";
@@ -24,8 +22,6 @@ import {
} from "studio/lib/queries/siteSettings";
import { loadStudioQuery } from "studio/lib/store";
-import styles from "./layout.module.css";
-
import "src/styles/global.css";
const fontBrittiSans = localFont({
@@ -73,45 +69,14 @@ export default async function Layout({
]);
const hasNavData = hasValidData(initialNav.data);
- const hasCompanyInfoData = hasValidData(initialCompanyInfo.data);
-
- const hasHeaderData =
- hasNavData && (initialNav.data.main || initialNav.data.sidebar);
const hasFooterData = hasNavData && initialNav.data.footer;
- const hasMenuData = hasCompanyInfoData && (hasHeaderData || hasFooterData);
-
- if (!hasMenuData) {
- return (
-
-
-