47 lines
932 B
JavaScript
47 lines
932 B
JavaScript
import React from 'react-native';
|
|
|
|
const {
|
|
StyleSheet,
|
|
Text,
|
|
View,
|
|
ScrollView,
|
|
BackAndroid,
|
|
} = React;
|
|
|
|
const styles = StyleSheet.create({
|
|
container: {
|
|
flex: 1,
|
|
backgroundColor: '#333',
|
|
},
|
|
contentWrapper: {
|
|
flex: 0.85,
|
|
justifyContent: 'flex-start',
|
|
alignItems: 'center'
|
|
},
|
|
text: {
|
|
color: 'white'
|
|
}
|
|
});
|
|
|
|
export default class Home extends React.Component {
|
|
|
|
componentWillUnmount() {
|
|
BackAndroid.removeEventListener('hardwareBackPress', () => true);
|
|
}
|
|
|
|
componentWillMount() {
|
|
BackAndroid.addEventListener('hardwareBackPress', () => true);
|
|
}
|
|
|
|
render() {
|
|
return (
|
|
<View style={styles.container}>
|
|
<ScrollView keyboardShouldPersistTaps={false} contentContainerStyle={styles.container}>
|
|
<View style={styles.contentWrapper}>
|
|
<Text style={styles.text}>Home</Text>
|
|
</View>
|
|
</ScrollView>
|
|
</View>
|
|
);
|
|
}
|
|
};
|