fix: routing form delete button not rendered (#7424)
This commit is contained in:
1 parent
4e1e2577eb
commit
2f8280a6ee
3 files changed
+14
-8
No files matched your search
@@ -219,7 +219,7 @@ function Dialogs({
|
||||
isLoading={deleteMutation.isLoading}
|
||||
variety="danger"
|
||||
title={t("delete_form")}
|
||||
confirmBtn={t("delete_form_action")}
|
||||
confirmBtnText={t("delete_form_action")}
|
||||
loadingText={t("delete_form_action")}
|
||||
onConfirm={(e) => {
|
||||
if (!deleteDialogFormId) {
|
||||
@@ -230,7 +230,10 @@ function Dialogs({
|
||||
id: deleteDialogFormId,
|
||||
});
|
||||
}}>
|
||||
{t("delete_form_confirmation")}
|
||||
<ul className="list-disc pl-3">
|
||||
<li> {t("delete_form_confirmation")}</li>
|
||||
<li> {t("delete_form_confirmation_2")}</li>
|
||||
</ul>
|
||||
</ConfirmationDialogContent>
|
||||
</Dialog>
|
||||
<NewFormDialog appUrl={appUrl} />
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import * as DialogPrimitive from "@radix-ui/react-dialog";
|
||||
import type { PropsWithChildren, ReactNode } from "react";
|
||||
import type { PropsWithChildren, ReactElement } from "react";
|
||||
import React from "react";
|
||||
|
||||
import { useLocale } from "@calcom/lib/hooks/useLocale";
|
||||
@@ -7,16 +7,18 @@ import { useLocale } from "@calcom/lib/hooks/useLocale";
|
||||
import { FiAlertCircle, FiCheck } from "../icon";
|
||||
import { DialogClose, DialogContent } from "./Dialog";
|
||||
|
||||
type ConfirmBtnType =
|
||||
| { confirmBtn?: never; confirmBtnText?: string }
|
||||
| { confirmBtnText?: never; confirmBtn?: ReactElement };
|
||||
|
||||
export type ConfirmationDialogContentProps = {
|
||||
confirmBtn?: ReactNode;
|
||||
confirmBtnText?: string;
|
||||
cancelBtnText?: string;
|
||||
isLoading?: boolean;
|
||||
loadingText?: string;
|
||||
onConfirm?: (event: React.MouseEvent<HTMLElement, MouseEvent>) => void;
|
||||
title: string;
|
||||
variety?: "danger" | "warning" | "success";
|
||||
};
|
||||
} & ConfirmBtnType;
|
||||
|
||||
export function ConfirmationDialogContent(props: PropsWithChildren<ConfirmationDialogContentProps>) {
|
||||
const { t } = useLocale();
|
||||
|
||||
Reference in new issue
Block a user