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}
sx={{
my: 4,
...(loading
? {
'&.Mui-disabled': {
backgroundColor: (theme) => theme.palette.accent.main,
backgroundColor: (theme) =>
theme.palette.accent.main,
color: (theme) => theme.palette.text.primary,
},
}
: {}),
...sx,
}}
{...props}>