-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathDrawer.js
More file actions
38 lines (35 loc) · 1.2 KB
/
Drawer.js
File metadata and controls
38 lines (35 loc) · 1.2 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
import React from 'react';
import { StyleSheet, Text,View ,TouchableOpacity} from 'react-native';
import {FontAwesome} from '@expo/vector-icons';
const Drawer = (props) => (
<View style={styles.container}>
<View>
<Text style={[styles.text,{fontSize:30,textDecorationLine:'underline'}]}>MENU</Text>
<Text onPress={()=>{
//This is workaround to prevent loading first screen ever and over
const { state } = props.navigation;
if (state.routes[0].routes[state.routes[0].routes.length-1].routeName=='First'){
return null
}
//End of workaround
props.navigation.navigate('First')}} style={styles.text}>Go to First</Text>
<Text onPress={()=>props.navigation.navigate('Second')} style={styles.text}>Go to Second</Text>
<Text onPress={()=>props.navigation.navigate('Third')} style={styles.text}>Go to Third</Text>
</View>
</View>
)
const styles = StyleSheet.create({
container: {
flex:1,
backgroundColor: 'rgb(103, 235, 148)',
justifyContent:'center',
alignItems:'center',
paddingTop:50,
},
text: {
fontSize: 24,
fontWeight: 'bold',
color: 'rgb(43, 167, 85)'
}
})
export default Drawer;