From cecaccf95ca9ec36aa6dce7caec5b65577640313 Mon Sep 17 00:00:00 2001 From: Sendou Date: Wed, 25 Mar 2020 11:37:19 +0200 Subject: [PATCH] fixed iconbutton color properties --- .../src/components/elements/IconButton.tsx | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/frontend-react/src/components/elements/IconButton.tsx b/frontend-react/src/components/elements/IconButton.tsx index b689a25f9..46e5d55be 100644 --- a/frontend-react/src/components/elements/IconButton.tsx +++ b/frontend-react/src/components/elements/IconButton.tsx @@ -19,7 +19,14 @@ const IconButton: React.FC = ({ onClick, color, }) => { - const { themeColor } = useContext(MyThemeContext) + const { themeColorWithShade } = useContext(MyThemeContext) + + const getColor = () => { + if (color) return color + if (colored) return themeColorWithShade + return undefined + } + return ( = ({ variant="ghost" onClick={onClick} size="lg" - variantColor={colored ? themeColor : undefined} - color={color} + color={getColor()} isDisabled={disabled} /> )