Skip to content

Commit

Permalink
fix: TabBar Icon color prop
Browse files Browse the repository at this point in the history
  • Loading branch information
artalat committed Apr 25, 2022
1 parent a627032 commit 6fd00ea
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/helpers/tabUtils.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,14 @@ export const getTitle = (options: any = {}, focused: boolean = false, theme: The

const activeTintColor = tabBarOptions.activeTintColor || theme.palette.text.primary;
const inactiveTintColor = tabBarOptions.inactiveTintColor || theme.palette.text.secondary;
const tintColor = focused ? activeTintColor : inactiveTintColor;
const color = focused ? activeTintColor : inactiveTintColor;

if (typeof label === 'function') {
return label({ focused, tintColor });
return label({ focused, color });
}

return (
<Text testID="tab-title" style={{ color: tintColor, ...tabBarOptions.labelStyle }}>
<Text testID="tab-title" style={{ color, ...tabBarOptions.labelStyle }}>
{label}
</Text>
);
Expand All @@ -36,13 +36,13 @@ export const getIcon = (options: any = {}, focused: boolean = false, theme: Them

const activeTintColor = tabBarOptions.activeTintColor || theme.palette.text.primary;
const inactiveTintColor = tabBarOptions.inactiveTintColor || theme.palette.text.secondary;
const tintColor = focused ? activeTintColor : inactiveTintColor;
const color = focused ? activeTintColor : inactiveTintColor;

if (typeof icon === 'function') {
return icon({
focused,
horizontal: !isMobile(),
tintColor,
color,
});
}

Expand Down

0 comments on commit 6fd00ea

Please sign in to comment.