From 3ad7ae62c8d28d0cfd22ab1f1ab6ef3fed86f6ca Mon Sep 17 00:00:00 2001 From: Tsu-ba-me Date: Fri, 13 May 2022 14:46:10 -0400 Subject: [PATCH] fix(striker-ui): allow style overrides in IconButton; export IconButtonProps --- .../components/IconButton/IconButton.tsx | 40 ++++++++++++++----- striker-ui/components/IconButton/index.tsx | 4 +- 2 files changed, 34 insertions(+), 10 deletions(-) diff --git a/striker-ui/components/IconButton/IconButton.tsx b/striker-ui/components/IconButton/IconButton.tsx index f6b82c19..298a226a 100644 --- a/striker-ui/components/IconButton/IconButton.tsx +++ b/striker-ui/components/IconButton/IconButton.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)({ - borderRadius: BORDER_RADIUS, - backgroundColor: GREY, - '&:hover': { - backgroundColor: TEXT, - }, - color: BLACK, -}); +export type IconButtonProps = MUIIconButtonProps; + +const IconButton: FC = ({ + children, + sx, + ...iconButtonRestProps +}) => ( + + {children} + +); export default IconButton; diff --git a/striker-ui/components/IconButton/index.tsx b/striker-ui/components/IconButton/index.tsx index a51790e7..83519eca 100644 --- a/striker-ui/components/IconButton/index.tsx +++ b/striker-ui/components/IconButton/index.tsx @@ -1,3 +1,5 @@ -import IconButton from './IconButton'; +import IconButton, { IconButtonProps } from './IconButton'; + +export type { IconButtonProps }; export default IconButton;