From ed8a14fdd78cfedabb3d0a682d2e0ba12951b020 Mon Sep 17 00:00:00 2001 From: sean-brydon <55134778+sean-brydon@users.noreply.github.com> Date: Thu, 12 Oct 2023 00:01:09 +0100 Subject: [PATCH] Remove overlay from embed (#11817) --- .../components/OverlayCalendar/OverlayCalendarContainer.tsx | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/packages/features/bookings/Booker/components/OverlayCalendar/OverlayCalendarContainer.tsx b/packages/features/bookings/Booker/components/OverlayCalendar/OverlayCalendarContainer.tsx index 47aeb99e97..a44543f67c 100644 --- a/packages/features/bookings/Booker/components/OverlayCalendar/OverlayCalendarContainer.tsx +++ b/packages/features/bookings/Booker/components/OverlayCalendar/OverlayCalendarContainer.tsx @@ -3,6 +3,7 @@ import { useRouter, useSearchParams, usePathname } from "next/navigation"; import { useState, useCallback, useEffect } from "react"; import dayjs from "@calcom/dayjs"; +import { useIsEmbed } from "@calcom/embed-core/embed-iframe"; import { useTimePreferences } from "@calcom/features/bookings/lib"; import { classNames } from "@calcom/lib"; import { useLocale } from "@calcom/lib/hooks/useLocale"; @@ -18,6 +19,7 @@ import { useOverlayCalendarStore } from "./store"; export function OverlayCalendarContainer() { const { t } = useLocale(); + const isEmbed = useIsEmbed(); const [continueWithProvider, setContinueWithProvider] = useState(false); const [calendarSettingsOverlay, setCalendarSettingsOverlay] = useState(false); const { data: session } = useSession(); @@ -102,6 +104,10 @@ export function OverlayCalendarContainer() { } }, [session, overlayCalendarQueryParam, toggleOverlayCalendarQueryParam]); + if (isEmbed) { + return null; + } + return ( <>