Merged in fix/sw-3551-rsc-bookingflowconfig (pull request #2988)

fix(SW-3551): Fix issue with BookingConfigProvider in RSC

* wip move config to pages

* Move config providing to pages
This commit is contained in:
Anton Gunnarsson
2025-10-22 07:04:21 +00:00
parent 2a28681259
commit c435cdba68
44 changed files with 398 additions and 237 deletions

View File

@@ -3,6 +3,7 @@ import { notFound } from "next/navigation"
import { logger } from "@scandic-hotels/common/logger"
import { SEARCH_TYPE_REDEMPTION } from "@scandic-hotels/trpc/constants/booking"
import { BookingFlowConfig } from "../bookingFlowConfig/bookingFlowConfig"
import { SelectRate } from "../components/SelectRate"
import { SelectRateTracking } from "../components/SelectRate/Tracking/SelectRateTracking"
import { SelectRateProvider } from "../contexts/SelectRate/SelectRateContext"
@@ -28,9 +29,11 @@ const singleRoomRateTypes = combineRegExps(
export async function SelectRatePage({
lang,
searchParams,
config,
}: {
lang: Lang
searchParams: NextSearchParams
config: BookingFlowConfig
}) {
const booking = parseSelectRateSearchParams(searchParams)
@@ -71,12 +74,12 @@ export async function SelectRatePage({
}
return (
<>
<BookingFlowConfig config={config}>
<SelectRateProvider hotelData={hotelData}>
<SelectRate hotelData={hotelData} booking={booking} />
<SelectRateTracking hotelData={hotelData} booking={booking} />
</SelectRateProvider>
</>
</BookingFlowConfig>
)
}