diff --git a/apps/web/components/Embed.tsx b/apps/web/components/Embed.tsx index 761cb87610..7d431cfc49 100644 --- a/apps/web/components/Embed.tsx +++ b/apps/web/components/Embed.tsx @@ -44,6 +44,7 @@ type PreviewState = { palette: { brandColor: string; }; + hideEventTypeDetails: boolean; }; const queryParamsForDialog = ["embedType", "embedTabName", "embedUrl"]; @@ -125,10 +126,12 @@ const getEmbedUIInstructionString = ({ apiName, theme, brandColor, + hideEventTypeDetails, }: { apiName: string; theme?: string; brandColor: string; + hideEventTypeDetails: boolean; }) => { theme = theme !== "auto" ? theme : undefined; return getInstructionString({ @@ -141,6 +144,7 @@ const getEmbedUIInstructionString = ({ brandColor, }, }, + hideEventTypeDetails: hideEventTypeDetails, }, }); }; @@ -253,18 +257,21 @@ const getEmbedTypeSpecificString = ({ apiName: string; theme: PreviewState["theme"]; brandColor: string; + hideEventTypeDetails: boolean; }; if (embedFramework === "react") { uiInstructionStringArg = { apiName: "cal", theme: previewState.theme, brandColor: previewState.palette.brandColor, + hideEventTypeDetails: previewState.hideEventTypeDetails, }; } else { uiInstructionStringArg = { apiName: "Cal", theme: previewState.theme, brandColor: previewState.palette.brandColor, + hideEventTypeDetails: previewState.hideEventTypeDetails, }; } if (!frameworkCodes[embedType]) { @@ -689,6 +696,7 @@ const EmbedTypeCodeAndPreviewDialogContent = ({ theme: Theme.auto, floatingPopup: {}, elementClick: {}, + hideEventTypeDetails: false, palette: { brandColor: "#000000", }, @@ -753,6 +761,7 @@ const EmbedTypeCodeAndPreviewDialogContent = ({ name: "ui", arg: { theme: previewState.theme, + hideEventTypeDetails: previewState.hideEventTypeDetails, styles: { branding: { ...previewState.palette, @@ -811,7 +820,7 @@ const EmbedTypeCodeAndPreviewDialogContent = ({ {embed.title}
-
+
Embed Window Sizing
× { @@ -888,7 +895,6 @@ const EmbedTypeCodeAndPreviewDialogContent = ({
Button Text
{/* Default Values should come from preview iframe */} { setPreviewState((previewState) => { @@ -1004,6 +1010,20 @@ const EmbedTypeCodeAndPreviewDialogContent = ({
+
+ { + setPreviewState((previewState) => { + return { + ...previewState, + hideEventTypeDetails: checked, + }; + }); + }} + /> +
{t("hide_eventtype_details")}
+
+
+ )}
-
- - {stripeAppData.price > 0 && ( -

- - - - -

- )} - {!rescheduleUid && eventType.recurringEvent?.freq && recurringEventCount && ( -
- -

- {getEveryFreqFor({ - t, - recurringEvent: eventType.recurringEvent, - recurringCount: recurringEventCount, - })} + {showEventTypeDetails && ( +

+ + {stripeAppData.price > 0 && ( +

+ + + +

-
- )} -
- -
- {(rescheduleUid || !eventType.recurringEvent?.freq) && `${parseDate(date, i18n)}`} - {!rescheduleUid && - eventType.recurringEvent?.freq && - recurringStrings.slice(0, 5).map((timeFormatted, key) => { - return

{timeFormatted}

; - })} - {!rescheduleUid && eventType.recurringEvent?.freq && recurringStrings.length > 5 && ( -
- ( -

{timeFormatted}

- ))}> -

- + {t("plus_more", { count: recurringStrings.length - 5 })} -

-
-
- )} -
-
- {booking?.startTime && rescheduleUid && ( -
-

- {t("former_time")} -

-

- - {typeof booking.startTime === "string" && parseDate(dayjs(booking.startTime), i18n)} -

-
- )} - {!!eventType.seatsPerTimeSlot && ( + )} + {!rescheduleUid && eventType.recurringEvent?.freq && recurringEventCount && ( +
+ +

+ {getEveryFreqFor({ + t, + recurringEvent: eventType.recurringEvent, + recurringCount: recurringEventCount, + })} +

+
+ )}
- = 0.5 - ? "text-rose-600" - : booking && booking.attendees.length / eventType.seatsPerTimeSlot >= 0.33 - ? "text-yellow-500" - : "text-bookinghighlight" - }`} - /> -

= 0.5 - ? "text-rose-600" - : booking && booking.attendees.length / eventType.seatsPerTimeSlot >= 0.33 - ? "text-yellow-500" - : "text-bookinghighlight" - } mb-2 font-medium`}> - {booking - ? eventType.seatsPerTimeSlot - booking.attendees.length - : eventType.seatsPerTimeSlot}{" "} - / {eventType.seatsPerTimeSlot} {t("seats_available")} -

+ +
+ {(rescheduleUid || !eventType.recurringEvent?.freq) && `${parseDate(date, i18n)}`} + {!rescheduleUid && + eventType.recurringEvent?.freq && + recurringStrings.slice(0, 5).map((timeFormatted, key) => { + return

{timeFormatted}

; + })} + {!rescheduleUid && eventType.recurringEvent?.freq && recurringStrings.length > 5 && ( +
+ ( +

{timeFormatted}

+ ))}> +

+ + {t("plus_more", { count: recurringStrings.length - 5 })} +

+
+
+ )} +
- )} - -
-
+ {booking?.startTime && rescheduleUid && ( +
+

+ {t("former_time")} +

+

+ + {typeof booking.startTime === "string" && parseDate(dayjs(booking.startTime), i18n)} +

+
+ )} + {!!eventType.seatsPerTimeSlot && ( +
+ = 0.5 + ? "text-rose-600" + : booking && booking.attendees.length / eventType.seatsPerTimeSlot >= 0.33 + ? "text-yellow-500" + : "text-bookinghighlight" + }`} + /> +

= 0.5 + ? "text-rose-600" + : booking && booking.attendees.length / eventType.seatsPerTimeSlot >= 0.33 + ? "text-yellow-500" + : "text-bookinghighlight" + } mb-2 font-medium`}> + {booking + ? eventType.seatsPerTimeSlot - booking.attendees.length + : eventType.seatsPerTimeSlot}{" "} + / {eventType.seatsPerTimeSlot} {t("seats_available")} +

+
+ )} + +
+ )} +
+ Render All embeds together - It would be slow to load +
+ +

Popup Examples

@@ -90,35 +99,28 @@ + -
+
+

Inline Embed Examples

-
-

- Default Namespace(Cal)[Dark Theme][inline][Guests(janedoe@example.com and test@example.com)] -

- +
+

+ [Dark Theme][Guests(janedoe@example.com and test@example.com)] +

You would see last Booking page action in my place
-
Loading .....
+
-
-

Namespace "second"(Cal.ns.second)[Custom Styling][inline]

- - - You would see last Booking page action in my place - +
+

[Custom Styling]

If you render booking embed in me, I won't restrict you. The entire page is yours. Content is by default aligned center
- -
-

Namespace "third"(Cal.ns.third)[inline][Custom Styling - Transparent Background]

- - - You would see last Booking page action in my place - +
+

[Custom Styling - Transparent Background]

If you render booking embed in me, I would not let you be more than 30% wide
-
Loading .....
- -
-

Namespace "fourth"(Cal.ns.fourth)[Team Event Test][inline taking entire width]

- - - You would see last Booking page action in my place - +
+

[Team Event Test][inline taking entire width]

If you render booking embed in me, I would not let you be more than 30% wide
-
Loading .....
-
-

Namespace "fifth"(Cal.ns.fifth)[Team Event Test][inline along with some content]

- - - You would see last Booking page action in my place - +
+

[Team Event Test][inline along with some content]

-

+

On the right side you can book a team meeting => -

+
-
-

Inline Routing Form

- - - You would see last Booking page action in my place - +
+

Inline Routing Form

-

+

On the right side you can book a team meeting => -

+
+ +