|
|
@ -20,6 +20,7 @@ const DialogActionGroup: FC<DialogActionGroupProps> = (props) => { |
|
|
|
onProceed = handleAction, |
|
|
|
onProceed = handleAction, |
|
|
|
proceedColour, |
|
|
|
proceedColour, |
|
|
|
proceedProps, |
|
|
|
proceedProps, |
|
|
|
|
|
|
|
showCancel = true, |
|
|
|
// Dependents
|
|
|
|
// Dependents
|
|
|
|
cancelChildren = cancelProps?.children, |
|
|
|
cancelChildren = cancelProps?.children, |
|
|
|
proceedChildren = proceedProps?.children, |
|
|
|
proceedChildren = proceedProps?.children, |
|
|
@ -61,36 +62,36 @@ const DialogActionGroup: FC<DialogActionGroupProps> = (props) => { |
|
|
|
[closeOnProceed, dialogContext, onProceed, proceedProps?.onClick], |
|
|
|
[closeOnProceed, dialogContext, onProceed, proceedProps?.onClick], |
|
|
|
); |
|
|
|
); |
|
|
|
|
|
|
|
|
|
|
|
const actions = useMemo( |
|
|
|
const actions = useMemo(() => { |
|
|
|
() => ( |
|
|
|
const acts: ContainedButtonProps[] = [ |
|
|
|
<ActionGroup |
|
|
|
{ |
|
|
|
actions={[ |
|
|
|
background: proceedColour, |
|
|
|
{ |
|
|
|
...proceedProps, |
|
|
|
...cancelProps, |
|
|
|
children: proceedChildren, |
|
|
|
children: cancelChildren, |
|
|
|
onClick: proceedHandler, |
|
|
|
onClick: cancelHandler, |
|
|
|
}, |
|
|
|
}, |
|
|
|
]; |
|
|
|
{ |
|
|
|
|
|
|
|
background: proceedColour, |
|
|
|
if (showCancel) { |
|
|
|
...proceedProps, |
|
|
|
acts.unshift({ |
|
|
|
children: proceedChildren, |
|
|
|
...cancelProps, |
|
|
|
onClick: proceedHandler, |
|
|
|
children: cancelChildren, |
|
|
|
}, |
|
|
|
onClick: cancelHandler, |
|
|
|
]} |
|
|
|
}); |
|
|
|
loading={loading} |
|
|
|
} |
|
|
|
/> |
|
|
|
|
|
|
|
), |
|
|
|
return <ActionGroup actions={acts} loading={loading} />; |
|
|
|
[ |
|
|
|
}, [ |
|
|
|
cancelChildren, |
|
|
|
cancelChildren, |
|
|
|
cancelHandler, |
|
|
|
cancelHandler, |
|
|
|
cancelProps, |
|
|
|
cancelProps, |
|
|
|
loading, |
|
|
|
loading, |
|
|
|
proceedChildren, |
|
|
|
proceedChildren, |
|
|
|
proceedColour, |
|
|
|
proceedColour, |
|
|
|
proceedHandler, |
|
|
|
proceedHandler, |
|
|
|
proceedProps, |
|
|
|
proceedProps, |
|
|
|
], |
|
|
|
showCancel, |
|
|
|
); |
|
|
|
]); |
|
|
|
|
|
|
|
|
|
|
|
return actions; |
|
|
|
return actions; |
|
|
|
}; |
|
|
|
}; |
|
|
|