Merged in feat/sw-3604-webviews (pull request #3123)

feat(SW-3604): wrap mystay with bookingflowconfig

* feat(SW-3604): wrap mystay with bookingflowconfig


Approved-by: Joakim Jäderberg
This commit is contained in:
Linus Flood
2025-11-11 09:37:54 +00:00
parent 0490badbb1
commit ecb25cf6cd
3 changed files with 23 additions and 10 deletions

View File

@@ -1,7 +1,3 @@
import { BookingFlowConfig } from "@scandic-hotels/booking-flow/BookingFlowConfig"
import { bookingFlowConfig } from "@/constants/bookingFlowConfig"
import MyStay from "@/components/HotelReservation/MyStay"
import { setLang } from "@/i18n/serverContext"
@@ -18,9 +14,9 @@ export default async function MyStayPage(
const refId = searchParams.RefId
return (
<BookingFlowConfig config={bookingFlowConfig}>
<>
<MyStay refId={refId} lang={params.lang} />
<Tracking />
</BookingFlowConfig>
</>
)
}

View File

@@ -14,6 +14,7 @@ import { ToastHandler } from "@scandic-hotels/design-system/ToastHandler"
import TrpcProvider from "@/lib/trpc/Provider"
import { BookingFlowProviders } from "@/components/BookingFlowProviders"
import RouteChange from "@/components/RouteChange"
import AdobeSDKScript from "@/components/TrackingSDK/AdobeSDKScript"
import GTMScript from "@/components/TrackingSDK/GTMScript"
@@ -63,9 +64,11 @@ export default async function RootLayout(
>
<NuqsAdapter>
<TrpcProvider>
<RouteChange />
{children}
<ToastHandler />
<BookingFlowProviders>
<RouteChange />
{children}
<ToastHandler />
</BookingFlowProviders>
</TrpcProvider>
</NuqsAdapter>
</ClientIntlProvider>

View File

@@ -1,6 +1,7 @@
import { cookies } from "next/headers"
import { notFound } from "next/navigation"
import { BookingFlowConfig } from "@scandic-hotels/booking-flow/BookingFlowConfig"
import { filterOverlappingDates } from "@scandic-hotels/booking-flow/utils/SelectRate"
import { dt } from "@scandic-hotels/common/dt"
import { logger } from "@scandic-hotels/common/logger"
@@ -10,6 +11,7 @@ import { Typography } from "@scandic-hotels/design-system/Typography"
import { BreakfastPackageEnum } from "@scandic-hotels/trpc/enums/breakfast"
import { parseRefId } from "@scandic-hotels/trpc/utils/refId"
import { bookingFlowConfig } from "@/constants/bookingFlowConfig"
import { env } from "@/env/server"
import {
findBooking,
@@ -46,7 +48,19 @@ import type { BookingConfirmation } from "@scandic-hotels/trpc/types/bookingConf
import type { SafeUser } from "@/types/user"
export default async function MyStay(props: {
export default function MyStayWrapper(props: {
refId?: string
lang: Lang
isWebview?: boolean
}) {
return (
<BookingFlowConfig config={bookingFlowConfig}>
<MyStay {...props} />
</BookingFlowConfig>
)
}
async function MyStay(props: {
refId?: string
lang: Lang
isWebview?: boolean