diff --git a/app/[lang]/(live)/(public)/hotelreservation/layout.module.css b/app/[lang]/(live)/(public)/hotelreservation/layout.module.css new file mode 100644 index 000000000..8f162ce84 --- /dev/null +++ b/app/[lang]/(live)/(public)/hotelreservation/layout.module.css @@ -0,0 +1,3 @@ +.layout { + height: 100vh; +} diff --git a/app/[lang]/(live)/(public)/hotelreservation/layout.tsx b/app/[lang]/(live)/(public)/hotelreservation/layout.tsx new file mode 100644 index 000000000..75fa8edd6 --- /dev/null +++ b/app/[lang]/(live)/(public)/hotelreservation/layout.tsx @@ -0,0 +1,18 @@ +import Title from "@/components/TempDesignSystem/Text/Title" + +import styles from "./layout.module.css" + +import { LangParams, LayoutArgs } from "@/types/params" + +export default function HotelReservationLayout({ + children, +}: React.PropsWithChildren>) { + return ( +
+ + Lorem, ipsum. + + {children} +
+ ) +} diff --git a/app/[lang]/(live)/(public)/hotelreservation/page.tsx b/app/[lang]/(live)/(public)/hotelreservation/page.tsx new file mode 100644 index 000000000..9c5fae738 --- /dev/null +++ b/app/[lang]/(live)/(public)/hotelreservation/page.tsx @@ -0,0 +1,10 @@ +import { LangParams, PageArgs } from "@/types/params" + +export default function HotelReservationPage({ params }: PageArgs) { + return ( +
+ Lorem ipsum dolor sit amet, consectetur adipisicing elit. Beatae, + praesentium? +
+ ) +} diff --git a/constants/routes/hotelReservation.js b/constants/routes/hotelReservation.js new file mode 100644 index 000000000..ba0d6d4b6 --- /dev/null +++ b/constants/routes/hotelReservation.js @@ -0,0 +1,11 @@ +/** @type {import('@/types/routes').LangRoute} */ +export const hotelReservation = { + en: "/en/hotelreservation", + sv: "/sv/hotellbokning", + no: "/no/hotell-reservasjon", + fi: "/fi/hotellivaraus", + da: "/da/hotel-reservation", + de: "/de/hotelreservierung", +} + +export const bookingFlow = [...Object.values(hotelReservation)] diff --git a/middleware.ts b/middleware.ts index c1f303d23..299820632 100644 --- a/middleware.ts +++ b/middleware.ts @@ -2,6 +2,7 @@ import { NextMiddleware, NextResponse } from "next/server" import { findLang, Lang } from "./constants/languages" import * as authRequired from "./middlewares/authRequired" +import * as bookingFlow from "./middlewares/bookingFlow" import * as cmsContent from "./middlewares/cmsContent" import * as currentWebLogin from "./middlewares/currentWebLogin" import * as currentWebLogout from "./middlewares/currentWebLogout" @@ -34,6 +35,7 @@ export const middleware: NextMiddleware = async (request, event) => { handleAuth, myPages, webView, + bookingFlow, cmsContent, ] diff --git a/middlewares/bookingFlow.ts b/middlewares/bookingFlow.ts new file mode 100644 index 000000000..88d820df7 --- /dev/null +++ b/middlewares/bookingFlow.ts @@ -0,0 +1,15 @@ +import { NextResponse } from "next/server" + +import { bookingFlow } from "@/constants/routes/hotelReservation" + +import type { NextMiddleware } from "next/server" + +import type { MiddlewareMatcher } from "@/types/middleware" + +export const middleware: NextMiddleware = () => { + return NextResponse.next() +} + +export const matcher: MiddlewareMatcher = (request) => { + return bookingFlow.includes(request.nextUrl.pathname) +} diff --git a/next.config.js b/next.config.js index 921e1d3dc..7c89a5e06 100644 --- a/next.config.js +++ b/next.config.js @@ -1,6 +1,7 @@ import createJiti from "jiti" import { login, logout } from "./constants/routes/handleAuth.js" +import { hotelReservation } from "./constants/routes/hotelReservation.js" import { myPages } from "./constants/routes/myPages.js" const jiti = createJiti(new URL(import.meta.url).pathname) @@ -101,6 +102,11 @@ const nextConfig = { source: `${myPages.sv}/:path*`, destination: `/sv/my-pages/:path*`, }, + { source: hotelReservation.da, destination: "/da/hotelreservation" }, + { source: hotelReservation.de, destination: "/de/hotelreservation" }, + { source: hotelReservation.fi, destination: "/fi/hotelreservation" }, + { source: hotelReservation.no, destination: "/no/hotelreservation" }, + { source: hotelReservation.sv, destination: "/sv/hotelreservation" }, ], } },