From d01cb399863f13140d33c032f24bb141d4c35a96 Mon Sep 17 00:00:00 2001 From: Daniel Bisgrove Date: Thu, 5 Dec 2024 10:23:12 -0500 Subject: [PATCH] Prevent user from deleting contact and adding message --- .../DeleteContactModal/DeleteContactModal.tsx | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/components/Contacts/ContactDetails/ContactDetailsHeader/DeleteContactModal/DeleteContactModal.tsx b/src/components/Contacts/ContactDetails/ContactDetailsHeader/DeleteContactModal/DeleteContactModal.tsx index 45dd500b3..b599dea32 100644 --- a/src/components/Contacts/ContactDetails/ContactDetailsHeader/DeleteContactModal/DeleteContactModal.tsx +++ b/src/components/Contacts/ContactDetails/ContactDetailsHeader/DeleteContactModal/DeleteContactModal.tsx @@ -98,9 +98,14 @@ export const DeleteContactModal: React.FC = ({ > - {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.", + )} @@ -112,7 +117,7 @@ export const DeleteContactModal: React.FC = ({