From 13a53c020b33eb9ddea04c6458a025ad6519bf44 Mon Sep 17 00:00:00 2001 From: "GitStart-Cal.com" <121884634+gitstart-calcom@users.noreply.github.com> Date: Mon, 3 Apr 2023 05:20:44 +0000 Subject: [PATCH] [CAL-1094] Embed modal / Inline - UI/Layout/Spacing issues (#7350) Co-authored-by: gitstart-calcom --- apps/web/components/Embed.tsx | 153 ++++++++---------- apps/web/public/static/locales/en/common.json | 2 +- .../form/color-picker/colorpicker.tsx | 8 +- 3 files changed, 75 insertions(+), 88 deletions(-) diff --git a/apps/web/components/Embed.tsx b/apps/web/components/Embed.tsx index 4d5a45f3e0..8112a38847 100644 --- a/apps/web/components/Embed.tsx +++ b/apps/web/components/Embed.tsx @@ -1,4 +1,4 @@ -import { Collapsible, CollapsibleContent, CollapsibleTrigger } from "@radix-ui/react-collapsible"; +import { Collapsible, CollapsibleContent } from "@radix-ui/react-collapsible"; import classNames from "classnames"; import type { NextRouter } from "next/router"; import { useRouter } from "next/router"; @@ -22,7 +22,7 @@ import { TextField, ColorPicker, } from "@calcom/ui"; -import { FiCode, FiTrello, FiSun, FiArrowLeft, FiChevronRight } from "@calcom/ui/components/icon"; +import { FiCode, FiTrello, FiSun, FiArrowLeft } from "@calcom/ui/components/icon"; import Select from "@components/ui/form/Select"; @@ -313,7 +313,7 @@ const embeds: { }[] = [ { title: "Inline Embed", - subtitle: "Loads your Cal scheduling page directly inline with your other website content", + subtitle: "Loads your event type directly inline with your other website content.", type: "inline", illustration: ( +
- -
-
-
+

{embed.subtitle}

+
+
setIsEmbedCustomizationOpen((val) => !val)}> - -
- {embedType === "inline" - ? "Inline Embed Customization" - : embedType === "floating-popup" - ? "Floating Popup Customization" - : "Element Click Customization"} -
- -
-
+
{/*TODO: Add Auto/Fixed toggle from Figma */} -
Embed Window Sizing
-
- { - setPreviewState((previewState) => { - const width = e.target.value || "100%"; +
Window sizing
+
+
+ { + setPreviewState((previewState) => { + const width = e.target.value || "100%"; + + return { + ...previewState, + inline: { + ...previewState.inline, + width, + }, + }; + }); + }} + addOnLeading={<>W} + /> +
- return { - ...previewState, - inline: { - ...previewState.inline, - width, - }, - }; - }); - }} - addOnLeading={<>W} - /> - × { @@ -1007,22 +1002,13 @@ const EmbedTypeCodeAndPreviewDialogContent = ({
-
-
+
setIsBookingCustomizationOpen((val) => !val)}> - -
Cal Booking Customization
- -
-
+
{ @@ -1036,13 +1022,38 @@ const EmbedTypeCodeAndPreviewDialogContent = ({ />
{t("hide_eventtype_details")}
-