From 666e62c85103cf0c673c2c44f415f263eb5c8c7e Mon Sep 17 00:00:00 2001 From: Arvid Norlin Date: Mon, 12 Feb 2024 13:16:05 +0100 Subject: [PATCH] fix: ensure window.datalayer access in client only --- app/[lang]/(live)/layout.tsx | 26 +++++++++++++++++--------- app/[lang]/Tracking.tsx | 29 +++++++++++++++-------------- 2 files changed, 32 insertions(+), 23 deletions(-) diff --git a/app/[lang]/(live)/layout.tsx b/app/[lang]/(live)/layout.tsx index 57bc88523..e2c59e1a8 100644 --- a/app/[lang]/(live)/layout.tsx +++ b/app/[lang]/(live)/layout.tsx @@ -1,13 +1,13 @@ -import "../../core.css"; -import "../../scandic.css"; +import "../../core.css" +import "../../scandic.css" -import Footer from "@/components/Current/Footer"; -import LangPopup from "@/components/Current/LangPopup"; -import Script from "next/script"; -import SkipToMainContent from "@/components/SkipToMainContent"; +import Footer from "@/components/Current/Footer" +import LangPopup from "@/components/Current/LangPopup" +import Script from "next/script" +import SkipToMainContent from "@/components/SkipToMainContent" -import type { Metadata } from "next"; -import type { LangParams, LayoutArgs } from "@/types/params"; +import type { Metadata } from "next" +import type { LangParams, LayoutArgs } from "@/types/params" import { env } from "@/env/server.mjs" export const metadata: Metadata = { description: "New web", @@ -15,6 +15,7 @@ export const metadata: Metadata = { } const adobeSrcs = { + // TODO: decide on naming and environments development: "", test: "https://assets.adobedtm.com/c1bd08b1e4e7/d64a7c1f5f17/launch-84c70d82a50c-staging.min.js", production: @@ -72,7 +73,14 @@ export default function RootLayout({ `} */} {/* TODO: Ensure order (datalayer created before script is executed!) */} + {/* Should this be moved to an app/layout instead? */} + {/* - - ) + return null + // <> + // + // }