Skip to content

Commit

Permalink
Prevent user from deleting contact and adding message
Browse files Browse the repository at this point in the history
  • Loading branch information
dr-bizz committed Dec 5, 2024
1 parent 78d761a commit d01cb39
Showing 1 changed file with 9 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -98,9 +98,14 @@ export const DeleteContactModal: React.FC<DeleteContactModalProps> = ({
>
<DialogContent dividers>
<DialogContentText>
{t(
'Are you sure you want to permanently delete this contact? Doing so will permanently delete this contacts information, as well as task history. This cannot be undone. If you wish to keep this information, you can try hiding this contact instead.',
)}
{canDelete &&
t(
'Are you sure you want to permanently delete this contact? Doing so will permanently delete this contacts information, as well as task history. This cannot be undone. If you wish to keep this information, you can try hiding this contact instead.',
)}
{!canDelete &&
t(
"This contact cannot be deleted because part or all of the contact's data is sourced from a third Party. Please email Donation Services to request that this contact be deleted, or you can hide this contact instead.",
)}
</DialogContentText>
</DialogContent>
<DialogActions>
Expand All @@ -112,7 +117,7 @@ export const DeleteContactModal: React.FC<DeleteContactModalProps> = ({
<DeleteButton
size="large"
variant="contained"
disabled={deleting}
disabled={deleting || !canDelete}
onClick={deleteContact}
sx={{ marginRight: 0 }}
>
Expand Down

0 comments on commit d01cb39

Please sign in to comment.