diff --git a/apps/web/components/Embed.tsx b/apps/web/components/Embed.tsx
index 72add48117..44d5fa5d1f 100644
--- a/apps/web/components/Embed.tsx
+++ b/apps/web/components/Embed.tsx
@@ -1,5 +1,6 @@
import { Collapsible, CollapsibleContent } from "@radix-ui/react-collapsible";
import classNames from "classnames";
+import type { TFunction } from "next-i18next";
import type { NextRouter } from "next/router";
import { useRouter } from "next/router";
import type { MutableRefObject, RefObject } from "react";
@@ -21,11 +22,10 @@ import {
TextArea,
TextField,
ColorPicker,
+ Select,
} from "@calcom/ui";
import { Code, Trello, Sun, ArrowLeft } from "@calcom/ui/components/icon";
-import Select from "@components/ui/form/Select";
-
type EmbedType = "inline" | "floating-popup" | "element-click";
type EmbedFramework = "react" | "HTML";
@@ -305,190 +305,189 @@ const getEmbedTypeSpecificString = ({
return "";
};
-const embeds: {
- illustration: React.ReactElement;
- title: string;
- subtitle: string;
- type: EmbedType;
-}[] = [
- {
- title: "Inline Embed",
- subtitle: "Loads your event type directly inline with your other website content.",
- type: "inline",
- illustration: (
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- ),
- },
- {
- title: "Floating pop-up button",
- subtitle: "Adds a floating button on your site that launches Cal in a dialog.",
- type: "floating-popup",
- illustration: (
-
-
-
-
-
-
-
-
-
-
- ),
- },
- {
- title: "Pop up via element click",
- subtitle: "Open your Cal dialog when someone clicks an element.",
- type: "element-click",
- illustration: (
-
-
-
-
-
-
-
-
-
-
-
-
+const embeds = (t: TFunction) =>
+ (() => {
+ return [
+ {
+ title: t("inline_embed"),
+ subtitle: t("load_inline_content"),
+ type: "inline",
+ illustration: (
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ),
+ },
+ {
+ title: t("floating_pop_up_button"),
+ subtitle: t("floating_button_trigger_modal"),
+ type: "floating-popup",
+ illustration: (
+
+
+
+
+
+
+
+
+
+
+ ),
+ },
+ {
+ title: t("pop_up_element_click"),
+ subtitle: t("open_dialog_with_element_click"),
+ type: "element-click",
+ illustration: (
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ),
+ },
+ ];
+ })();
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- ),
- },
-];
const tabs = [
{
name: "HTML",
@@ -534,11 +533,7 @@ ${getEmbedTypeSpecificString({ embedFramework: "HTML", embedType, calLink, previ
`
}
/>
-
- {t(
- "Need help? See our guides for embedding Cal on Wix, Squarespace, or WordPress, check our common questions, or explore advanced embed options."
- )}
-
+ {t("need_help_embedding")}
>
);
}),
@@ -622,7 +617,7 @@ Cal("init", {origin:"${WEBAPP_URL}"});
const ThemeSelectControl = ({ children, ...props }: ControlProps<{ value: Theme; label: string }, false>) => {
return (
-
+
{children}
);
@@ -642,7 +637,7 @@ const ChooseEmbedTypesDialogContent = () => {
- {embeds.map((embed, index) => (
+ {embeds(t).map((embed, index) => (
embed.type === embedType);
+ const embed = embeds(t).find((embed) => embed.type === embedType);
const [isEmbedCustomizationOpen, setIsEmbedCustomizationOpen] = useState(true);
const [isBookingCustomizationOpen, setIsBookingCustomizationOpen] = useState(true);
@@ -806,11 +801,11 @@ const EmbedTypeCodeAndPreviewDialogContent = ({
const FloatingPopupPositionOptions = [
{
value: "bottom-right",
- label: "Bottom Right",
+ label: "Bottom right",
},
{
value: "bottom-left",
- label: "Bottom Left",
+ label: "Bottom left",
},
];
@@ -834,7 +829,7 @@ const EmbedTypeCodeAndPreviewDialogContent = ({
{embed.title}
-
{embed.subtitle}
+
{embed.subtitle}
{/*TODO: Add Auto/Fixed toggle from Figma */}
Window sizing
-
+
-
Button Text
+
Button text
{/* Default Values should come from preview iframe */}
@@ -935,14 +930,14 @@ const EmbedTypeCodeAndPreviewDialogContent = ({
});
}}
/>
- Display Calendar Icon Button
+ Display calendar icon
-
Position of Button
+
Position of button
{
setPreviewState((previewState) => {
@@ -959,54 +954,50 @@ const EmbedTypeCodeAndPreviewDialogContent = ({
options={FloatingPopupPositionOptions}
/>
-
-
Button Color
-
-
{
- setPreviewState((previewState) => {
- return {
- ...previewState,
- floatingPopup: {
- ...previewState.floatingPopup,
- buttonColor: color,
- },
- };
- });
- }}
- />
+
+
+
Button color
+
+ {
+ setPreviewState((previewState) => {
+ return {
+ ...previewState,
+ floatingPopup: {
+ ...previewState.floatingPopup,
+ buttonColor: color,
+ },
+ };
+ });
+ }}
+ />
+
-
-
-
Text Color
-
-
{
- setPreviewState((previewState) => {
- return {
- ...previewState,
- floatingPopup: {
- ...previewState.floatingPopup,
- buttonTextColor: color,
- },
- };
- });
- }}
- />
+
+
Text color
+
+ {
+ setPreviewState((previewState) => {
+ return {
+ ...previewState,
+ floatingPopup: {
+ ...previewState.floatingPopup,
+ buttonTextColor: color,
+ },
+ };
+ });
+ }}
+ />
+
@@ -1017,7 +1008,30 @@ const EmbedTypeCodeAndPreviewDialogContent = ({
open={isBookingCustomizationOpen}
onOpenChange={() => setIsBookingCustomizationOpen((val) => !val)}>
-
+
+
+ Theme
+ null,
+ }}
+ onChange={(option) => {
+ if (!option) {
+ return;
+ }
+ setPreviewState((previewState) => {
+ return {
+ ...previewState,
+ theme: option.value,
+ };
+ });
+ }}
+ options={ThemeOptions}
+ />
+
))}
-
- Theme
- null,
- }}
- onChange={(option) => {
- if (!option) {
- return;
- }
- setPreviewState((previewState) => {
- return {
- ...previewState,
- theme: option.value,
- };
- });
- }}
- options={ThemeOptions}
- />
-
diff --git a/apps/web/public/static/locales/en/common.json b/apps/web/public/static/locales/en/common.json
index c001b9ddde..a56327020f 100644
--- a/apps/web/public/static/locales/en/common.json
+++ b/apps/web/public/static/locales/en/common.json
@@ -1800,5 +1800,13 @@
"payment_app_commission": "Require payment ({{paymentFeePercentage}}% + {{fee, currency}} commission per transaction)",
"email_invite_team": "{{email}} has been invited",
"error_collecting_card": "Error collecting card",
- "image_size_limit_exceed": "Uploaded image shouldn't exceed 5mb size limit"
+ "image_size_limit_exceed": "Uploaded image shouldn't exceed 5mb size limit",
+ "inline_embed": "Inline Embed",
+ "load_inline_content": "Loads your event type directly inline with your other website content.",
+ "floating_pop_up_button": "Floating pop-up button",
+ "floating_button_trigger_modal": "Puts a floating button on your site that triggers a modal with your event type.",
+ "pop_up_element_click": "Pop up via element click",
+ "open_dialog_with_element_click": "Open your Cal dialog when someone clicks an element.",
+ "need_help_embedding": "Need help? See our guides for embedding Cal on Wix, Squarespace, or WordPress, check our common questions, or explore advanced embed options.",
+ "book_my_cal": "Book my Cal"
}
diff --git a/packages/ui/components/form/color-picker/colorpicker.tsx b/packages/ui/components/form/color-picker/colorpicker.tsx
index e1e473ae3b..99630c2840 100644
--- a/packages/ui/components/form/color-picker/colorpicker.tsx
+++ b/packages/ui/components/form/color-picker/colorpicker.tsx
@@ -2,6 +2,7 @@ import * as Popover from "@radix-ui/react-popover";
import { useState } from "react";
import { HexColorInput, HexColorPicker } from "react-colorful";
+import cx from "@calcom/lib/classNames";
import { fallBackHex, isValidHexCode } from "@calcom/lib/getBrandColours";
export type ColorPickerProps = {
@@ -9,6 +10,7 @@ export type ColorPickerProps = {
onChange: (text: string) => void;
container?: HTMLElement;
popoverAlign?: React.ComponentProps
["align"];
+ className?: string;
};
const ColorPicker = (props: ColorPickerProps) => {
@@ -44,7 +46,10 @@ const ColorPicker = (props: ColorPickerProps) => {
{
setColor(val);