Skip to content

Scheduling infrastructure for absolutely everyone.

fix: disable all emails modal crash on platform (#17485)

Somay Chauhan21aaff01fa53
diff --git a/apps/web/components/eventtype/settings/DisableAllEmailsSetting.tsx b/apps/web/components/eventtype/settings/DisableAllEmailsSetting.tsx
deleted file mode 100644
index 453967a0878..00000000000
--- a/apps/web/components/eventtype/settings/DisableAllEmailsSetting.tsx
+++ /dev/null
@@ -1,82 +0,0 @@
-import type { TFunction } from "next-i18next";
-import { Trans } from "next-i18next";
-import { useState } from "react";
-
-import {
- SettingsToggle,
- Dialog,
- DialogContent,
- DialogFooter,
- InputField,
- DialogClose,
- Button,
-} from "@calcom/ui";
-
-interface DisableEmailsSettingProps {
- checked: boolean;
- onCheckedChange: (e: boolean) => void;
- recipient: "attendees" | "hosts";
- t: TFunction;
-}
-
-export const DisableAllEmailsSetting = ({
- checked,
- onCheckedChange,
- recipient,
- t,
-}: DisableEmailsSettingProps) => {
- const [dialogOpen, setDialogOpen] = useState(false);
- const [confirmText, setConfirmText] = useState("");
-
- const title =
- recipient === "attendees" ? t("disable_all_emails_to_attendees") : t("disable_all_emails_to_hosts");
-
- return (
- <div>
- <Dialog open={dialogOpen} onOpenChange={(e) => setDialogOpen(e)}>
- <DialogContent title={title} Icon="circle-alert">
- <p className="text-default text-sm">
- <Trans i18nKey="disable_attendees_emails_description">
- This will disable all emails to {{ recipient }}. This includes booking confirmations, requests,
- reschedules and reschedule requests, cancellation emails, and any other emails related to
- booking updates.
- <br />
- <br />
- It is your responsibility to ensure that your {{ recipient }} are aware of any bookings and
- changes to their bookings.
- </Trans>
- </p>
- <p className="text-default mb-1 mt-2 text-sm">{t("type_confirm_to_continue")}</p>
- <InputField
- value={confirmText}
- onChange={(e) => {
- setConfirmText(e.target.value);
- }}
- />
- <DialogFooter>
- <DialogClose />
- <Button
- disabled={confirmText !== "confirm"}
- onClick={(e) => {
- onCheckedChange(true);
- setDialogOpen(false);
- }}>
- {t("disable_email")}
- </Button>
- </DialogFooter>
- </DialogContent>
- </Dialog>
- <SettingsToggle
- labelClassName="text-sm"
- toggleSwitchAtTheEnd={true}
- switchContainerClassName="border-subtle rounded-lg border py-6 px-4 sm:px-6"
- title={title}
- description={t("disable_all_emails_description")}
- checked={!!checked}
- onCheckedChange={() => {
- checked ? onCheckedChange(!checked) : setDialogOpen(true);
- }}
- />
- </div>
- );
-};
diff --git a/packages/features/eventtypes/components/tabs/advanced/DisableAllEmailsSetting.tsx b/packages/features/eventtypes/components/tabs/advanced/DisableAllEmailsSetting.tsx
index 453967a0878..fe41a90238c 100644
--- a/packages/features/eventtypes/components/tabs/advanced/DisableAllEmailsSetting.tsx
+++ b/packages/features/eventtypes/components/tabs/advanced/DisableAllEmailsSetting.tsx
@@ -37,13 +37,13 @@ export const DisableAllEmailsSetting = ({
<DialogContent title={title} Icon="circle-alert">
<p className="text-default text-sm">
<Trans i18nKey="disable_attendees_emails_description">
- This will disable all emails to {{ recipient }}. This includes booking confirmations, requests,
+ This will disable all emails to {recipient}. This includes booking confirmations, requests,
reschedules and reschedule requests, cancellation emails, and any other emails related to
booking updates.
<br />
<br />
- It is your responsibility to ensure that your {{ recipient }} are aware of any bookings and
- changes to their bookings.
+ It is your responsibility to ensure that your {recipient} are aware of any bookings and changes
+ to their bookings.
</Trans>
</p>
<p className="text-default mb-1 mt-2 text-sm">{t("type_confirm_to_continue")}</p>