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.
47 lines
839 B
47 lines
839 B
import { FC } from 'react'; |
|
import { |
|
IconButton as MUIIconButton, |
|
IconButtonProps as MUIIconButtonProps, |
|
inputClasses as muiInputClasses, |
|
} from '@mui/material'; |
|
|
|
import { |
|
BLACK, |
|
BORDER_RADIUS, |
|
DISABLED, |
|
GREY, |
|
TEXT, |
|
} from '../../lib/consts/DEFAULT_THEME'; |
|
|
|
export type IconButtonProps = MUIIconButtonProps; |
|
|
|
const IconButton: FC<IconButtonProps> = ({ |
|
children, |
|
sx, |
|
...iconButtonRestProps |
|
}) => ( |
|
<MUIIconButton |
|
{...{ |
|
...iconButtonRestProps, |
|
sx: { |
|
borderRadius: BORDER_RADIUS, |
|
backgroundColor: GREY, |
|
color: BLACK, |
|
|
|
'&:hover': { |
|
backgroundColor: TEXT, |
|
}, |
|
|
|
[`&.${muiInputClasses.disabled}`]: { |
|
backgroundColor: DISABLED, |
|
}, |
|
|
|
...sx, |
|
}, |
|
}} |
|
> |
|
{children} |
|
</MUIIconButton> |
|
); |
|
|
|
export default IconButton;
|
|
|