-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathApp.js
92 lines (85 loc) · 2.03 KB
/
App.js
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
import "react-native-gesture-handler"
import React from "react"
import {StyleSheet, Text, View, TouchableOpacity} from "react-native"
import {NavigationContainer} from "@react-navigation/native"
import {createDrawerNavigator} from "@react-navigation/drawer"
import Decks from "./components/Decks"
import ViewDeck from "./components/ViewDeck"
const Drawer = createDrawerNavigator();
const App = () => {
return(
<View style={styles.parent}>
<NavigationContainer>
<PrimaryNav></PrimaryNav>
</NavigationContainer>
</View>
)
};
export function PrimaryNavOpen({navigation}){
return(
<View style={[styles.navBtn, styles.shadow]}>
<TouchableOpacity title="Open drawer" onPress={() => navigation.openDrawer()}>
<Text style={styles.navFont}>Open Navigation</Text>
</TouchableOpacity>
</View>
)
};
function PrimaryNav(){
return(
<Drawer.Navigator>
<Drawer.Screen name="Decks" component={Decks}></Drawer.Screen>
<Drawer.Screen name="ViewDeck" component={ViewDeck} options={{drawerLabel: () => null}}></Drawer.Screen>
</Drawer.Navigator>
)
};
const styles = StyleSheet.create({
parent: {
flex: 1,
backgroundColor: "#F5FCFF",
position: "relative"
},
container: {
flex: 1,
justifyContent: "center",
alignItems: "center",
backgroundColor: "#F5FCFF",
position: "relative"
},
welcome: {
fontSize: 20,
textAlign: "center",
margin: 10,
},
instructions: {
textAlign: "center",
color: "#333333",
marginTop: 55,
},
fontColor: {
color: "black"
},
navBtn: {
position: "absolute",
top: 0,
left: 0,
padding: 15,
backgroundColor: "red",
color: "white",
textAlign: "center",
marginTop: 100,
marginBottom: "auto",
width: "100%",
zIndex: 100
},
navFont: {
fontSize: 22,
color: "azure"
},
shadow: {
shadowColor: "rgba(0, 0, 0, 0.5)",
shadowOffset: {width: 0, height: 2},
shadowOpacity: 0.8,
shadowRadius: 2
}
});
export default App