Remove overlay from embed (#11817)

pull/11787/head^2
sean-brydon 2023-10-12 00:01:09 +01:00 committed by GitHub
parent 0e50f6d9f8
commit ed8a14fdd7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 0 deletions

View File

@ -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