From b3be9a93e0873a6ec7c2af53f338a593e8007c01 Mon Sep 17 00:00:00 2001 From: Morgan <33722304+ThyMinimalDev@users.noreply.github.com> Date: Tue, 17 Sep 2024 13:12:30 +0300 Subject: [PATCH] chore: expose metadata on platform booker atom (#16673) --- packages/platform/atoms/booker/BookerPlatformWrapper.tsx | 5 +++-- packages/platform/examples/base/src/pages/booking.tsx | 1 + 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/packages/platform/atoms/booker/BookerPlatformWrapper.tsx b/packages/platform/atoms/booker/BookerPlatformWrapper.tsx index 9c079b8572..10e6876d93 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; }; 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 bc81700335..d9f9b9111b 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",