fix(striker-ui): align colouring in buttons

main
Tsu-ba-me 2 years ago committed by digimer
parent ccd977e39d
commit aa2dbff079
  1. 16
      striker-ui/components/ContainedButton.tsx
  2. 3
      striker-ui/components/IconButton/IconButton.tsx

@ -1,17 +1,17 @@
import { Button as MUIButton, SxProps, Theme } from '@mui/material'; import { Button as MUIButton, SxProps, Theme } from '@mui/material';
import { FC, useMemo } from 'react'; import { FC, useMemo } from 'react';
import { BLACK, GREY, TEXT } from '../lib/consts/DEFAULT_THEME'; import { BLACK, 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>>(
() => ({ () => ({
backgroundColor: TEXT, backgroundColor: GREY,
color: BLACK, color: BLACK,
textTransform: 'none', textTransform: 'none',
'&:hover': { '&:hover': {
backgroundColor: GREY, backgroundColor: `${GREY}F0`,
}, },
...sx, ...sx,
@ -19,15 +19,7 @@ const ContainedButton: FC<ContainedButtonProps> = ({ sx, ...restProps }) => {
[sx], [sx],
); );
return ( return <MUIButton variant="contained" {...restProps} sx={combinedSx} />;
<MUIButton
{...{
variant: 'contained',
...restProps,
sx: combinedSx,
}}
/>
);
}; };
export default ContainedButton; export default ContainedButton;

@ -17,7 +17,6 @@ import {
BORDER_RADIUS, BORDER_RADIUS,
DISABLED, DISABLED,
GREY, GREY,
TEXT,
} from '../../lib/consts/DEFAULT_THEME'; } from '../../lib/consts/DEFAULT_THEME';
type IconButtonProps = IconButtonOptionalProps & MUIIconButtonProps; type IconButtonProps = IconButtonOptionalProps & MUIIconButtonProps;
@ -28,7 +27,7 @@ const ContainedIconButton = styled(MUIIconButton)({
color: BLACK, color: BLACK,
'&:hover': { '&:hover': {
backgroundColor: TEXT, backgroundColor: `${GREY}F0`,
}, },
[`&.${muiInputClasses.disabled}`]: { [`&.${muiInputClasses.disabled}`]: {

Loading…
Cancel
Save