Skip to content

Commit

Permalink
Merge pull request #119 from lrettig/lrettig-patch-1
Browse files Browse the repository at this point in the history
Add onLeft, leftTitle, etc. route props
  • Loading branch information
Pavlo Aksonov committed Jan 12, 2016
2 parents 6591f69 + 5c6f76c commit 0e66b7f
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 0e66b7f

Please sign in to comment.