fix: Hotfix - Revert hideEventTypeDetails handling in Booker.tsx (#17130)
* Revert "fix: DatePicker not showing up in mobile mode when hideEventTypeDetails is true (#17037)" This reverts commit1f08bc5a4f. * Revert "feat: Booker atom enable hiding event details (#16906)" This reverts commitba5b9e951a. * Keep the playground test scenarios
This commit is contained in:
1 parent
8115c86e37
commit
123074f4ba
5 files changed
+76
-58
No files matched your search
@@ -259,8 +259,6 @@ const BookerComponent = ({
|
||||
return null;
|
||||
}
|
||||
|
||||
const shouldShowMeta = !hideEventTypeDetails;
|
||||
|
||||
return (
|
||||
<>
|
||||
{event.data && !isPlatform ? <BookingPageTagManager eventType={event.data} /> : <></>}
|
||||
@@ -329,46 +327,42 @@ const BookerComponent = ({
|
||||
)}
|
||||
</BookerSection>
|
||||
)}
|
||||
{shouldShowMeta && (
|
||||
<StickyOnDesktop key="meta" className={classNames("relative z-10 flex [grid-area:meta]")}>
|
||||
<BookerSection
|
||||
area="meta"
|
||||
className="max-w-screen flex w-full flex-col md:w-[var(--booker-meta-width)]">
|
||||
{orgBannerUrl && !isPlatform && (
|
||||
<img
|
||||
loading="eager"
|
||||
className="-mb-9 ltr:rounded-tl-md rtl:rounded-tr-md"
|
||||
alt="org banner"
|
||||
src={orgBannerUrl}
|
||||
/>
|
||||
)}
|
||||
<EventMeta
|
||||
classNames={{
|
||||
eventMetaContainer: customClassNames?.eventMetaCustomClassNames?.eventMetaContainer,
|
||||
eventMetaTitle: customClassNames?.eventMetaCustomClassNames?.eventMetaTitle,
|
||||
eventMetaTimezoneSelect:
|
||||
customClassNames?.eventMetaCustomClassNames?.eventMetaTimezoneSelect,
|
||||
}}
|
||||
event={event.data}
|
||||
isPending={event.isPending}
|
||||
isPlatform={isPlatform}
|
||||
<StickyOnDesktop key="meta" className={classNames("relative z-10 flex [grid-area:meta]")}>
|
||||
<BookerSection
|
||||
area="meta"
|
||||
className="max-w-screen flex w-full flex-col md:w-[var(--booker-meta-width)]">
|
||||
{!hideEventTypeDetails && orgBannerUrl && !isPlatform && (
|
||||
<img
|
||||
loading="eager"
|
||||
className="-mb-9 ltr:rounded-tl-md rtl:rounded-tr-md"
|
||||
alt="org banner"
|
||||
src={orgBannerUrl}
|
||||
/>
|
||||
{layout !== BookerLayouts.MONTH_VIEW &&
|
||||
!(layout === "mobile" && bookerState === "booking") && (
|
||||
<div className="mt-auto px-5 py-3">
|
||||
<DatePicker event={event} schedule={schedule} scrollToTimeSlots={scrollToTimeSlots} />
|
||||
</div>
|
||||
)}
|
||||
</BookerSection>
|
||||
</StickyOnDesktop>
|
||||
)}
|
||||
)}
|
||||
<EventMeta
|
||||
classNames={{
|
||||
eventMetaContainer: customClassNames?.eventMetaCustomClassNames?.eventMetaContainer,
|
||||
eventMetaTitle: customClassNames?.eventMetaCustomClassNames?.eventMetaTitle,
|
||||
eventMetaTimezoneSelect:
|
||||
customClassNames?.eventMetaCustomClassNames?.eventMetaTimezoneSelect,
|
||||
}}
|
||||
event={event.data}
|
||||
isPending={event.isPending}
|
||||
isPlatform={isPlatform}
|
||||
/>
|
||||
{layout !== BookerLayouts.MONTH_VIEW &&
|
||||
!(layout === "mobile" && bookerState === "booking") && (
|
||||
<div className="mt-auto px-5 py-3">
|
||||
<DatePicker event={event} schedule={schedule} scrollToTimeSlots={scrollToTimeSlots} />
|
||||
</div>
|
||||
)}
|
||||
</BookerSection>
|
||||
</StickyOnDesktop>
|
||||
|
||||
<BookerSection
|
||||
key="book-event-form"
|
||||
area="main"
|
||||
className={`sticky top-0 ml-[-1px] h-full p-6 md:w-[var(--booker-main-width)] ${
|
||||
!hideEventTypeDetails ? "md:border-l" : ""
|
||||
}`}
|
||||
className="sticky top-0 ml-[-1px] h-full p-6 md:w-[var(--booker-main-width)] md:border-l"
|
||||
{...fadeInLeft}
|
||||
visible={bookerState === "booking" && !shouldShowFormInDialog}>
|
||||
{EventBooker}
|
||||
@@ -377,18 +371,10 @@ const BookerComponent = ({
|
||||
<BookerSection
|
||||
key="datepicker"
|
||||
area="main"
|
||||
visible={
|
||||
bookerState !== "booking" &&
|
||||
(layout === BookerLayouts.MONTH_VIEW ||
|
||||
// Meta possibly can show DatePicker but if meta is not shown, then DatePicker must be shown here
|
||||
// FIXME: We need proper state management for this(depending on layout and bookerState)
|
||||
!shouldShowMeta)
|
||||
}
|
||||
visible={bookerState !== "booking" && layout === BookerLayouts.MONTH_VIEW}
|
||||
{...fadeInLeft}
|
||||
initial="visible"
|
||||
className={`ml-[-1px] h-full flex-shrink px-5 py-3 lg:w-[var(--booker-main-width)] ${
|
||||
!hideEventTypeDetails ? "md:border-subtle md:border-l" : ""
|
||||
}`}>
|
||||
className="md:border-subtle ml-[-1px] h-full flex-shrink px-5 py-3 md:border-l lg:w-[var(--booker-main-width)]">
|
||||
<DatePicker
|
||||
classNames={{
|
||||
datePickerContainer: customClassNames?.datePickerCustomClassNames?.datePickerContainer,
|
||||
|
||||
@@ -15,14 +15,7 @@ import { getQueryParam } from "../../utils/query-param";
|
||||
|
||||
export type UseBookerLayoutType = ReturnType<typeof useBookerLayout>;
|
||||
|
||||
type Options = {
|
||||
hideEventTypeDetails?: boolean;
|
||||
};
|
||||
|
||||
export const useBookerLayout = (
|
||||
event: Pick<BookerEvent, "profile"> | undefined | null,
|
||||
options?: Options
|
||||
) => {
|
||||
export const useBookerLayout = (event: Pick<BookerEvent, "profile"> | undefined | null) => {
|
||||
const [_layout, setLayout] = useBookerStore((state) => [state.layout, state.setLayout], shallow);
|
||||
const isEmbed = useIsEmbed();
|
||||
const isMobile = useMediaQuery("(max-width: 768px)");
|
||||
@@ -81,7 +74,7 @@ export const useBookerLayout = (
|
||||
|
||||
const shouldShowFormInDialog = shouldShowFormInDialogMap[layout];
|
||||
|
||||
const hideEventTypeDetails = isEmbed ? embedUiConfig.hideEventTypeDetails : !!options?.hideEventTypeDetails;
|
||||
const hideEventTypeDetails = isEmbed ? embedUiConfig.hideEventTypeDetails : false;
|
||||
|
||||
return {
|
||||
shouldShowFormInDialog,
|
||||
|
||||
Reference in new issue
Block a user