From 608e193c36cab6305f54c2ce851e5fdb579ee929 Mon Sep 17 00:00:00 2001 From: Aaryan Khandelwal <65252264+aaryan610@users.noreply.github.com> Date: Fri, 31 May 2024 17:40:21 +0530 Subject: [PATCH] chore: added primary variant to the alert modal (#4664) --- web/components/api-token/delete-token-modal.tsx | 2 +- web/components/core/modals/alert-modal.tsx | 15 +++++++++------ web/components/cycles/delete-modal.tsx | 2 +- .../estimates/delete-estimate-modal.tsx | 2 +- .../inbox/modals/decline-issue-modal.tsx | 2 +- .../inbox/modals/delete-issue-modal.tsx | 2 +- .../issues/attachment/delete-attachment-modal.tsx | 2 +- web/components/issues/delete-issue-modal.tsx | 2 +- web/components/labels/delete-label-modal.tsx | 2 +- web/components/modules/delete-module-modal.tsx | 2 +- web/components/pages/modals/delete-page-modal.tsx | 2 +- web/components/states/delete-state-modal.tsx | 2 +- web/components/views/delete-view-modal.tsx | 2 +- web/components/web-hooks/delete-webhook-modal.tsx | 2 +- .../workspace/views/delete-view-modal.tsx | 2 +- 15 files changed, 23 insertions(+), 20 deletions(-) diff --git a/web/components/api-token/delete-token-modal.tsx b/web/components/api-token/delete-token-modal.tsx index 014531c42..6918df463 100644 --- a/web/components/api-token/delete-token-modal.tsx +++ b/web/components/api-token/delete-token-modal.tsx @@ -69,7 +69,7 @@ export const DeleteApiTokenModal: FC = (props) => { void; handleSubmit: () => Promise; hideIcon?: boolean; - isDeleting: boolean; + isSubmitting: boolean; isOpen: boolean; position?: EModalPosition; primaryButtonText?: { @@ -28,14 +28,17 @@ type Props = { const VARIANT_ICONS: Record = { danger: AlertTriangle, + primary: Info, }; const BUTTON_VARIANTS: Record = { danger: "danger", + primary: "primary", }; const VARIANT_CLASSES: Record = { danger: "bg-red-500/20 text-red-500", + primary: "bg-custom-primary-100/20 text-custom-primary-100", }; export const AlertModalCore: React.FC = (props) => { @@ -44,7 +47,7 @@ export const AlertModalCore: React.FC = (props) => { handleClose, handleSubmit, hideIcon = false, - isDeleting, + isSubmitting, isOpen, position = EModalPosition.CENTER, primaryButtonText = { @@ -81,8 +84,8 @@ export const AlertModalCore: React.FC = (props) => { - diff --git a/web/components/cycles/delete-modal.tsx b/web/components/cycles/delete-modal.tsx index 48b2a64c4..9a6578f49 100644 --- a/web/components/cycles/delete-modal.tsx +++ b/web/components/cycles/delete-modal.tsx @@ -73,7 +73,7 @@ export const CycleDeleteModal: React.FC = observer((props) => { = observer((props) => { = (props) => { = observer(({ isOpen, onClos = (props) => { handleDeletion(data.id)} - isDeleting={loader} + isSubmitting={loader} isOpen={isOpen} title="Delete attachment" content={ diff --git a/web/components/issues/delete-issue-modal.tsx b/web/components/issues/delete-issue-modal.tsx index 49c1a8700..46f8e733d 100644 --- a/web/components/issues/delete-issue-modal.tsx +++ b/web/components/issues/delete-issue-modal.tsx @@ -66,7 +66,7 @@ export const DeleteIssueModal: React.FC = (props) => { = observer((props) => { = observer((props) => { = observer((pr = observer((props) => { = observer((props) => { = (props) => { = observer((props) => {