diff --git a/app/[lang]/(live)/content-page/page.tsx b/app/[lang]/(live)/content-page/page.tsx
new file mode 100644
index 000000000..bf2443621
--- /dev/null
+++ b/app/[lang]/(live)/content-page/page.tsx
@@ -0,0 +1,3 @@
+export default async function ContentPage() {
+ return null
+}
diff --git a/app/[lang]/(live)/layout.tsx b/app/[lang]/(live)/layout.tsx
index c168eeb3e..58894d379 100644
--- a/app/[lang]/(live)/layout.tsx
+++ b/app/[lang]/(live)/layout.tsx
@@ -1,10 +1,4 @@
-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 type { Metadata } from "next"
import type { LangParams, LayoutArgs } from "@/types/params"
@@ -33,42 +27,10 @@ export default function RootLayout({
id="Cookiebot"
src="https://consent.cookiebot.com/uc.js"
/>
- {/* */}
-
-
-
-
-
- {/* */}
-
-
{children}
-
diff --git a/app/[lang]/(live)/current-content-page/page.tsx b/app/[lang]/(live-current)/current-content-page/page.tsx
similarity index 100%
rename from app/[lang]/(live)/current-content-page/page.tsx
rename to app/[lang]/(live-current)/current-content-page/page.tsx
index de9faf0e1..6fdb41531 100644
--- a/app/[lang]/(live)/current-content-page/page.tsx
+++ b/app/[lang]/(live-current)/current-content-page/page.tsx
@@ -4,10 +4,10 @@ import { request } from "@/lib/request"
import { GetCurrentBlockPage } from "@/lib/graphql/Query/CurrentBlockPage.graphql"
import ContentPage from "@/components/Current/ContentPage"
+import Tracking from "../../Tracking"
import type { PageArgs, LangParams, UriParams } from "@/types/params"
import type { GetCurrentBlockPageData } from "@/types/requests/currentBlockPage"
-import Tracking from "../../Tracking"
export default async function CurrentContentPage({
params,
diff --git a/app/[lang]/(live-current)/layout.tsx b/app/[lang]/(live-current)/layout.tsx
new file mode 100644
index 000000000..529c754fe
--- /dev/null
+++ b/app/[lang]/(live-current)/layout.tsx
@@ -0,0 +1,79 @@
+/* eslint-disable @next/next/no-css-tags */
+
+import Footer from "@/components/Current/Footer"
+import LangPopup from "@/components/Current/LangPopup"
+import Script from "next/script"
+import SkipToMainContent from "@/components/SkipToMainContent"
+import AdobeScript from "../AdobeScript"
+
+import type { Metadata } from "next"
+import type { LangParams, LayoutArgs } from "@/types/params"
+
+export const metadata: Metadata = {
+ description: "New web",
+ title: "Scandic Hotels New Web",
+}
+
+export default function RootLayout({
+ children,
+ params,
+}: React.PropsWithChildren>) {
+ return (
+
+
+
+
+
+
+ {/* */}
+
+
+
+
+
+ {/* */}
+
+
+
+
+
+ {children}
+
+
+
+
+ )
+}
diff --git a/app/[lang]/(live-current)/not-found.tsx b/app/[lang]/(live-current)/not-found.tsx
new file mode 100644
index 000000000..1a6cc1ce6
--- /dev/null
+++ b/app/[lang]/(live-current)/not-found.tsx
@@ -0,0 +1,8 @@
+export default function NotFound() {
+ return (
+
+ Not Found
+ Could not find requested resource
+
+ )
+}
diff --git a/app/[lang]/(preview)/layout.tsx b/app/[lang]/(preview)/layout.tsx
index e7d4ad7bd..6c256d0a2 100644
--- a/app/[lang]/(preview)/layout.tsx
+++ b/app/[lang]/(preview)/layout.tsx
@@ -1,11 +1,3 @@
-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 type { Metadata } from "next"
import type { LangParams, LayoutArgs } from "@/types/params"
import InitLivePreview from "@/components/Current/LivePreview"
@@ -21,34 +13,9 @@ export default function RootLayout({
}: React.PropsWithChildren>) {
return (
-
-
-
-
-
-
-
-
-
{children}
-
)
diff --git a/app/[lang]/(preview)/preview/page.tsx b/app/[lang]/(preview)/preview/page.tsx
index 3040c7b0f..8380c4437 100644
--- a/app/[lang]/(preview)/preview/page.tsx
+++ b/app/[lang]/(preview)/preview/page.tsx
@@ -1,45 +1,3 @@
-import { previewRequest } from "@/lib/previewRequest"
-import { GetCurrentBlockPage } from "@/lib/graphql/Query/CurrentBlockPage.graphql"
-
-import type { PageArgs, LangParams, PreviewParams } from "@/types/params"
-import type { GetCurrentBlockPageData } from "@/types/requests/currentBlockPage"
-import ContentstackLivePreview from "@contentstack/live-preview-utils"
-import LoadingSpinner from "@/components/Current/LoadingSpinner"
-import ContentPage from "@/components/Current/ContentPage"
-
-export default async function CurrentContentPage({
- params,
- searchParams,
-}: PageArgs) {
- try {
- ContentstackLivePreview.setConfigFromParams(searchParams)
-
- if (!searchParams.uri || !searchParams.live_preview) {
- return
- }
-
- const response = await previewRequest(
- GetCurrentBlockPage,
- { locale: params.lang, url: searchParams.uri }
- )
-
- if (!response.data?.all_current_blocks_page?.total) {
- console.log("#### DATA ####")
- console.log(response.data)
- console.log("SearchParams URI: ", searchParams.uri)
- throw new Error("Not found")
- }
-
- return (
-
- )
- } catch (error) {
- // TODO: throw 500
- console.error(error)
- throw new Error("Something went wrong")
- }
+export default async function PreviewPage() {
+ return null
}
diff --git a/app/[lang]/(preview-current)/error.tsx b/app/[lang]/(preview-current)/error.tsx
new file mode 100644
index 000000000..4b2d7bb55
--- /dev/null
+++ b/app/[lang]/(preview-current)/error.tsx
@@ -0,0 +1,9 @@
+"use client"
+
+export default function Error({ error }: { error: Error }) {
+ return (
+
+
Something went wrong!
+
+ )
+}
diff --git a/app/[lang]/(preview-current)/layout.tsx b/app/[lang]/(preview-current)/layout.tsx
new file mode 100644
index 000000000..798188dc3
--- /dev/null
+++ b/app/[lang]/(preview-current)/layout.tsx
@@ -0,0 +1,56 @@
+/* eslint-disable @next/next/no-css-tags */
+
+import Footer from "@/components/Current/Footer";
+import LangPopup from "@/components/Current/LangPopup";
+import Script from "next/script";
+import SkipToMainContent from "@/components/SkipToMainContent";
+import InitLivePreview from "@/components/Current/LivePreview";
+
+import type { Metadata } from "next";
+import type { LangParams, LayoutArgs } from "@/types/params";
+
+export const metadata: Metadata = {
+ description: "New web",
+ title: "Scandic Hotels New Web",
+};
+
+export default function RootLayout({
+ children,
+ params,
+}: React.PropsWithChildren>) {
+ return (
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {children}
+
+
+
+ )
+}
diff --git a/app/[lang]/(preview-current)/not-found.tsx b/app/[lang]/(preview-current)/not-found.tsx
new file mode 100644
index 000000000..1a6cc1ce6
--- /dev/null
+++ b/app/[lang]/(preview-current)/not-found.tsx
@@ -0,0 +1,8 @@
+export default function NotFound() {
+ return (
+
+ Not Found
+ Could not find requested resource
+
+ )
+}
diff --git a/app/[lang]/(preview-current)/preview-current/page.tsx b/app/[lang]/(preview-current)/preview-current/page.tsx
new file mode 100644
index 000000000..3fc234d54
--- /dev/null
+++ b/app/[lang]/(preview-current)/preview-current/page.tsx
@@ -0,0 +1,45 @@
+import { previewRequest } from "@/lib/previewRequest"
+import { GetCurrentBlockPage } from "@/lib/graphql/Query/CurrentBlockPage.graphql"
+
+import type { PageArgs, LangParams, PreviewParams } from "@/types/params"
+import type { GetCurrentBlockPageData } from "@/types/requests/currentBlockPage"
+import ContentstackLivePreview from "@contentstack/live-preview-utils"
+import LoadingSpinner from "@/components/Current/LoadingSpinner"
+import ContentPage from "@/components/Current/ContentPage"
+
+export default async function CurrentPreviewPage({
+ params,
+ searchParams,
+}: PageArgs) {
+ try {
+ ContentstackLivePreview.setConfigFromParams(searchParams)
+
+ if (!searchParams.uri || !searchParams.live_preview) {
+ return
+ }
+
+ const response = await previewRequest(
+ GetCurrentBlockPage,
+ { locale: params.lang, url: searchParams.uri }
+ )
+
+ if (!response.data?.all_current_blocks_page?.total) {
+ console.log("#### DATA ####")
+ console.log(response.data)
+ console.log("SearchParams URI: ", searchParams.uri)
+ throw new Error("Not found")
+ }
+
+ return (
+
+ )
+ } catch (error) {
+ // TODO: throw 500
+ console.error(error)
+ throw new Error("Something went wrong")
+ }
+}
diff --git a/middleware.ts b/middleware.ts
index 5f566bbd3..fba8140ba 100644
--- a/middleware.ts
+++ b/middleware.ts
@@ -39,7 +39,10 @@ export async function middleware(request: NextRequest) {
searchParams.set("uri", pathNameWithoutLocale.replace("/preview", ""))
return NextResponse.rewrite(
- new URL(`/${locale}/preview?${searchParams.toString()}`, request.url)
+ new URL(
+ `/${locale}/preview-current?${searchParams.toString()}`,
+ request.url
+ )
)
}
diff --git a/app/core.css b/public/Static/css/core.css
similarity index 100%
rename from app/core.css
rename to public/Static/css/core.css
diff --git a/app/scandic.css b/public/Static/css/scandic.css
similarity index 100%
rename from app/scandic.css
rename to public/Static/css/scandic.css