Dialog Api improvements (#5714)
This commit is contained in:
1 parent
26d675e162
commit
7ebea57602
33 files changed
+218
-312
No files matched your search
@@ -120,9 +120,7 @@ function NewFormDialog({ appUrl }: { appUrl: string }) {
|
||||
<Button loading={mutation.isLoading} data-testid="add-form" type="submit">
|
||||
{t("continue")}
|
||||
</Button>
|
||||
<DialogClose asChild>
|
||||
<Button color="secondary">{t("cancel")}</Button>
|
||||
</DialogClose>
|
||||
<DialogClose />
|
||||
</div>
|
||||
</Form>
|
||||
</DialogContent>
|
||||
|
||||
@@ -379,16 +379,14 @@ function SingleForm({ form, appUrl, Page }: SingleFormComponentProps) {
|
||||
)}
|
||||
</div>
|
||||
<DialogFooter>
|
||||
<DialogClose asChild>
|
||||
<Button
|
||||
color="secondary"
|
||||
onClick={() => {
|
||||
setIsTestPreviewOpen(false);
|
||||
setDecidedAction(null);
|
||||
setResponse({});
|
||||
}}>
|
||||
{t("close")}
|
||||
</Button>
|
||||
<DialogClose
|
||||
color="secondary"
|
||||
onClick={() => {
|
||||
setIsTestPreviewOpen(false);
|
||||
setDecidedAction(null);
|
||||
setResponse({});
|
||||
}}>
|
||||
{t("close")}
|
||||
</DialogClose>
|
||||
<Button type="submit" data-testid="test-routing">
|
||||
{t("test_routing")}
|
||||
|
||||
@@ -187,13 +187,12 @@ export const SearchDialog = (props: ISearchDialog) => {
|
||||
)}
|
||||
<DialogFooter>
|
||||
<DialogClose
|
||||
color="minimal"
|
||||
tabIndex={-1}
|
||||
onClick={() => {
|
||||
props.setIsOpenDialog(false);
|
||||
}}
|
||||
asChild>
|
||||
<Button type="button" color="minimal" tabIndex={-1}>
|
||||
{t("cancel")}
|
||||
</Button>
|
||||
}}>
|
||||
{t("cancel")}
|
||||
</DialogClose>
|
||||
|
||||
<Button
|
||||
|
||||
@@ -15,13 +15,13 @@ export function AccountDialog(props: DialogProps) {
|
||||
|
||||
<DialogFooter>
|
||||
<DialogClose
|
||||
type="button"
|
||||
color="secondary"
|
||||
tabIndex={-1}
|
||||
onClick={() => {
|
||||
props.onOpenChange?.(false);
|
||||
}}
|
||||
asChild>
|
||||
<Button type="button" color="secondary" tabIndex={-1}>
|
||||
Cancel
|
||||
</Button>
|
||||
}}>
|
||||
Cancel
|
||||
</DialogClose>
|
||||
|
||||
<Button type="button" onClick={() => mutation.mutate("")}>
|
||||
|
||||
@@ -174,7 +174,7 @@ export default function SAMLConfiguration({ teamId }: { teamId: number | null })
|
||||
|
||||
{/* Add/Update SAML Connection */}
|
||||
<Dialog open={configModal} onOpenChange={setConfigModal}>
|
||||
<DialogContent type="creation" useOwnActionButtons>
|
||||
<DialogContent type="creation">
|
||||
<ConfigDialogForm handleClose={() => setConfigModal(false)} teamId={teamId} />
|
||||
</DialogContent>
|
||||
</Dialog>
|
||||
|
||||
@@ -67,7 +67,7 @@ export default function MemberChangeRoleModal(props: {
|
||||
}
|
||||
return (
|
||||
<Dialog open={props.isOpen} onOpenChange={props.onExit}>
|
||||
<DialogContent type="creation" useOwnActionButtons size="md">
|
||||
<DialogContent type="creation" size="md">
|
||||
<>
|
||||
<div className="mb-4 sm:flex sm:items-start">
|
||||
<div className="text-center sm:text-left">
|
||||
|
||||
@@ -66,7 +66,6 @@ export default function MemberInvitationModal(props: MemberInvitationModalProps)
|
||||
}}>
|
||||
<DialogContent
|
||||
type="creation"
|
||||
useOwnActionButtons
|
||||
title={t("invite_new_member")}
|
||||
description={
|
||||
IS_TEAM_BILLING_ENABLED ? (
|
||||
|
||||
@@ -13,6 +13,7 @@ import {
|
||||
ConfirmationDialogContent,
|
||||
Dialog,
|
||||
DialogContent,
|
||||
DialogFooter,
|
||||
DialogTrigger,
|
||||
Dropdown,
|
||||
DropdownItem,
|
||||
@@ -258,11 +259,11 @@ export default function MemberListItem(props: Props) {
|
||||
)}
|
||||
{showTeamAvailabilityModal && (
|
||||
<Dialog open={showTeamAvailabilityModal} onOpenChange={() => setShowTeamAvailabilityModal(false)}>
|
||||
<DialogContent type="creation" useOwnActionButtons size="md">
|
||||
<DialogContent type="creation" size="md">
|
||||
<TeamAvailabilityModal team={props.team} member={props.member} />
|
||||
<div className="flex justify-end border-t pt-5">
|
||||
<DialogFooter>
|
||||
<Button onClick={() => setShowTeamAvailabilityModal(false)}>{t("done")}</Button>
|
||||
</div>
|
||||
</DialogFooter>
|
||||
</DialogContent>
|
||||
</Dialog>
|
||||
)}
|
||||
|
||||
@@ -102,7 +102,7 @@ export const AddActionDialog = (props: IAddActionDialog) => {
|
||||
|
||||
return (
|
||||
<Dialog open={isOpenDialog} onOpenChange={setIsOpenDialog}>
|
||||
<DialogContent type="creation" useOwnActionButtons={true} title={t("add_action")}>
|
||||
<DialogContent type="creation" title={t("add_action")}>
|
||||
<div className="space-x-3 ">
|
||||
<div className="pt-1">
|
||||
<Form
|
||||
@@ -188,21 +188,17 @@ export const AddActionDialog = (props: IAddActionDialog) => {
|
||||
</div>
|
||||
)}
|
||||
<DialogFooter>
|
||||
<DialogClose asChild>
|
||||
<Button
|
||||
color="secondary"
|
||||
onClick={() => {
|
||||
setIsOpenDialog(false);
|
||||
form.unregister("sendTo");
|
||||
form.unregister("action");
|
||||
form.unregister("numberRequired");
|
||||
setIsPhoneNumberNeeded(false);
|
||||
setIsEmailAddressNeeded(false);
|
||||
setIsSenderIdNeeded(false);
|
||||
}}>
|
||||
{t("cancel")}
|
||||
</Button>
|
||||
</DialogClose>
|
||||
<DialogClose
|
||||
onClick={() => {
|
||||
setIsOpenDialog(false);
|
||||
form.unregister("sendTo");
|
||||
form.unregister("action");
|
||||
form.unregister("numberRequired");
|
||||
setIsPhoneNumberNeeded(false);
|
||||
setIsEmailAddressNeeded(false);
|
||||
setIsSenderIdNeeded(false);
|
||||
}}
|
||||
/>
|
||||
<Button type="submit">{t("add")}</Button>
|
||||
</DialogFooter>
|
||||
</Form>
|
||||
|
||||
@@ -603,7 +603,7 @@ export default function WorkflowStepContainer(props: WorkflowStepProps) {
|
||||
</ConfirmationDialogContent>
|
||||
</Dialog>
|
||||
<Dialog open={isAdditionalInputsDialogOpen} onOpenChange={setIsAdditionalInputsDialogOpen}>
|
||||
<DialogContent useOwnActionButtons type="creation" className="sm:max-w-[610px] md:h-[570px]">
|
||||
<DialogContent type="creation" className="sm:max-w-[610px] md:h-[570px]">
|
||||
<div className="-m-3 h-[430px] overflow-x-hidden overflow-y-scroll sm:m-0">
|
||||
<h1 className="w-full text-xl font-semibold ">{t("how_additional_inputs_as_variables")}</h1>
|
||||
<div className="mb-7 mt-7 rounded-md bg-gray-50 p-3 sm:p-4">
|
||||
@@ -649,11 +649,7 @@ export default function WorkflowStepContainer(props: WorkflowStepProps) {
|
||||
</div>
|
||||
</div>
|
||||
<div className="flex flex-row-reverse">
|
||||
<DialogClose asChild>
|
||||
<Button color="primary" type="button">
|
||||
{t("close")}
|
||||
</Button>
|
||||
</DialogClose>
|
||||
<DialogClose color="primary" />
|
||||
</div>
|
||||
</DialogContent>
|
||||
</Dialog>
|
||||
|
||||
@@ -4,7 +4,17 @@ import { useForm } from "react-hook-form";
|
||||
import { useLocale } from "@calcom/lib/hooks/useLocale";
|
||||
import { HttpError } from "@calcom/lib/http-error";
|
||||
import { trpc } from "@calcom/trpc/react";
|
||||
import { Button, Dialog, DialogClose, DialogContent, DialogTrigger, Form, Icon, showToast } from "@calcom/ui";
|
||||
import {
|
||||
Button,
|
||||
Dialog,
|
||||
DialogClose,
|
||||
DialogContent,
|
||||
DialogFooter,
|
||||
DialogTrigger,
|
||||
Form,
|
||||
Icon,
|
||||
showToast,
|
||||
} from "@calcom/ui";
|
||||
|
||||
export function NewScheduleButton({ name = "new-schedule" }: { name?: string }) {
|
||||
const router = useRouter();
|
||||
@@ -78,14 +88,12 @@ export function NewScheduleButton({ name = "new-schedule" }: { name?: string })
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<div className="mt-8 flex flex-row-reverse gap-x-2">
|
||||
<DialogFooter>
|
||||
<Button type="submit" loading={createMutation.isLoading}>
|
||||
{t("continue")}
|
||||
</Button>
|
||||
<DialogClose asChild>
|
||||
<Button color="secondary">{t("cancel")}</Button>
|
||||
</DialogClose>
|
||||
</div>
|
||||
<DialogClose />
|
||||
</DialogFooter>
|
||||
</Form>
|
||||
</DialogContent>
|
||||
</Dialog>
|
||||
|
||||
@@ -1,86 +0,0 @@
|
||||
/**
|
||||
* @deprecated file
|
||||
* All new changes should be made to the V2 file in
|
||||
* `/packages/ui/v2/core/ConfirmationDialogContent.tsx`
|
||||
*/
|
||||
import * as DialogPrimitive from "@radix-ui/react-dialog";
|
||||
import React, { PropsWithChildren, ReactNode } from "react";
|
||||
|
||||
import { useLocale } from "@calcom/lib/hooks/useLocale";
|
||||
|
||||
import { Button, DialogClose, DialogContent, Icon } from ".";
|
||||
|
||||
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";
|
||||
};
|
||||
|
||||
/**
|
||||
* @deprecated file
|
||||
* All new changes should be made to the V2 file in
|
||||
* `/packages/ui/v2/core/ConfirmationDialogContent.tsx`
|
||||
*/
|
||||
export default function ConfirmationDialogContent(props: PropsWithChildren<ConfirmationDialogContentProps>) {
|
||||
const { t } = useLocale();
|
||||
const {
|
||||
title,
|
||||
variety,
|
||||
confirmBtn = null,
|
||||
confirmBtnText = t("confirm"),
|
||||
cancelBtnText = t("cancel"),
|
||||
loadingText = t("loading"),
|
||||
isLoading = false,
|
||||
onConfirm,
|
||||
children,
|
||||
} = props;
|
||||
|
||||
return (
|
||||
<DialogContent>
|
||||
<div className="flex">
|
||||
{variety && (
|
||||
<div className="mt-0.5 ltr:mr-3">
|
||||
{variety === "danger" && (
|
||||
<div className="mx-auto rounded-full bg-red-100 p-2 text-center">
|
||||
<Icon.FiAlertCircle className="h-5 w-5 text-red-600" />
|
||||
</div>
|
||||
)}
|
||||
{variety === "warning" && (
|
||||
<div className="mx-auto rounded-full bg-orange-100 p-2 text-center">
|
||||
<Icon.FiAlertCircle className="h-5 w-5 text-orange-600" />
|
||||
</div>
|
||||
)}
|
||||
{variety === "success" && (
|
||||
<div className="mx-auto rounded-full bg-green-100 p-2 text-center">
|
||||
<Icon.FiCheck className="h-5 w-5 text-green-600" />
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
)}
|
||||
<div>
|
||||
<DialogPrimitive.Title className="font-cal text-xl text-gray-900">{title}</DialogPrimitive.Title>
|
||||
<DialogPrimitive.Description className="text-sm text-neutral-500">
|
||||
{children}
|
||||
</DialogPrimitive.Description>
|
||||
</div>
|
||||
</div>
|
||||
<div className="mt-5 flex flex-row-reverse gap-x-2 sm:mt-8">
|
||||
<DialogClose disabled={isLoading} onClick={onConfirm} asChild>
|
||||
{confirmBtn || (
|
||||
<Button data-testid="confirm-button" color="primary" loading={isLoading}>
|
||||
{isLoading ? loadingText : confirmBtnText}
|
||||
</Button>
|
||||
)}
|
||||
</DialogClose>
|
||||
<DialogClose disabled={isLoading} asChild>
|
||||
<Button color="secondary">{cancelBtnText}</Button>
|
||||
</DialogClose>
|
||||
</div>
|
||||
</DialogContent>
|
||||
);
|
||||
}
|
||||
@@ -6,6 +6,7 @@ import { useLocale } from "@calcom/lib/hooks/useLocale";
|
||||
import { trpc } from "@calcom/trpc/react";
|
||||
|
||||
import { Dialog, DialogContent, showToast } from ".";
|
||||
import { DialogClose, DialogFooter } from "./Dialog";
|
||||
|
||||
export default function TimezoneChangeDialog() {
|
||||
const { t } = useLocale();
|
||||
@@ -58,20 +59,23 @@ export default function TimezoneChangeDialog() {
|
||||
|
||||
if (data?.user.impersonatedByUID) return null;
|
||||
|
||||
const ONE_DAY = 60 * 60 * 24; // 1 day in seconds (60 seconds * 60 minutes * 24 hours)
|
||||
const THREE_MONTHS = ONE_DAY * 90; // 90 days in seconds (90 days * 1 day in seconds)
|
||||
|
||||
return (
|
||||
<Dialog open={open} onOpenChange={setOpen}>
|
||||
<DialogContent
|
||||
title={t("update_timezone_question")}
|
||||
description={t("update_timezone_description", { formattedCurrentTz })}
|
||||
type="creation"
|
||||
actionText={t("update_timezone")}
|
||||
actionOnClick={() => updateTimezone()}
|
||||
closeText={t("dont_update")}
|
||||
onInteractOutside={() => onCancel(86400, false) /* 1 day expire */}
|
||||
actionOnClose={() => onCancel(7776000, true) /* 3 months expire */}>
|
||||
{/* todo: save this in db and auto-update when timezone changes (be able to disable??? if yes, /settings)
|
||||
onInteractOutside={() => onCancel(ONE_DAY, false) /* 1 day expire */}>
|
||||
{/* todo: save this in db and auto-update when timezone changes (be able to disable??? if yes, /settings)
|
||||
<Checkbox description="Always update timezone" />
|
||||
*/}
|
||||
<DialogFooter>
|
||||
<DialogClose onClick={() => onCancel(THREE_MONTHS, true)}>{t("dont_update")}</DialogClose>
|
||||
<DialogClose onClick={() => updateTimezone()}>{t("update_timezone")}</DialogClose>
|
||||
</DialogFooter>
|
||||
</DialogContent>
|
||||
</Dialog>
|
||||
);
|
||||
|
||||
@@ -33,7 +33,7 @@ export default function ConfirmationDialogContent(props: PropsWithChildren<Confi
|
||||
} = props;
|
||||
|
||||
return (
|
||||
<DialogContent type="creation" useOwnActionButtons={true}>
|
||||
<DialogContent type="creation">
|
||||
<div className="flex">
|
||||
{variety && (
|
||||
<div className="mt-0.5 ltr:mr-3">
|
||||
@@ -62,16 +62,14 @@ export default function ConfirmationDialogContent(props: PropsWithChildren<Confi
|
||||
</div>
|
||||
</div>
|
||||
<div className="mt-5 flex flex-row-reverse gap-x-2 sm:mt-8">
|
||||
<DialogClose disabled={isLoading} onClick={onConfirm} asChild>
|
||||
{confirmBtn || (
|
||||
<Button color="primary" loading={isLoading}>
|
||||
{isLoading ? loadingText : confirmBtnText}
|
||||
</Button>
|
||||
)}
|
||||
</DialogClose>
|
||||
<DialogClose disabled={isLoading} asChild>
|
||||
<Button color="secondary">{cancelBtnText}</Button>
|
||||
</DialogClose>
|
||||
{confirmBtn ? (
|
||||
confirmBtn
|
||||
) : (
|
||||
<DialogClose color="primary" loading={isLoading} onClick={(e) => onConfirm && onConfirm(e)}>
|
||||
{isLoading ? loadingText : confirmBtnText}
|
||||
</DialogClose>
|
||||
)}
|
||||
<DialogClose disabled={isLoading}>{cancelBtnText}</DialogClose>
|
||||
</div>
|
||||
</DialogContent>
|
||||
);
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
import * as DialogPrimitive from "@radix-ui/react-dialog";
|
||||
import { useRouter } from "next/router";
|
||||
import React, { ReactNode, useState } from "react";
|
||||
import React, { forwardRef, HTMLProps, ReactNode, useState } from "react";
|
||||
import { Icon } from "react-feather";
|
||||
|
||||
import classNames from "@calcom/lib/classNames";
|
||||
import { useLocale } from "@calcom/lib/hooks/useLocale";
|
||||
|
||||
import { Button } from "../../components/button";
|
||||
import { Button, ButtonProps } from "../../components/button";
|
||||
|
||||
export type DialogProps = React.ComponentProps<typeof DialogPrimitive["Root"]> & {
|
||||
name?: string;
|
||||
@@ -70,20 +70,11 @@ type DialogContentProps = React.ComponentProps<typeof DialogPrimitive["Content"]
|
||||
description?: string | JSX.Element | undefined;
|
||||
closeText?: string;
|
||||
actionDisabled?: boolean;
|
||||
actionText?: string;
|
||||
Icon?: Icon;
|
||||
// If this is set it allows you to overide the action buttons. Usefull if you need to use formcontext
|
||||
useOwnActionButtons?: boolean;
|
||||
actionOnClick?: (e: Event | React.MouseEvent<HTMLElement, MouseEvent>) => void;
|
||||
actionOnClose?: () => void;
|
||||
actionProps?: React.ComponentProps<typeof Button>;
|
||||
};
|
||||
|
||||
export const DialogContent = React.forwardRef<HTMLDivElement, DialogContentProps>(
|
||||
(
|
||||
{ children, title, Icon, actionProps, useOwnActionButtons, type = "creation", ...props },
|
||||
forwardedRef
|
||||
) => {
|
||||
({ children, title, Icon, type = "creation", ...props }, forwardedRef) => {
|
||||
const { t } = useLocale();
|
||||
|
||||
return (
|
||||
@@ -125,31 +116,6 @@ export const DialogContent = React.forwardRef<HTMLDivElement, DialogContentProps
|
||||
</div>
|
||||
</div>
|
||||
)}
|
||||
{!useOwnActionButtons && (
|
||||
<DialogFooter>
|
||||
<div className="mt-2 flex space-x-2">
|
||||
<DialogClose asChild>
|
||||
{/* This will require the i18n string passed in */}
|
||||
<Button color="minimal" onClick={props.actionOnClose}>
|
||||
{props.closeText ?? t("close")}
|
||||
</Button>
|
||||
</DialogClose>
|
||||
{props.actionOnClick ? (
|
||||
<Button
|
||||
color="primary"
|
||||
disabled={props.actionDisabled}
|
||||
onClick={props.actionOnClick}
|
||||
{...actionProps}>
|
||||
{props.actionText}
|
||||
</Button>
|
||||
) : (
|
||||
<Button color="primary" type="submit" disabled={props.actionDisabled} {...actionProps}>
|
||||
{props.actionText}
|
||||
</Button>
|
||||
)}
|
||||
</div>
|
||||
</DialogFooter>
|
||||
)}
|
||||
</DialogPrimitive.Content>
|
||||
</DialogPrimitive.Portal>
|
||||
);
|
||||
@@ -175,7 +141,7 @@ export function DialogHeader(props: DialogHeaderProps) {
|
||||
export function DialogFooter(props: { children: ReactNode }) {
|
||||
return (
|
||||
<div>
|
||||
<div className="mt-5 flex justify-end space-x-2 rtl:space-x-reverse">{props.children}</div>
|
||||
<div className="mt-7 flex justify-end space-x-2 rtl:space-x-reverse ">{props.children}</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
@@ -183,4 +149,24 @@ export function DialogFooter(props: { children: ReactNode }) {
|
||||
DialogContent.displayName = "DialogContent";
|
||||
|
||||
export const DialogTrigger = DialogPrimitive.Trigger;
|
||||
export const DialogClose = DialogPrimitive.Close;
|
||||
// export const DialogClose = DialogPrimitive.Close;
|
||||
|
||||
export function DialogClose(
|
||||
props: {
|
||||
dialogCloseProps?: React.ComponentProps<typeof DialogPrimitive["Close"]>;
|
||||
children?: ReactNode;
|
||||
onClick?: (e: React.MouseEvent<HTMLElement, MouseEvent>) => void;
|
||||
disabled?: boolean;
|
||||
color?: ButtonProps["color"];
|
||||
} & React.ComponentProps<typeof Button>
|
||||
) {
|
||||
const { t } = useLocale();
|
||||
return (
|
||||
<DialogPrimitive.Close asChild {...props.dialogCloseProps}>
|
||||
{/* This will require the i18n string passed in */}
|
||||
<Button color={props.color || "minimal"} {...props}>
|
||||
{props.children ? props.children : t("Close")}
|
||||
</Button>
|
||||
</DialogPrimitive.Close>
|
||||
);
|
||||
}
|
||||
@@ -163,7 +163,7 @@ export default function ImageUploader({
|
||||
{buttonMsg}
|
||||
</Button>
|
||||
</DialogTrigger>
|
||||
<DialogContent useOwnActionButtons>
|
||||
<DialogContent>
|
||||
<div className="mb-4 sm:flex sm:items-start">
|
||||
<div className="mt-3 text-center sm:mt-0 sm:text-left">
|
||||
<h3 className="font-cal text-lg leading-6 text-gray-900" id="modal-title">
|
||||
@@ -201,12 +201,8 @@ export default function ImageUploader({
|
||||
</div>
|
||||
</div>
|
||||
<div className="mt-5 flex flex-row-reverse gap-x-2 sm:mt-4">
|
||||
<DialogClose asChild>
|
||||
<Button onClick={() => showCroppedImage(croppedAreaPixels)}>{t("save")}</Button>
|
||||
</DialogClose>
|
||||
<DialogClose asChild>
|
||||
<Button color="secondary">{t("cancel")}</Button>
|
||||
</DialogClose>
|
||||
<DialogClose onClick={() => showCroppedImage(croppedAreaPixels)}>{t("save")}</DialogClose>
|
||||
<DialogClose color="secondary">{t("cancel")}</DialogClose>
|
||||
</div>
|
||||
</DialogContent>
|
||||
</Dialog>
|
||||
|
||||
@@ -205,7 +205,6 @@ export default function CreateEventTypeButton(props: CreateEventTypeBtnProps) {
|
||||
<DialogContent
|
||||
type="creation"
|
||||
className="overflow-y-auto"
|
||||
useOwnActionButtons
|
||||
title={teamId ? t("add_new_team_event_type") : t("add_new_event_type")}
|
||||
description={t("new_event_type_to_book_description")}>
|
||||
<Form
|
||||
@@ -315,9 +314,7 @@ export default function CreateEventTypeButton(props: CreateEventTypeBtnProps) {
|
||||
<Button type="submit" loading={createMutation.isLoading}>
|
||||
{t("continue")}
|
||||
</Button>
|
||||
<DialogClose asChild>
|
||||
<Button color="secondary">{t("cancel")}</Button>
|
||||
</DialogClose>
|
||||
<DialogClose />
|
||||
</div>
|
||||
</Form>
|
||||
</DialogContent>
|
||||
|
||||
@@ -3,7 +3,17 @@ import { useState } from "react";
|
||||
import { useLocale } from "@calcom/lib/hooks/useLocale";
|
||||
import { trpc } from "@calcom/trpc/react";
|
||||
|
||||
import { Button, ButtonProps, Dialog, DialogContent, DialogTrigger, Icon, showToast } from "../../..";
|
||||
import {
|
||||
Button,
|
||||
ButtonProps,
|
||||
Dialog,
|
||||
DialogContent,
|
||||
DialogTrigger,
|
||||
Icon,
|
||||
showToast,
|
||||
DialogFooter,
|
||||
DialogClose,
|
||||
} from "../../..";
|
||||
|
||||
export default function DisconnectIntegration({
|
||||
credentialId,
|
||||
@@ -52,10 +62,14 @@ export default function DisconnectIntegration({
|
||||
title={t("remove_app")}
|
||||
description={t("are_you_sure_you_want_to_remove_this_app")}
|
||||
type="confirmation"
|
||||
actionText={t("yes_remove_app")}
|
||||
Icon={Icon.FiAlertCircle}
|
||||
actionOnClick={() => mutation.mutate({ id: credentialId })}
|
||||
/>
|
||||
Icon={Icon.FiAlertCircle}>
|
||||
<DialogFooter>
|
||||
<DialogClose onClick={() => setModalOpen(false)} />
|
||||
<DialogClose color="primary" onClick={() => mutation.mutate({ id: credentialId })}>
|
||||
{t("yes_remove_app")}
|
||||
</DialogClose>
|
||||
</DialogFooter>
|
||||
</DialogContent>
|
||||
</Dialog>
|
||||
</>
|
||||
);
|
||||
|
||||
Reference in new issue
Block a user