diff --git a/packages/features/embed/Embed.tsx b/packages/features/embed/Embed.tsx index 8988c348c4..7c875d6e27 100644 --- a/packages/features/embed/Embed.tsx +++ b/packages/features/embed/Embed.tsx @@ -37,12 +37,13 @@ import { HorizontalTabs } from "@calcom/ui/components/navigation"; import { showToast } from "@calcom/ui/components/toast"; import { useBookerTime } from "../bookings/Booker/components/hooks/useBookerTime"; +import { EmbedTabName } from "./lib/EmbedTabs"; import { buildCssVarsPerTheme } from "./lib/buildCssVarsPerTheme"; import { EmbedTheme } from "./lib/constants"; import { getDimension } from "./lib/getDimension"; import { useEmbedDialogCtx } from "./lib/hooks/useEmbedDialogCtx"; import { useEmbedParams } from "./lib/hooks/useEmbedParams"; -import type { EmbedTabs, EmbedType, EmbedTypes, PreviewState } from "./types"; +import type { EmbedTabs, EmbedType, EmbedTypes, PreviewState, EmbedConfig } from "./types"; type EventType = RouterOutputs["viewer"]["eventTypes"]["get"]["eventType"] | undefined; type EmbedDialogProps = { @@ -932,55 +933,58 @@ const EmbedTypeCodeAndPreviewDialogContent = ({ open={isEmbedCustomizationOpen} onOpenChange={() => setIsEmbedCustomizationOpen((val) => !val)}> -
- {/*TODO: Add Auto/Fixed toggle from Figma */} -
Window sizing
-
-
+ {/* Conditionally render Window Sizing only if inline embed AND NOT React Atom */} + {embedType === "inline" && embedParams.embedTabName !== EmbedTabName.ATOM_REACT && ( +
+ {/*TODO: Add Auto/Fixed toggle from Figma */} +
Window sizing
+
+
+ { + setPreviewState((previewState) => { + const width = e.target.value || "100%"; + + return { + ...previewState, + inline: { + ...previewState.inline, + width, + }, + }; + }); + }} + addOnLeading={<>W} + /> +
+ { - setPreviewState((previewState) => { - const width = e.target.value || "100%"; + const height = e.target.value || "100%"; + setPreviewState((previewState) => { return { ...previewState, inline: { ...previewState.inline, - width, + height, }, }; }); }} - addOnLeading={<>W} + addOnLeading={<>H} />
- - { - const height = e.target.value || "100%"; - - setPreviewState((previewState) => { - return { - ...previewState, - inline: { - ...previewState.inline, - height, - }, - }; - }); - }} - addOnLeading={<>H} - />
-
+ )}
setIsBookingCustomizationOpen((val) => !val)}>
- - {!eventTypeHideOptionDisabled ? ( + // Keep updating top-level theme for preview iframe + theme: option.value, + }; + }); + }} + options={ThemeOptions} + /> + + )} + {/* Conditionally render Hide Details Switch only if NOT Atom embed AND not disabled by prop */} + {!eventTypeHideOptionDisabled && + embedParams.embedTabName !== EmbedTabName.ATOM_REACT ? (
{t("hide_eventtype_details")}
) : null} - {[ - { name: "brandColor", title: "light_brand_color" }, - { name: "darkBrandColor", title: "dark_brand_color" }, - // { name: "lightColor", title: "Light Color" }, - // { name: "lighterColor", title: "Lighter Color" }, - // { name: "lightestColor", title: "Lightest Color" }, - // { name: "highlightColor", title: "Highlight Color" }, - // { name: "medianColor", title: "Median Color" }, - ].map((palette) => ( - - ))} + {/* Conditionally render Brand Colors only if NOT React Atom */} + {embedParams.embedTabName !== EmbedTabName.ATOM_REACT && + [ + { name: "brandColor", title: "light_brand_color" }, + { name: "darkBrandColor", title: "dark_brand_color" }, + // { name: "lightColor", title: "Light Color" }, + // { name: "lighterColor", title: "Lighter Color" }, + // { name: "lightestColor", title: "Lightest Color" }, + // { name: "highlightColor", title: "Highlight Color" }, + // { name: "medianColor", title: "Median Color" }, + ].map((palette) => ( + + ))}