feat: implement booking page error boundary (#20492)
* implement booking page error boundary * use it
This commit is contained in:
1 parent
01ca2ca3de
commit
b5b4134b75
5 files changed
+101
-68
No files matched your search
@@ -8,6 +8,8 @@ import { getBookerWrapperClasses } from "@calcom/features/bookings/Booker/utils/
|
||||
|
||||
import type { inferSSRProps } from "@lib/types/inferSSRProps";
|
||||
|
||||
import BookingPageErrorBoundary from "@components/error/BookingPageErrorBoundary";
|
||||
|
||||
import type { getServerSideProps } from "@server/lib/[user]/[type]/getServerSideProps";
|
||||
|
||||
export type PageProps = inferSSRProps<typeof getServerSideProps> & EmbedProps;
|
||||
@@ -26,25 +28,27 @@ function Type({ slug, user, isEmbed, booking, isBrandingHidden, eventData, orgBa
|
||||
const searchParams = useSearchParams();
|
||||
|
||||
return (
|
||||
<main className={getBookerWrapperClasses({ isEmbed: !!isEmbed })}>
|
||||
<Booker
|
||||
username={user}
|
||||
eventSlug={slug}
|
||||
bookingData={booking}
|
||||
hideBranding={isBrandingHidden}
|
||||
entity={{ ...eventData.entity, eventTypeId: eventData?.id }}
|
||||
durationConfig={eventData.metadata?.multipleDuration}
|
||||
orgBannerUrl={orgBannerUrl}
|
||||
/* TODO: Currently unused, evaluate it is needed-
|
||||
* Possible alternative approach is to have onDurationChange.
|
||||
*/
|
||||
duration={getMultipleDurationValue(
|
||||
eventData.metadata?.multipleDuration,
|
||||
searchParams?.get("duration"),
|
||||
eventData.length
|
||||
)}
|
||||
/>
|
||||
</main>
|
||||
<BookingPageErrorBoundary>
|
||||
<main className={getBookerWrapperClasses({ isEmbed: !!isEmbed })}>
|
||||
<Booker
|
||||
username={user}
|
||||
eventSlug={slug}
|
||||
bookingData={booking}
|
||||
hideBranding={isBrandingHidden}
|
||||
entity={{ ...eventData.entity, eventTypeId: eventData?.id }}
|
||||
durationConfig={eventData.metadata?.multipleDuration}
|
||||
orgBannerUrl={orgBannerUrl}
|
||||
/* TODO: Currently unused, evaluate it is needed-
|
||||
* Possible alternative approach is to have onDurationChange.
|
||||
*/
|
||||
duration={getMultipleDurationValue(
|
||||
eventData.metadata?.multipleDuration,
|
||||
searchParams?.get("duration"),
|
||||
eventData.length
|
||||
)}
|
||||
/>
|
||||
</main>
|
||||
</BookingPageErrorBoundary>
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user