Skip to content

Instantly share code, notes, and snippets.

@cabelotaina
Created January 10, 2017 20:56
Show Gist options
  • Save cabelotaina/990cd3df53ee222d638fe6cc5491c430 to your computer and use it in GitHub Desktop.
Save cabelotaina/990cd3df53ee222d638fe6cc5491c430 to your computer and use it in GitHub Desktop.
React Native Navbar working with this.props.navigator
render() {
return (
<Navigator
renderScene={this.renderScene.bind(this)}
navigator={this.props.navigator}
navigationBar={
<Navigator.NavigationBar
routeMapper={{
LeftButton: (route, navigator, index, navState) => {
return (
<TouchableOpacity
style={sh.view}
onPress={() => this.props.navigator.push({id: 'MainPage'})}
>
<Image
style={sh.logo}
source={require('../assets/images/promoaki_icon_splash.png')}
/>
</TouchableOpacity>
);
},
RightButton: (route, navigator, index, navState) => {
return (
<TouchableOpacity
style={sh.view}
onPress={() => this.props.navigator.push({id:"Menu"})}
>
<View style={{padding:20}}>
<Icon name="tag" size={30} color="black" />
</View>
</TouchableOpacity>
);
},
Title: (route, navigator, index, navState) => {
return null;
}
}}
/>
}
/>
);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment