only keep button enabled if submit is loading

This commit is contained in:
Abhinav 2022-12-21 17:02:57 +05:30
parent ee81cbfd79
commit 24db0e5d3c

View file

@ -26,10 +26,15 @@ const SubmitButton: FC<ButtonProps<'button', SubmitButtonProps>> = ({
disabled={disabled || loading || success} disabled={disabled || loading || success}
sx={{ sx={{
my: 4, my: 4,
'&.Mui-disabled': { ...(loading
backgroundColor: (theme) => theme.palette.accent.main, ? {
color: (theme) => theme.palette.text.primary, '&.Mui-disabled': {
}, backgroundColor: (theme) =>
theme.palette.accent.main,
color: (theme) => theme.palette.text.primary,
},
}
: {}),
...sx, ...sx,
}} }}
{...props}> {...props}>