Skip to content

Scheduling infrastructure for absolutely everyone.

chore: expose metadata on platform booker atom (#16673)

Morganb3be9a93e087
diff --git a/packages/platform/atoms/booker/BookerPlatformWrapper.tsx b/packages/platform/atoms/booker/BookerPlatformWrapper.tsx
index 9c079b85722..10e6876d934 100644
--- a/packages/platform/atoms/booker/BookerPlatformWrapper.tsx
+++ b/packages/platform/atoms/booker/BookerPlatformWrapper.tsx
@@ -75,6 +75,7 @@ export type BookerPlatformWrapperAtomProps = Omit<
onDeleteSlotError?: (data: ApiErrorResponse) => void;
locationUrl?: string;
view?: VIEW_TYPE;
+ metadata?: Record<string, string>;
};
type VIEW_TYPE = keyof typeof BookerLayouts;
@@ -343,7 +344,7 @@ export const BookerPlatformWrapper = (
event,
bookingForm: bookerForm.bookingForm,
hashedLink: props.hashedLink,
- metadata: {},
+ metadata: props.metadata ?? {},
handleBooking: props?.handleCreateBooking ?? createBooking,
handleInstantBooking: createInstantBooking,
handleRecBooking: createRecBooking,
@@ -389,7 +390,7 @@ export const BookerPlatformWrapper = (
if (isOverlayCalendarEnabled && view === "MONTH_VIEW") {
localStorage.removeItem("overlayCalendarSwitchDefault");
}
- setIsOverlayCalendarEnabled(Boolean(localStorage?.getItem?.("overlayCalendarSwitchDefault")));
+ setIsOverlayCalendarEnabled(Boolean(localStorage?.getItem?.("overlayCalendarSwitchDefault")));
}, [view, isOverlayCalendarEnabled]);
return (
diff --git a/packages/platform/examples/base/src/pages/booking.tsx b/packages/platform/examples/base/src/pages/booking.tsx
index bc817003353..d9f9b9111bd 100644
--- a/packages/platform/examples/base/src/pages/booking.tsx
+++ b/packages/platform/examples/base/src/pages/booking.tsx
@@ -96,6 +96,7 @@ export default function Bookings(props: { calUsername: string; calEmail: string
setBookingTitle(data.data.title ?? "");
router.push(`/${data.data.uid}`);
}}
+ metadata={{ CustomKey: "CustomValue" }}
duration={eventTypeDuration}
customClassNames={{
bookerContainer: "!bg-[#F5F2FE] [&_button:!rounded-full] border-subtle border",