Skip to content

Commit f1efa3e

Browse files
committed
revert: ForceDeleteConfirmation in DeleteConfirmationModal
1 parent 14d2836 commit f1efa3e

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

src/Shared/Components/ConfirmationModal/DeleteConfirmationModal.tsx

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ import { showError, stopPropagation } from '@Common/Helper'
2121
import { ConfirmationModalVariantType, DeleteConfirmationModalProps } from './types'
2222
import ConfirmationModal from './ConfirmationModal'
2323
import { CannotDeleteModal } from './CannotDeleteModal'
24+
import { ForceDeleteConfirmationModal } from './ForceDeleteConfirmationModal'
2425

2526
export const DeleteConfirmationModal: React.FC<DeleteConfirmationModalProps> = ({
2627
title,
@@ -40,6 +41,7 @@ export const DeleteConfirmationModal: React.FC<DeleteConfirmationModalProps> = (
4041
children,
4142
}: DeleteConfirmationModalProps) => {
4243
const [showCannotDeleteDialogModal, setCannotDeleteDialogModal] = useState(false)
44+
const [showForceDeleteModal, setForceDeleteModal] = useState(false)
4345
const [cannotDeleteText, setCannotDeleteText] = useState(renderCannotDeleteConfirmationSubTitle)
4446
const [isLoading, setLoading] = useState(isDeleting)
4547

@@ -81,6 +83,8 @@ export const DeleteConfirmationModal: React.FC<DeleteConfirmationModalProps> = (
8183
closeConfirmationModal()
8284
}
8385

86+
const handleCloseForceDeleteModal = () => setForceDeleteModal(false)
87+
8488
const renderCannotDeleteDialogModal = () => (
8589
<CannotDeleteModal
8690
title={title}
@@ -90,6 +94,15 @@ export const DeleteConfirmationModal: React.FC<DeleteConfirmationModalProps> = (
9094
/>
9195
)
9296

97+
const renderForceDeleteModal = () => (
98+
<ForceDeleteConfirmationModal
99+
title={title}
100+
subtitle={subtitle}
101+
onDelete={onDelete}
102+
closeConfirmationModal={handleCloseForceDeleteModal}
103+
/>
104+
)
105+
93106
const renderDeleteModal = () => (
94107
<ConfirmationModal
95108
variant={ConfirmationModalVariantType.delete}
@@ -117,8 +130,9 @@ export const DeleteConfirmationModal: React.FC<DeleteConfirmationModalProps> = (
117130

118131
return (
119132
<>
120-
{!showCannotDeleteDialogModal && renderDeleteModal()}
133+
{!showCannotDeleteDialogModal && !showForceDeleteModal && renderDeleteModal()}
121134
{showCannotDeleteDialogModal && renderCannotDeleteDialogModal()}
135+
{showForceDeleteModal && renderForceDeleteModal()}
122136
</>
123137
)
124138
}

0 commit comments

Comments
 (0)