44 lines
906 B
JavaScript
44 lines
906 B
JavaScript
import React from 'react-native';
|
|
import GlobalStyles from '../../settings/styles';
|
|
|
|
var {
|
|
StyleSheet,
|
|
TouchableHighlight,
|
|
View,
|
|
Text
|
|
} = React;
|
|
|
|
const styles = StyleSheet.create({
|
|
container: {
|
|
flex: 1,
|
|
justifyContent: 'center',
|
|
},
|
|
toolbarButton: {
|
|
paddingHorizontal: 10,
|
|
},
|
|
text: {
|
|
color: GlobalStyles.get('CIRCLE_NAVBAR_TEXT')
|
|
}
|
|
});
|
|
|
|
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={GlobalStyles.get('CIRCLE_NAVBAR_BG')}
|
|
onPress={this.goBack.bind(this)}>
|
|
<Text style={styles.text}>B</Text>
|
|
</TouchableHighlight>
|
|
</View>
|
|
);
|
|
}
|
|
}
|