From b380e6d770e0173aadb2232791fe3e3202e5ab44 Mon Sep 17 00:00:00 2001 From: Simon Larsen Date: Tue, 3 Dec 2024 16:36:02 +0000 Subject: [PATCH] Refactor ConfirmModal and DashboardToolbar for improved code readability and consistency --- Common/UI/Components/Modal/ConfirmModal.tsx | 4 +--- .../src/Components/Dashboard/Toolbar/DashboardToolbar.tsx | 6 +++--- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/Common/UI/Components/Modal/ConfirmModal.tsx b/Common/UI/Components/Modal/ConfirmModal.tsx index 253a9e43a49..eb8c9deefca 100644 --- a/Common/UI/Components/Modal/ConfirmModal.tsx +++ b/Common/UI/Components/Modal/ConfirmModal.tsx @@ -28,9 +28,7 @@ const ConfirmModal: FunctionComponent = ( submitButtonText={ props.submitButtonText ? props.submitButtonText : "Confirm" } - closeButtonText={ - props.closeButtonText ? props.closeButtonText : "Cancel" - } + closeButtonText={props.closeButtonText ? props.closeButtonText : "Cancel"} closeButtonStyleType={ props.closeButtonType ? props.closeButtonType : ButtonStyleType.NORMAL } diff --git a/Dashboard/src/Components/Dashboard/Toolbar/DashboardToolbar.tsx b/Dashboard/src/Components/Dashboard/Toolbar/DashboardToolbar.tsx index 1c63b3684de..2f2633f5953 100644 --- a/Dashboard/src/Components/Dashboard/Toolbar/DashboardToolbar.tsx +++ b/Dashboard/src/Components/Dashboard/Toolbar/DashboardToolbar.tsx @@ -123,7 +123,7 @@ const DashboardToolbar: FunctionComponent = ( icon={IconProp.Close} title="Cancel" buttonStyle={ButtonStyleType.HOVER_DANGER_OUTLINE} - onClick={()=>{ + onClick={() => { setShowCancelModal(true); }} /> @@ -149,10 +149,10 @@ const DashboardToolbar: FunctionComponent = ( closeButtonText={"Keep Editing"} onSubmit={() => { props.onCancelEditClick(); - setShowCancelModal(false); + setShowCancelModal(false); }} onClose={() => { - setShowCancelModal(false); + setShowCancelModal(false); }} /> ) : (