fix(striker-ui): adjust disabled colour in ContainedButton

main
Tsu-ba-me 2 years ago
parent 9e9a81a5ce
commit a219c120b1
  1. 13
      striker-ui/components/ContainedButton.tsx

@ -1,7 +1,12 @@
import { Button as MUIButton, SxProps, Theme } from '@mui/material'; import {
Button as MUIButton,
buttonClasses as muiButtonClasses,
SxProps,
Theme,
} from '@mui/material';
import { FC, useMemo } from 'react'; import { FC, useMemo } from 'react';
import { BLACK, GREY } from '../lib/consts/DEFAULT_THEME'; import { BLACK, DISABLED, GREY } from '../lib/consts/DEFAULT_THEME';
const ContainedButton: FC<ContainedButtonProps> = ({ sx, ...restProps }) => { const ContainedButton: FC<ContainedButtonProps> = ({ sx, ...restProps }) => {
const combinedSx = useMemo<SxProps<Theme>>( const combinedSx = useMemo<SxProps<Theme>>(
@ -14,6 +19,10 @@ const ContainedButton: FC<ContainedButtonProps> = ({ sx, ...restProps }) => {
backgroundColor: `${GREY}F0`, backgroundColor: `${GREY}F0`,
}, },
[`&.${muiButtonClasses.disabled}`]: {
backgroundColor: DISABLED,
},
...sx, ...sx,
}), }),
[sx], [sx],

Loading…
Cancel
Save