From 6d7aa63d13347e66d0654fda180f4e98daaa8b98 Mon Sep 17 00:00:00 2001 From: Richard Griffiths Date: Tue, 25 Jun 2024 16:21:57 +0100 Subject: [PATCH] Alert pop up changes --- next_frontend/components/common/NodeEdit.tsx | 9 ++++++--- next_frontend/components/modals/alertModal.tsx | 6 ++++-- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/next_frontend/components/common/NodeEdit.tsx b/next_frontend/components/common/NodeEdit.tsx index 8a9f61c2..b2c556e5 100644 --- a/next_frontend/components/common/NodeEdit.tsx +++ b/next_frontend/components/common/NodeEdit.tsx @@ -282,7 +282,9 @@ const NodeEdit = ({ node, isOpen, setEditOpen }: NodeEditProps) => { onClose={() => setDeleteOpen(false)} onConfirm={handleDelete} loading={loading} - confirmButtonText={'Delete'} + message={'Deleting this element will also remove all of the connected child elements. This cannot be undone.'} + confirmButtonText={'Yes, delete this element!'} + cancelButtonText={'No, keep the element'} /> { onClose={() => setAlertOpen(false)} onConfirm={handleClose} loading={loading} - message={'There are unresolved changes, continue to discard these changes.'} - confirmButtonText={'Discard Changes'} + message={'You have changes that have not been updated, would you like to discard these changes?'} + confirmButtonText={'Yes, discard changes!'} + cancelButtonText={'No, keep editing'} /> )} diff --git a/next_frontend/components/modals/alertModal.tsx b/next_frontend/components/modals/alertModal.tsx index ee12bb44..b29d7384 100644 --- a/next_frontend/components/modals/alertModal.tsx +++ b/next_frontend/components/modals/alertModal.tsx @@ -12,6 +12,7 @@ interface AlertModalProps { loading: boolean; message?: string confirmButtonText: string + cancelButtonText?: string | null } export const AlertModal: React.FC = ({ @@ -20,7 +21,8 @@ export const AlertModal: React.FC = ({ onConfirm, loading, message, - confirmButtonText + confirmButtonText, + cancelButtonText }) => { const [isMounted, setIsMounted] = useState(false); @@ -41,7 +43,7 @@ export const AlertModal: React.FC = ({ >