You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
33 lines
657 B
33 lines
657 B
import { Button as MUIButton, SxProps, Theme } from '@mui/material'; |
|
import { FC, useMemo } from 'react'; |
|
|
|
import { BLACK, GREY, TEXT } from '../lib/consts/DEFAULT_THEME'; |
|
|
|
const ContainedButton: FC<ContainedButtonProps> = ({ sx, ...restProps }) => { |
|
const combinedSx = useMemo<SxProps<Theme>>( |
|
() => ({ |
|
backgroundColor: TEXT, |
|
color: BLACK, |
|
textTransform: 'none', |
|
|
|
'&:hover': { |
|
backgroundColor: GREY, |
|
}, |
|
|
|
...sx, |
|
}), |
|
[sx], |
|
); |
|
|
|
return ( |
|
<MUIButton |
|
{...{ |
|
variant: 'contained', |
|
...restProps, |
|
sx: combinedSx, |
|
}} |
|
/> |
|
); |
|
}; |
|
|
|
export default ContainedButton;
|
|
|