|
|
@ -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; |
|
|
|