fixed iconbutton color properties

This commit is contained in:
Sendou
2020-03-25 11:37:19 +02:00
parent e25af9eb1f
commit cecaccf95c

View File

@@ -19,7 +19,14 @@ const IconButton: React.FC<IconButtonProps> = ({
onClick,
color,
}) => {
const { themeColor } = useContext(MyThemeContext)
const { themeColorWithShade } = useContext(MyThemeContext)
const getColor = () => {
if (color) return color
if (colored) return themeColorWithShade
return undefined
}
return (
<ChakraIconButton
aria-label=""
@@ -28,8 +35,7 @@ const IconButton: React.FC<IconButtonProps> = ({
variant="ghost"
onClick={onClick}
size="lg"
variantColor={colored ? themeColor : undefined}
color={color}
color={getColor()}
isDisabled={disabled}
/>
)