Skip to content

Commit

Permalink
add onLeft and leftTitle to match onRight, rightTitle
Browse files Browse the repository at this point in the history
  • Loading branch information
lrettig committed Jan 12, 2016
1 parent 8584d11 commit 5c6f76c
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions ExRouter.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,16 @@ export class ExRouteAdapter {
}

renderLeftButton(navigator, index, state){
if (this.route.props.onLeft && this.route.props.leftTitle) {
return (<TouchableOpacity
touchRetentionOffset={ExNavigator.Styles.barButtonTouchRetentionOffset}
onPress={() => this.route.props.onLeft({...this.route.props, ...this.props})}
style={[ExNavigator.Styles.barLeftButton, this.route.props.leftButtonStyle]}>
<Text
style={[ExNavigator.Styles.barLeftButtonText, this.route.props.leftButtonTextStyle]}>{this.route.props.leftTitle}</Text>
</TouchableOpacity>);
}

if (index === 0 || index < navigator.getCurrentRoutes().length-1) {
return null;
}
Expand Down

0 comments on commit 5c6f76c

Please sign in to comment.