-
Notifications
You must be signed in to change notification settings - Fork 0
/
App.js
115 lines (109 loc) · 2.8 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
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
import "react-native-gesture-handler";
import React, { useEffect } from "react";
import { Platform, StyleSheet } from "react-native";
import { white, purple, gray } from "./utils/colors";
import { NavigationContainer } from "@react-navigation/native";
import { createStackNavigator } from "@react-navigation/stack";
import { createBottomTabNavigator } from "@react-navigation/bottom-tabs";
import { Icon } from "react-native-elements";
import DeckList from "./components/DeckList";
import DeckListItem from "./components/DeckListItem";
import AddDeck from "./components/AddDeck";
import AddQuestion from "./components/AddQuestion";
import Quiz from "./components/Quiz";
import { setNotification, clearNotification } from "./utils/notification";
const Home = () => {
const Tab = createBottomTabNavigator();
return (
<Tab.Navigator>
<Tab.Screen
name="DeckListItem"
component={DeckListItem}
options={{
tabBarLabel: "Deck List Item",
tabBarIcon: ({ tintColor }) => <Icon name="list" size={30} color={tintColor} />,
}}
/>
<Tab.Screen
name="AddDeck"
component={AddDeck}
options={{
tabBarLabel: "Add Deck",
tabBarIcon: ({ tintColor }) => <Icon name="list" size={30} color={tintColor} />,
}}
/>
</Tab.Navigator>
);
};
export default function App() {
useEffect(() => {
setNotification();
}, []);
const Stack = createStackNavigator();
return (
<NavigationContainer>
<Stack.Navigator>
<Stack.Screen name="Home" component={Home} options={{ title: "Deck List" }} />
<Stack.Screen name="DeckList" component={DeckList} options={({ route }) => ({ title: route.params.title })} />
<Stack.Screen
name="AddQuestion"
component={AddQuestion}
options={({ route }) => ({ title: route.params.title })}
/>
<Stack.Screen name="Quiz" component={Quiz} options={({ route }) => ({ title: route.params.title + " Quiz" })} />
</Stack.Navigator>
</NavigationContainer>
);
}
const styles = StyleSheet.create({
container: {
flex: 1,
alignItems: "center",
},
input: {
height: 40,
borderColor: gray,
borderWidth: 1,
marginBottom: 20,
paddingLeft: 3,
width: 300,
marginTop: 50,
},
deck: {
width: 250,
justifyContent: "space-around",
alignContent: "center",
backgroundColor: white,
borderColor: "black",
borderWidth: 1,
borderRadius: 5,
padding: 15,
paddingLeft: 25,
paddingRight: 25,
marginBottom: 20,
marginTop: 20,
},
deckTitle: {
fontSize: 20,
fontWeight: "bold",
},
deckSubTitle: {
fontSize: 13,
fontWeight: "bold",
paddingTop: 5,
},
button: {
width: 250,
flexDirection: "row",
justifyContent: "space-around",
alignContent: "center",
backgroundColor: white,
borderColor: purple,
borderWidth: 1,
borderRadius: 10,
padding: 15,
paddingLeft: 25,
paddingRight: 25,
marginBottom: 25,
},
});