Skip to content

Commit

Permalink
Merge pull request #420 from RWOverdijk/hotfix/rename-variable
Browse files Browse the repository at this point in the history
chore(navbar): Renamed variable
  • Loading branch information
aksonov committed Mar 29, 2016
2 parents 9df234a + c6033a8 commit ce75898
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/NavBar.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,31 +78,31 @@ export default class NavBar extends React.Component {
}

_renderBackButton() {
let backButtonImage;
let buttonImage;

if (this.props.navigationState.index === 0) {
if(!!this.context.drawer && typeof this.context.drawer.toggle === 'function'){

backButtonImage = this.props.navigationState.drawerImage || require('./menu_burger.png');
buttonImage = this.props.navigationState.drawerImage || require('./menu_burger.png');

return (
<TouchableOpacity style={[styles.backButton, this.props.navigationState.leftButtonStyle]} onPress={() => {
var drawer = this.context.drawer;
drawer.toggle();
}}>
<Image source={backButtonImage} style={[styles.backButtonImage, this.props.navigationState.barButtonIconStyle]}/>
<Image source={buttonImage} style={[styles.backButtonImage, this.props.navigationState.barButtonIconStyle]}/>
</TouchableOpacity>
);
}else{
return null;
}
}

backButtonImage = this.props.navigationState.backButtonImage || require('./back_chevron.png');
buttonImage = this.props.navigationState.backButtonImage || require('./back_chevron.png');

return (
<TouchableOpacity style={[styles.backButton, this.props.navigationState.leftButtonStyle]} onPress={Actions.pop}>
<Image source={backButtonImage} style={[styles.backButtonImage, this.props.navigationState.barButtonIconStyle]}/>
<Image source={buttonImage} style={[styles.backButtonImage, this.props.navigationState.barButtonIconStyle]}/>
</TouchableOpacity>
);
}
Expand Down

0 comments on commit ce75898

Please sign in to comment.