Merged in feat/sw-2403-mystay-webview (pull request #1828)

Feat/sw-2403 - Adding webview for MyStay

* feat/webview - added for my stay

* wip

* Passing headers so we can get the lang

* Cleanup

* Refactored and some performance improvements


Approved-by: Christian Andolf
This commit is contained in:
Linus Flood
2025-04-17 08:48:52 +00:00
parent 3ce3063973
commit cfa8c166a3
7 changed files with 169 additions and 56 deletions

View File

@@ -0,0 +1,27 @@
# Booking flow
The booking flow is the user journey of booking one or more rooms at our
hotels. Everything from choosing the date to payment and confirmation is
part of the booking flow.
## Booking widget
On most of the pages on the website we have a booking widget. This is where
the user starts the booking flow, by filling the form and submit. If they
entered a city as the destination they will land on the select hotel page
and if they entered a specific hotel they will land on the select rate page.
## Select hotel
Lists available hotels based on the search criteria. When the user selects
a hotel they land on the select rate page.
## Select rate, room, breakfast etc
This is a page with an accordion like design, but every accordion is handled
as its own page with its own URL.
## State management
The state, like search parameters and selected alternatives, is kept
throughout the booking flow in the URL.

View File

@@ -0,0 +1,21 @@
import { notFound } from "next/navigation"
import { env } from "@/env/server"
import type { Metadata } from "next"
export const metadata: Metadata = {
robots: {
index: false,
follow: false,
},
}
export default function HotelReservationLayout({
children,
}: React.PropsWithChildren) {
if (!env.ENABLE_BOOKING_FLOW) {
return notFound()
}
return <>{children}</>
}

View File

@@ -0,0 +1,14 @@
import SidePeek from "@/components/HotelReservation/SidePeek"
import type { LangParams, LayoutArgs } from "@/types/params"
export default function HotelReservationLayout({
children,
}: React.PropsWithChildren<LayoutArgs<LangParams>>) {
return (
<>
{children}
<SidePeek />
</>
)
}

View File

@@ -0,0 +1 @@
export { MyStaySkeleton as default } from "@/components/HotelReservation/MyStay/myStaySkeleton"

View File

@@ -0,0 +1,21 @@
import { notFound } from "next/navigation"
import { Suspense } from "react"
import { MyStay } from "@/components/HotelReservation/MyStay"
import { MyStaySkeleton } from "@/components/HotelReservation/MyStay/myStaySkeleton"
import type { LangParams, PageArgs } from "@/types/params"
export default function MyStayPage({
searchParams,
}: PageArgs<LangParams, { RefId?: string }>) {
if (!searchParams.RefId) {
notFound()
}
return (
<Suspense fallback={<MyStaySkeleton />}>
<MyStay refId={searchParams.RefId} />
</Suspense>
)
}