Remove overlay from embed (#11817)
parent
0e50f6d9f8
commit
ed8a14fdd7
|
@ -3,6 +3,7 @@ import { useRouter, useSearchParams, usePathname } from "next/navigation";
|
||||||
import { useState, useCallback, useEffect } from "react";
|
import { useState, useCallback, useEffect } from "react";
|
||||||
|
|
||||||
import dayjs from "@calcom/dayjs";
|
import dayjs from "@calcom/dayjs";
|
||||||
|
import { useIsEmbed } from "@calcom/embed-core/embed-iframe";
|
||||||
import { useTimePreferences } from "@calcom/features/bookings/lib";
|
import { useTimePreferences } from "@calcom/features/bookings/lib";
|
||||||
import { classNames } from "@calcom/lib";
|
import { classNames } from "@calcom/lib";
|
||||||
import { useLocale } from "@calcom/lib/hooks/useLocale";
|
import { useLocale } from "@calcom/lib/hooks/useLocale";
|
||||||
|
@ -18,6 +19,7 @@ import { useOverlayCalendarStore } from "./store";
|
||||||
|
|
||||||
export function OverlayCalendarContainer() {
|
export function OverlayCalendarContainer() {
|
||||||
const { t } = useLocale();
|
const { t } = useLocale();
|
||||||
|
const isEmbed = useIsEmbed();
|
||||||
const [continueWithProvider, setContinueWithProvider] = useState(false);
|
const [continueWithProvider, setContinueWithProvider] = useState(false);
|
||||||
const [calendarSettingsOverlay, setCalendarSettingsOverlay] = useState(false);
|
const [calendarSettingsOverlay, setCalendarSettingsOverlay] = useState(false);
|
||||||
const { data: session } = useSession();
|
const { data: session } = useSession();
|
||||||
|
@ -102,6 +104,10 @@ export function OverlayCalendarContainer() {
|
||||||
}
|
}
|
||||||
}, [session, overlayCalendarQueryParam, toggleOverlayCalendarQueryParam]);
|
}, [session, overlayCalendarQueryParam, toggleOverlayCalendarQueryParam]);
|
||||||
|
|
||||||
|
if (isEmbed) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<div
|
<div
|
||||||
|
|
Loading…
Reference in New Issue