Skip to content

Commit

Permalink
Feat(TabBar): add pressOpacity for TabBar (#956)
Browse files Browse the repository at this point in the history
* Feat(TabBar): add pressOpacity for TabBar

* Feat(Doc): add doc for pressOpacity
  • Loading branch information
Swordsman-Inaction authored and charpeni committed Jul 27, 2016
1 parent 17dcc42 commit e6b967a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions docs/API_CONFIGURATION.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ Actions.ROUTE_NAME({type: ActionConst.RESET});
| tabBarStyle | [`View style`](https://facebook.github.io/react-native/docs/view.html#style) | | optional style override for the Tabs component |
| tabBarIconContainerStyle | [`View style`](https://facebook.github.io/react-native/docs/view.html#style) | | optional style override for the View that contains each tab icon |
| hideTabBar | `bool` | false | hides tab bar for this scene and any following scenes until explicitly reversed (if built-in TabBar component is used as parent renderer)|
| pressOpacity | `number` | 0.2 | the opacity when clicking on the tab |


### Navigation Bar
Expand Down
2 changes: 2 additions & 0 deletions src/TabBar.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ class TabBar extends Component {
tabIcon: PropTypes.any,
onNavigate: PropTypes.func,
unmountScenes: PropTypes.bool,
pressOpacity: PropTypes.number,
};

constructor(props, context) {
Expand Down Expand Up @@ -66,6 +67,7 @@ class TabBar extends Component {
iconStyle={state.tabBarIconContainerStyle}
onSelect={this.onSelect} {...state}
selected={state.children[state.index].sceneKey}
pressOpacity={this.props.pressOpacity}
>
{state.children.filter(el => el.icon || this.props.tabIcon).map(el => {
const Icon = el.icon || this.props.tabIcon;
Expand Down

0 comments on commit e6b967a

Please sign in to comment.