-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDrawerScreen.js
More file actions
95 lines (92 loc) · 2.46 KB
/
Copy pathDrawerScreen.js
File metadata and controls
95 lines (92 loc) · 2.46 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
import React, { Component } from 'react';
import firebase from 'react-native-firebase';
import {
StyleSheet,
View,
Text,
TouchableHighlight,
ScrollView,
Button,
} from 'react-native';
import { withNavigation } from 'react-navigation';
type Props = {};
class DrawerScreen extends Component<Props> {
constructor(props){
super(props);
}
handleLogOut =() =>{
firebase.auth().signOut().then(function() {
this.props.navigation.navigate('Login');
}).catch(function(error) {
// An error happened.
});
}
render() {
return (
<ScrollView style={styles.container}>
<View style={styles.buttonsty}>
<TouchableHighlight style={styles.touchable} underlayColor="#696969"
onPress={() => {this.props.navigation.navigate('MainPanel')}}>
<View style={styles.button}>
<Text style={styles.buttonText}>Home</Text>
</View>
</TouchableHighlight>
</View>
<View style={styles.buttonsty}>
<TouchableHighlight style={styles.touchable} underlayColor="#696969"
onPress={() => {this.props.navigation.navigate('PromotionPanel')}}>
<View style={styles.button}>
<Text style={styles.buttonText}>Promotion</Text>
</View>
</TouchableHighlight>
</View>
<View style={styles.buttonsty}>
<TouchableHighlight style={styles.touchable} underlayColor="#696969"
onPress={() => {this.handleLogOut()}}>
<View style={styles.button}>
<Text style={styles.buttonText}>Log Out</Text>
</View>
</TouchableHighlight>
</View>
</ScrollView>
)
}
}
export default withNavigation(DrawerScreen);
const styles = StyleSheet.create({
container: {
flex: 1,
// justifyContent: 'center',
// alignItems: 'center',
padding: 10,
backgroundColor: 'white',
},
text: {
fontSize: 48,
color: 'black',
},
center:{
justifyContent: 'center',
alignItems: 'center',
},
touchable:{
width:300,
},
buttonsty: {
flex: 1,
marginBottom: 10,
alignItems: 'center',
borderBottomColor: 'black',
borderBottomWidth: 1,
marginBottom: 10,
},
button:{
alignItems: 'center',
justifyContent: 'center',
},
buttonText: {
padding: 15,
color: 'black',
fontSize: 20,
},
})