diff --git a/striker-ui/components/ConfirmDialog.tsx b/striker-ui/components/ConfirmDialog.tsx index 6e86ef24..145067da 100644 --- a/striker-ui/components/ConfirmDialog.tsx +++ b/striker-ui/components/ConfirmDialog.tsx @@ -24,7 +24,11 @@ const ConfirmDialog = forwardRef< actionCancelText = 'Cancel', actionProceedText, content, - dialogProps: { open: baseOpen = false, ...restDialogProps } = {}, + dialogProps: { + open: baseOpen = false, + PaperProps: paperProps = {}, + ...restDialogProps + } = {}, onCancelAppend, onProceedAppend, openInitially = false, @@ -34,7 +38,9 @@ const ConfirmDialog = forwardRef< }, ref, ) => { - const { sx: proceedButtonSx } = proceedButtonProps; + const { sx: paperSx, ...restPaperProps } = paperProps; + const { sx: proceedButtonSx, ...restProceedButtonProps } = + proceedButtonProps; const [isOpen, setIsOpen] = useState(openInitially); @@ -61,7 +67,10 @@ const ConfirmDialog = forwardRef< @@ -92,6 +101,12 @@ const ConfirmDialog = forwardRef< {actionCancelText} { + setIsOpen(false); + + onProceedAppend?.call(null, ...args); + }} + {...restProceedButtonProps} sx={{ backgroundColor: proceedColour, color: TEXT, @@ -100,11 +115,6 @@ const ConfirmDialog = forwardRef< ...proceedButtonSx, }} - onClick={(...args) => { - setIsOpen(false); - - onProceedAppend?.call(null, ...args); - }} > {actionProceedText} diff --git a/striker-ui/types/ConfirmDialog.d.ts b/striker-ui/types/ConfirmDialog.d.ts index d0e4df00..bc7d10b3 100644 --- a/striker-ui/types/ConfirmDialog.d.ts +++ b/striker-ui/types/ConfirmDialog.d.ts @@ -1,6 +1,6 @@ type ConfirmDialogOptionalProps = { actionCancelText?: string; - dialogProps?: import('@mui/material').DialogProps; + dialogProps?: Partial; onProceedAppend?: ContainedButtonProps['onClick']; onCancelAppend?: ContainedButtonProps['onClick']; openInitially?: boolean;