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

This commit is contained in:
Morgan
2024-09-17 10:12:30 +00:00
committed by GitHub
parent d27ccd6f44
commit b3be9a93e0
2 changed files with 4 additions and 2 deletions
@@ -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 (
@@ -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",