This repository has been archived on 2023-03-26. You can view files and clone it, but cannot push or open issues or pull requests.
Sphere/app/components/navigation/BackButton.js

44 lines
929 B
JavaScript
Raw Permalink Normal View History

2016-02-06 15:07:29 +00:00
import React from 'react-native';
2016-02-06 15:49:57 +00:00
import GlobalStyles from '../../settings/styles';
2016-03-11 21:20:46 +00:00
import Icon from 'react-native-vector-icons/Ionicons';
2016-02-06 15:07:29 +00:00
var {
StyleSheet,
TouchableHighlight,
View,
Text
} = React;
2016-02-06 15:49:57 +00:00
const styles = StyleSheet.create({
2016-02-06 15:07:29 +00:00
container: {
flex: 1,
justifyContent: 'center',
},
toolbarButton: {
2016-02-06 16:46:41 +00:00
paddingHorizontal: 15,
2016-02-06 15:07:29 +00:00
},
2016-02-06 15:49:57 +00:00
text: {
2016-03-18 13:28:02 +00:00
color: GlobalStyles.get('CIRCLE_NAVBAR_TEXT'),
paddingHorizontal: 10
2016-02-06 15:49:57 +00:00
}
2016-02-06 15:07:29 +00:00
});
export default class NavigationButton extends React.Component {
2016-02-06 15:49:57 +00:00
goBack() {
2016-02-06 15:07:29 +00:00
this.props.nav.pop();
}
render() {
return (
<View style={styles.container}>
<TouchableHighlight
style={styles.toolbarButton}
2016-02-06 15:49:57 +00:00
underlayColor={GlobalStyles.get('CIRCLE_NAVBAR_BG')}
onPress={this.goBack.bind(this)}>
2016-03-11 21:20:46 +00:00
<Text style={styles.text}><Icon name="chevron-left" /></Text>
2016-02-06 15:07:29 +00:00
</TouchableHighlight>
</View>
);
}
}