fix(striker-ui): allow style overrides in IconButton; export IconButtonProps

main
Tsu-ba-me 3 years ago
parent 5fe0ec06cf
commit 3ad7ae62c8
  1. 30
      striker-ui/components/IconButton/IconButton.tsx
  2. 4
      striker-ui/components/IconButton/index.tsx

@ -1,4 +1,8 @@
import { IconButton as MUIIconButton, styled } from '@mui/material';
import { FC } from 'react';
import {
IconButton as MUIIconButton,
IconButtonProps as MUIIconButtonProps,
} from '@mui/material';
import {
BLACK,
@ -7,13 +11,31 @@ import {
TEXT,
} from '../../lib/consts/DEFAULT_THEME';
const IconButton = styled(MUIIconButton)({
export type IconButtonProps = MUIIconButtonProps;
const IconButton: FC<IconButtonProps> = ({
children,
sx,
...iconButtonRestProps
}) => (
<MUIIconButton
{...{
...iconButtonRestProps,
sx: {
borderRadius: BORDER_RADIUS,
backgroundColor: GREY,
color: BLACK,
'&:hover': {
backgroundColor: TEXT,
},
color: BLACK,
});
...sx,
},
}}
>
{children}
</MUIIconButton>
);
export default IconButton;

@ -1,3 +1,5 @@
import IconButton from './IconButton';
import IconButton, { IconButtonProps } from './IconButton';
export type { IconButtonProps };
export default IconButton;

Loading…
Cancel
Save