From 8617f43a8e23898504d4d8aa4ff99faaff69e7d8 Mon Sep 17 00:00:00 2001 From: Udit Takkar <53316345+Udit-takkar@users.noreply.github.com> Date: Fri, 16 Feb 2024 16:24:31 +0530 Subject: [PATCH] chore: add toast and tooltip (#13724) * chore: add toast and tooltop * chore: update text --- apps/web/components/eventtype/EventAdvancedTab.tsx | 12 +++++++++++- apps/web/public/static/locales/en/common.json | 2 +- packages/ui/components/form/switch/Switch.tsx | 5 +++-- 3 files changed, 15 insertions(+), 4 deletions(-) diff --git a/apps/web/components/eventtype/EventAdvancedTab.tsx b/apps/web/components/eventtype/EventAdvancedTab.tsx index d45247eb24..78f4a5c37e 100644 --- a/apps/web/components/eventtype/EventAdvancedTab.tsx +++ b/apps/web/components/eventtype/EventAdvancedTab.tsx @@ -1,3 +1,4 @@ +import { InfoIcon } from "lucide-react"; import dynamic from "next/dynamic"; import Link from "next/link"; import type { EventTypeSetupProps, FormValues } from "pages/event-types/[type]"; @@ -179,11 +180,20 @@ export const EventAdvancedTab = ({ eventType, team }: Pick + {t("display_add_to_calendar_organizer")} + + + } checked={useEventTypeDestinationCalendarEmail} onCheckedChange={(val) => { setUseEventTypeDestinationCalendarEmail(val); formMethods.setValue("useEventTypeDestinationCalendarEmail", val, { shouldDirty: true }); + if (val) { + showToast(t("reconnect_calendar_to_use"), "warning"); + } }} /> diff --git a/apps/web/public/static/locales/en/common.json b/apps/web/public/static/locales/en/common.json index aa8494d7b9..b8cbed57df 100644 --- a/apps/web/public/static/locales/en/common.json +++ b/apps/web/public/static/locales/en/common.json @@ -808,7 +808,7 @@ "label": "Label", "placeholder": "Placeholder", "display_add_to_calendar_organizer":"Display 'Add to calendar' email as the organizer", - "reconnect_calendar_to_use": "Please note that you may need to disconnect and then reconnect your calendar to use this feature.", + "reconnect_calendar_to_use": "Please note that you may need to disconnect and then reconnect your 'Add to Calendar' account to use this feature.", "type": "Type", "edit": "Edit", "add_input": "Add an Input", diff --git a/packages/ui/components/form/switch/Switch.tsx b/packages/ui/components/form/switch/Switch.tsx index 7fa67084b2..68e332b118 100644 --- a/packages/ui/components/form/switch/Switch.tsx +++ b/packages/ui/components/form/switch/Switch.tsx @@ -1,6 +1,7 @@ import { useId } from "@radix-ui/react-id"; import * as Label from "@radix-ui/react-label"; import * as PrimitiveSwitch from "@radix-ui/react-switch"; +import type { ReactNode } from "react"; import React from "react"; import cx from "@calcom/lib/classNames"; @@ -15,7 +16,7 @@ const Wrapper = ({ children, tooltip }: { tooltip?: string; children: React.Reac }; const Switch = ( props: React.ComponentProps & { - label?: string; + label?: string | ReactNode; fitToHeight?: boolean; disabled?: boolean; tooltip?: string; @@ -44,7 +45,7 @@ const Switch = ( className={cx( isChecked ? "bg-brand-default dark:bg-brand-emphasis" : "bg-emphasis", primitiveProps.disabled && "cursor-not-allowed", - "focus:ring-brand-default focus:border-subtle h-5 w-[34px] rounded-full shadow-none focus:outline-none focus:ring-2 focus:ring-neutral-800 focus:ring-offset-1", + "focus:ring-brand-default focus:border-subtle h-5 w-[34px] min-w-[34px] rounded-full shadow-none focus:outline-none focus:ring-2 focus:ring-neutral-800 focus:ring-offset-1", props.className )} {...primitiveProps}>