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:
@@ -1,5 +1,7 @@
|
||||
import { BookingConfirmationPage as BookingConfirmationPagePrimitive } from "@scandic-hotels/booking-flow/pages/BookingConfirmationPage"
|
||||
|
||||
import { bookingFlowConfig } from "@/constants/bookingFlowConfig"
|
||||
|
||||
import { getIntl } from "@/i18n"
|
||||
import { getLang } from "@/i18n/serverContext"
|
||||
|
||||
@@ -17,6 +19,7 @@ export default async function BookingConfirmationPage(
|
||||
intl={intl}
|
||||
lang={lang}
|
||||
searchParams={searchParams}
|
||||
config={bookingFlowConfig}
|
||||
/>
|
||||
)
|
||||
}
|
||||
|
||||
@@ -2,6 +2,8 @@ import { PaymentCallbackPage as PaymentCallbackPagePrimitive } from "@scandic-ho
|
||||
import { logger } from "@scandic-hotels/common/logger"
|
||||
import { isValidSession } from "@scandic-hotels/trpc/utils/session"
|
||||
|
||||
import { bookingFlowConfig } from "@/constants/bookingFlowConfig"
|
||||
|
||||
import { auth } from "@/auth"
|
||||
|
||||
import type { PaymentCallbackStatusEnum } from "@scandic-hotels/common/constants/paymentCallbackStatusEnum"
|
||||
@@ -35,6 +37,7 @@ export default async function PaymentCallbackPage(
|
||||
searchParams={searchParams}
|
||||
// TODO refactor this route to get this from params instead of rewriting in next.config
|
||||
status={searchParams.status as PaymentCallbackStatusEnum}
|
||||
config={bookingFlowConfig}
|
||||
/>
|
||||
)
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import { AlternativeHotelsMapPage as AlternativeHotelsMapPagePrimitive } from "@scandic-hotels/booking-flow/pages/AlternativeHotelsMapPage"
|
||||
|
||||
import { bookingFlowConfig } from "@/constants/bookingFlowConfig"
|
||||
import { getHotel } from "@/lib/trpc/memoizedRequests"
|
||||
|
||||
import { getIntl } from "@/i18n"
|
||||
@@ -58,6 +59,7 @@ export default async function AlternativeHotelsMapPage(
|
||||
<AlternativeHotelsMapPagePrimitive
|
||||
lang={lang}
|
||||
searchParams={searchParams}
|
||||
config={bookingFlowConfig}
|
||||
/>
|
||||
</div>
|
||||
)
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import { AlternativeHotelsPage as AlternativeHotelsPagePrimitive } from "@scandic-hotels/booking-flow/pages/AlternativeHotelsPage"
|
||||
|
||||
import { bookingFlowConfig } from "@/constants/bookingFlowConfig"
|
||||
import { getHotel } from "@/lib/trpc/memoizedRequests"
|
||||
|
||||
import { getIntl } from "@/i18n"
|
||||
@@ -55,6 +56,10 @@ export default async function AlternativeHotelsPage(
|
||||
const searchParams = await props.searchParams
|
||||
const lang = await getLang()
|
||||
return (
|
||||
<AlternativeHotelsPagePrimitive lang={lang} searchParams={searchParams} />
|
||||
<AlternativeHotelsPagePrimitive
|
||||
lang={lang}
|
||||
searchParams={searchParams}
|
||||
config={bookingFlowConfig}
|
||||
/>
|
||||
)
|
||||
}
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
import { EnterDetailsPage as EnterDetailsPagePrimitive } from "@scandic-hotels/booking-flow/pages/EnterDetailsPage"
|
||||
|
||||
import { bookingFlowConfig } from "@/constants/bookingFlowConfig"
|
||||
|
||||
import type { LangParams, NextSearchParams, PageArgs } from "@/types/params"
|
||||
|
||||
export default async function DetailsPage(
|
||||
@@ -8,5 +10,11 @@ export default async function DetailsPage(
|
||||
const { lang } = await props.params
|
||||
const searchParams = await props.searchParams
|
||||
|
||||
return <EnterDetailsPagePrimitive lang={lang} searchParams={searchParams} />
|
||||
return (
|
||||
<EnterDetailsPagePrimitive
|
||||
lang={lang}
|
||||
searchParams={searchParams}
|
||||
config={bookingFlowConfig}
|
||||
/>
|
||||
)
|
||||
}
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
import { SelectHotelMapPage as SelectHotelMapPagePrimitive } from "@scandic-hotels/booking-flow/pages/SelectHotelMapPage"
|
||||
import { toCapitalCase } from "@scandic-hotels/common/utils/toCapitalCase"
|
||||
|
||||
import { bookingFlowConfig } from "@/constants/bookingFlowConfig"
|
||||
|
||||
import { getLang } from "@/i18n/serverContext"
|
||||
|
||||
import styles from "./page.module.css"
|
||||
@@ -27,7 +29,11 @@ export default async function SelectHotelMapPage(
|
||||
|
||||
return (
|
||||
<div className={styles.main}>
|
||||
<SelectHotelMapPagePrimitive lang={lang} searchParams={searchParams} />
|
||||
<SelectHotelMapPagePrimitive
|
||||
lang={lang}
|
||||
searchParams={searchParams}
|
||||
config={bookingFlowConfig}
|
||||
/>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
import { SelectHotelPage as SelectHotelPagePrimitive } from "@scandic-hotels/booking-flow/pages/SelectHotelPage"
|
||||
import { toCapitalCase } from "@scandic-hotels/common/utils/toCapitalCase"
|
||||
|
||||
import { bookingFlowConfig } from "@/constants/bookingFlowConfig"
|
||||
|
||||
import { getLang } from "@/i18n/serverContext"
|
||||
|
||||
import type { Metadata } from "next"
|
||||
@@ -23,5 +25,11 @@ export default async function SelectHotelPage(
|
||||
const searchParams = await props.searchParams
|
||||
const lang = await getLang()
|
||||
|
||||
return <SelectHotelPagePrimitive lang={lang} searchParams={searchParams} />
|
||||
return (
|
||||
<SelectHotelPagePrimitive
|
||||
lang={lang}
|
||||
searchParams={searchParams}
|
||||
config={bookingFlowConfig}
|
||||
/>
|
||||
)
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import { SelectRatePage as SelectRatePagePrimitive } from "@scandic-hotels/booking-flow/pages/SelectRatePage"
|
||||
|
||||
import { bookingFlowConfig } from "@/constants/bookingFlowConfig"
|
||||
import { getHotel } from "@/lib/trpc/memoizedRequests"
|
||||
|
||||
import { getLang } from "@/i18n/serverContext"
|
||||
@@ -40,5 +41,11 @@ export default async function SelectRatePage(
|
||||
const searchParams = await props.searchParams
|
||||
const lang = await getLang()
|
||||
|
||||
return <SelectRatePagePrimitive lang={lang} searchParams={searchParams} />
|
||||
return (
|
||||
<SelectRatePagePrimitive
|
||||
lang={lang}
|
||||
searchParams={searchParams}
|
||||
config={bookingFlowConfig}
|
||||
/>
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user