41 lines
740 B
JavaScript
41 lines
740 B
JavaScript
|
import React from 'react-native';
|
||
|
|
||
|
var {
|
||
|
StyleSheet,
|
||
|
TouchableHighlight,
|
||
|
View,
|
||
|
Text
|
||
|
} = React;
|
||
|
|
||
|
var styles = StyleSheet.create({
|
||
|
container: {
|
||
|
flex: 1,
|
||
|
justifyContent: 'center',
|
||
|
},
|
||
|
toolbarButton: {
|
||
|
paddingHorizontal: 10,
|
||
|
},
|
||
|
});
|
||
|
|
||
|
export default class NavigationButton extends React.Component {
|
||
|
_goBack() {
|
||
|
this.props.nav.pop();
|
||
|
}
|
||
|
|
||
|
render() {
|
||
|
if (this.props.nav.getCurrentRoutes().length <= 1) {
|
||
|
return <View />;
|
||
|
}
|
||
|
return (
|
||
|
<View style={styles.container}>
|
||
|
<TouchableHighlight
|
||
|
style={styles.toolbarButton}
|
||
|
underlayColor="#FFF"
|
||
|
onPress={this._goBack.bind(this)}>
|
||
|
<Text>B</Text>
|
||
|
</TouchableHighlight>
|
||
|
</View>
|
||
|
);
|
||
|
}
|
||
|
}
|