fix(striker-ui): pass initial props, allow overwrite in confirm dialog hook

main
Tsu-ba-me 11 months ago
parent 3ea2fcc520
commit a20a2f7cc3
  1. 6
      striker-ui/hooks/useConfirmDialog.tsx

@ -28,9 +28,9 @@ const useConfirmDialog = (
const { const {
initial: { initial: {
actionProceedText = '', actionProceedText = '',
closeOnProceed,
content = '', content = '',
titleText = '', titleText = '',
...restInitialProps
} = {}, } = {},
} = args; } = args;
@ -74,12 +74,12 @@ const useConfirmDialog = (
const confirmDialog = useMemo<ReactElement>( const confirmDialog = useMemo<ReactElement>(
() => ( () => (
<ConfirmDialog <ConfirmDialog
closeOnProceed={closeOnProceed} {...restInitialProps}
{...confirmDialogProps} {...confirmDialogProps}
ref={confirmDialogRef} ref={confirmDialogRef}
/> />
), ),
[closeOnProceed, confirmDialogProps], [confirmDialogProps, restInitialProps],
); );
return { return {

Loading…
Cancel
Save