Skip to content

added disableIconTintColor prop to TabController.TabBarItem #1314

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 18 additions & 1 deletion src/components/tabController/TabBarItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,10 @@ export interface TabControllerItemProps {
* Used as a testing identifier
*/
testID?: string;
/**
* disables icon's tint color
*/
disableIconTintColor?: boolean;
}

interface Props extends TabControllerItemProps {
Expand Down Expand Up @@ -226,7 +230,20 @@ export default class TabBarItem extends PureComponent<Props> {
}

getIconStyle() {
const {index, currentPage, iconColor, selectedIconColor, labelColor, selectedLabelColor, ignore} = this.props;
const {
index,
currentPage,
iconColor,
selectedIconColor,
labelColor,
selectedLabelColor,
ignore,
disableIconTintColor
} = this.props;

if (disableIconTintColor) {
return undefined;
}

const activeColor = selectedIconColor || selectedLabelColor || DEFAULT_SELECTED_LABEL_COLOR;
const inactiveColor = iconColor || labelColor || DEFAULT_LABEL_COLOR;
Expand Down