diff --git a/apps/partner-sas/app/[lang]/@bookingwidget/[...path]/page.tsx b/apps/partner-sas/app/[lang]/@bookingwidget/[...path]/page.tsx new file mode 100644 index 000000000..03a82e5f5 --- /dev/null +++ b/apps/partner-sas/app/[lang]/@bookingwidget/[...path]/page.tsx @@ -0,0 +1 @@ +export { default } from "../page" diff --git a/apps/partner-sas/app/[lang]/@bookingwidget/hotelreservation/[...paths]/loading.tsx b/apps/partner-sas/app/[lang]/@bookingwidget/hotelreservation/[...paths]/loading.tsx new file mode 100644 index 000000000..59cbf2505 --- /dev/null +++ b/apps/partner-sas/app/[lang]/@bookingwidget/hotelreservation/[...paths]/loading.tsx @@ -0,0 +1,11 @@ +import { BookingWidgetSkeleton } from "@scandic-hotels/booking-flow/BookingWidget/Skeleton" + +// This file is crucial for displaying a loading +// state immediately in the booking flow. +// Next doesn't recognize manually added Suspense +// boundaries during page navigation (Server->Client) +// thus making it seem as the page is frozen during +// the time it takes for `BookingWidget` to resolve. +export default function BookingWidgetLoading() { + return +} diff --git a/apps/partner-sas/app/[lang]/@bookingwidget/hotelreservation/[...paths]/page.tsx b/apps/partner-sas/app/[lang]/@bookingwidget/hotelreservation/[...paths]/page.tsx new file mode 100644 index 000000000..03a82e5f5 --- /dev/null +++ b/apps/partner-sas/app/[lang]/@bookingwidget/hotelreservation/[...paths]/page.tsx @@ -0,0 +1 @@ +export { default } from "../page" diff --git a/apps/partner-sas/app/[lang]/@bookingwidget/hotelreservation/booking-confirmation/page.tsx b/apps/partner-sas/app/[lang]/@bookingwidget/hotelreservation/booking-confirmation/page.tsx new file mode 100644 index 000000000..e0ff199ee --- /dev/null +++ b/apps/partner-sas/app/[lang]/@bookingwidget/hotelreservation/booking-confirmation/page.tsx @@ -0,0 +1,3 @@ +export default function ConfirmedBookingSlot() { + return null +} diff --git a/apps/partner-sas/app/[lang]/@bookingwidget/hotelreservation/page.tsx b/apps/partner-sas/app/[lang]/@bookingwidget/hotelreservation/page.tsx new file mode 100644 index 000000000..03a82e5f5 --- /dev/null +++ b/apps/partner-sas/app/[lang]/@bookingwidget/hotelreservation/page.tsx @@ -0,0 +1 @@ +export { default } from "../page" diff --git a/apps/partner-sas/app/[lang]/@bookingwidget/hotelreservation/payment-callback/page.tsx b/apps/partner-sas/app/[lang]/@bookingwidget/hotelreservation/payment-callback/page.tsx new file mode 100644 index 000000000..e0ff199ee --- /dev/null +++ b/apps/partner-sas/app/[lang]/@bookingwidget/hotelreservation/payment-callback/page.tsx @@ -0,0 +1,3 @@ +export default function ConfirmedBookingSlot() { + return null +} diff --git a/apps/partner-sas/app/[lang]/@bookingwidget/loading.module.css b/apps/partner-sas/app/[lang]/@bookingwidget/loading.module.css new file mode 100644 index 000000000..1fafcbb91 --- /dev/null +++ b/apps/partner-sas/app/[lang]/@bookingwidget/loading.module.css @@ -0,0 +1,4 @@ +.container { + height: 76px; + width: 100%; +} diff --git a/apps/partner-sas/app/[lang]/@bookingwidget/page.tsx b/apps/partner-sas/app/[lang]/@bookingwidget/page.tsx new file mode 100644 index 000000000..c0e9476f2 --- /dev/null +++ b/apps/partner-sas/app/[lang]/@bookingwidget/page.tsx @@ -0,0 +1,16 @@ +import { BookingWidget } from "@scandic-hotels/booking-flow/BookingWidget" +import { parseBookingWidgetSearchParams } from "@scandic-hotels/booking-flow/utils/url" + +import { getLang } from "@/i18n/serverContext" + +import type { LangParams, PageArgs } from "@/types/params" + +export default async function BookingWidgetPage(props: PageArgs) { + const searchParams = await props.searchParams + + const booking = parseBookingWidgetSearchParams(searchParams) + + const lang = await getLang() + + return +} diff --git a/apps/partner-sas/app/[lang]/layout.tsx b/apps/partner-sas/app/[lang]/layout.tsx index 117d1dc1d..0b86d0070 100644 --- a/apps/partner-sas/app/[lang]/layout.tsx +++ b/apps/partner-sas/app/[lang]/layout.tsx @@ -36,6 +36,7 @@ type LangParams = { type RootLayoutProps = { children: React.ReactNode params: Promise + bookingwidget: React.ReactNode } export default async function RootLayout(props: RootLayoutProps) { @@ -90,6 +91,7 @@ export default async function RootLayout(props: RootLayoutProps) { {/* eslint-disable-next-line formatjs/no-literal-string-in-jsx */}

SAS

+ {props.bookingwidget}
{children}
diff --git a/apps/partner-sas/app/[lang]/page.tsx b/apps/partner-sas/app/[lang]/page.tsx index 2aca0259f..d2b6403e7 100644 --- a/apps/partner-sas/app/[lang]/page.tsx +++ b/apps/partner-sas/app/[lang]/page.tsx @@ -1,24 +1,8 @@ -import { BookingWidget } from "@scandic-hotels/booking-flow/BookingWidget" -import { parseBookingWidgetSearchParams } from "@scandic-hotels/booking-flow/utils/url" - -import { getLang } from "@/i18n/serverContext" - -import type { Lang } from "@scandic-hotels/common/constants/language" - -type SearchParams = { - searchParams: Promise -} - -export default async function Home(props: SearchParams<{ lang: Lang }>) { - const searchParams = await props.searchParams - - const lang = await getLang() - - const booking = parseBookingWidgetSearchParams(searchParams) - +export default async function Home() { return (
- + {/* eslint-disable-next-line formatjs/no-literal-string-in-jsx */} +

start page

) }