From 62b2f69aa4c30b09995bd990a9f48ab0a4b391ab Mon Sep 17 00:00:00 2001 From: Tsu-ba-me Date: Mon, 15 Jan 2024 18:37:38 -0500 Subject: [PATCH] fix(striker-ui): allow pre-config confirm dialog close-on-proceed --- striker-ui/hooks/useConfirmDialog.tsx | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/striker-ui/hooks/useConfirmDialog.tsx b/striker-ui/hooks/useConfirmDialog.tsx index 8f24f4d9..07e91de6 100644 --- a/striker-ui/hooks/useConfirmDialog.tsx +++ b/striker-ui/hooks/useConfirmDialog.tsx @@ -25,7 +25,12 @@ const useConfirmDialog = ( finishConfirm: (title: ReactNode, message: Message) => void; } => { const { - initial: { actionProceedText = '', content = '', titleText = '' } = {}, + initial: { + actionProceedText = '', + closeOnProceed, + content = '', + titleText = '', + } = {}, } = args; const confirmDialogRef = useRef( @@ -57,8 +62,14 @@ const useConfirmDialog = ( ); const confirmDialog = useMemo( - () => , - [confirmDialogProps], + () => ( + + ), + [closeOnProceed, confirmDialogProps], ); return {