feat:overlay-calendar (#20610)
This commit is contained in:
1 parent
3719bb3762
commit
eb19edfa8f
2 files changed
+15
-2
No files matched your search
@@ -1,3 +1,5 @@
|
|||||||
|
import { useEffect } from "react";
|
||||||
|
|
||||||
import { useIsPlatform } from "@calcom/atoms/hooks/useIsPlatform";
|
import { useIsPlatform } from "@calcom/atoms/hooks/useIsPlatform";
|
||||||
|
|
||||||
import type { UseCalendarsReturnType } from "../hooks/useCalendars";
|
import type { UseCalendarsReturnType } from "../hooks/useCalendars";
|
||||||
@@ -41,9 +43,16 @@ export const OverlayCalendar = ({
|
|||||||
checkIsCalendarToggled,
|
checkIsCalendarToggled,
|
||||||
} = useOverlayCalendar({ connectedCalendars, overlayBusyDates, onToggleCalendar });
|
} = useOverlayCalendar({ connectedCalendars, overlayBusyDates, onToggleCalendar });
|
||||||
|
|
||||||
|
// Adding to avoid flickering of continue modal due to stale state
|
||||||
|
useEffect(() => {
|
||||||
|
if (isOverlayCalendarEnabled) {
|
||||||
|
handleCloseContinueModal(false);
|
||||||
|
}
|
||||||
|
}, [isOverlayCalendarEnabled, handleCloseContinueModal]);
|
||||||
|
|
||||||
// on platform we don't handle connecting to third party calendar via booker yet
|
// on platform we don't handle connecting to third party calendar via booker yet
|
||||||
if (isPlatform && connectedCalendars?.length === 0) {
|
if (isPlatform && connectedCalendars?.length === 0) {
|
||||||
return <></>;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
@@ -55,7 +64,7 @@ export const OverlayCalendar = ({
|
|||||||
/>
|
/>
|
||||||
{!isPlatform && (
|
{!isPlatform && (
|
||||||
<OverlayCalendarContinueModal
|
<OverlayCalendarContinueModal
|
||||||
open={isOpenOverlayContinueModal}
|
open={isOpenOverlayContinueModal && !isOverlayCalendarEnabled}
|
||||||
onClose={handleCloseContinueModal}
|
onClose={handleCloseContinueModal}
|
||||||
onContinue={handleClickContinue}
|
onContinue={handleClickContinue}
|
||||||
/>
|
/>
|
||||||
|
|||||||
@@ -209,6 +209,10 @@ export const BookerWebWrapper = (props: BookerWebWrapperAtomProps) => {
|
|||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
if (hasSession) onOverlaySwitchStateChange(true);
|
||||||
|
}, [hasSession]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<BookerComponent
|
<BookerComponent
|
||||||
{...props}
|
{...props}
|
||||||
|
|||||||
Reference in new issue
Block a user