|
|
@ -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,26 +62,26 @@ 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={[ |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
...cancelProps, |
|
|
|
|
|
|
|
children: cancelChildren, |
|
|
|
|
|
|
|
onClick: cancelHandler, |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
{ |
|
|
|
{ |
|
|
|
background: proceedColour, |
|
|
|
background: proceedColour, |
|
|
|
...proceedProps, |
|
|
|
...proceedProps, |
|
|
|
children: proceedChildren, |
|
|
|
children: proceedChildren, |
|
|
|
onClick: proceedHandler, |
|
|
|
onClick: proceedHandler, |
|
|
|
}, |
|
|
|
}, |
|
|
|
]} |
|
|
|
]; |
|
|
|
loading={loading} |
|
|
|
|
|
|
|
/> |
|
|
|
if (showCancel) { |
|
|
|
), |
|
|
|
acts.unshift({ |
|
|
|
[ |
|
|
|
...cancelProps, |
|
|
|
|
|
|
|
children: cancelChildren, |
|
|
|
|
|
|
|
onClick: cancelHandler, |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return <ActionGroup actions={acts} loading={loading} />; |
|
|
|
|
|
|
|
}, [ |
|
|
|
cancelChildren, |
|
|
|
cancelChildren, |
|
|
|
cancelHandler, |
|
|
|
cancelHandler, |
|
|
|
cancelProps, |
|
|
|
cancelProps, |
|
|
@ -89,8 +90,8 @@ const DialogActionGroup: FC<DialogActionGroupProps> = (props) => { |
|
|
|
proceedColour, |
|
|
|
proceedColour, |
|
|
|
proceedHandler, |
|
|
|
proceedHandler, |
|
|
|
proceedProps, |
|
|
|
proceedProps, |
|
|
|
], |
|
|
|
showCancel, |
|
|
|
); |
|
|
|
]); |
|
|
|
|
|
|
|
|
|
|
|
return actions; |
|
|
|
return actions; |
|
|
|
}; |
|
|
|
}; |
|
|
|