feat: create route for hotel reservation
This commit is contained in:
@@ -0,0 +1,3 @@
|
||||
.layout {
|
||||
height: 100vh;
|
||||
}
|
||||
18
app/[lang]/(live)/(public)/hotelreservation/layout.tsx
Normal file
18
app/[lang]/(live)/(public)/hotelreservation/layout.tsx
Normal file
@@ -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<LayoutArgs<LangParams>>) {
|
||||
return (
|
||||
<div className={styles.layout}>
|
||||
<Title as="h1" color="black">
|
||||
Lorem, ipsum.
|
||||
</Title>
|
||||
{children}
|
||||
</div>
|
||||
)
|
||||
}
|
||||
10
app/[lang]/(live)/(public)/hotelreservation/page.tsx
Normal file
10
app/[lang]/(live)/(public)/hotelreservation/page.tsx
Normal file
@@ -0,0 +1,10 @@
|
||||
import { LangParams, PageArgs } from "@/types/params"
|
||||
|
||||
export default function HotelReservationPage({ params }: PageArgs<LangParams>) {
|
||||
return (
|
||||
<div>
|
||||
Lorem ipsum dolor sit amet, consectetur adipisicing elit. Beatae,
|
||||
praesentium?
|
||||
</div>
|
||||
)
|
||||
}
|
||||
11
constants/routes/hotelReservation.js
Normal file
11
constants/routes/hotelReservation.js
Normal file
@@ -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)]
|
||||
@@ -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,
|
||||
]
|
||||
|
||||
|
||||
15
middlewares/bookingFlow.ts
Normal file
15
middlewares/bookingFlow.ts
Normal file
@@ -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)
|
||||
}
|
||||
@@ -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" },
|
||||
],
|
||||
}
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user