-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathApp.js
More file actions
116 lines (108 loc) · 3.44 KB
/
Copy pathApp.js
File metadata and controls
116 lines (108 loc) · 3.44 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
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
import { StatusBar } from 'expo-status-bar';
import React, { useEffect } from 'react';
import { AsyncStorage, SafeAreaView, StyleSheet, Text, View } from 'react-native';
import { NavigationContainer } from '@react-navigation/native';
import { createStackNavigator, StackView } from '@react-navigation/stack';
import { createBottomTabNavigator } from '@react-navigation/bottom-tabs';
import { createMaterialTopTabNavigator } from '@react-navigation/material-top-tabs';
import DeckList from './components/DeckList';
import AddDeck from './components/AddDeck';
import Deck from './components/Deck';
import Quiz from './components/Quiz';
import NewQuestion from './components/NewQuestion';
import { createStore } from 'redux';
import reducer from './reducers'
import { Provider } from 'react-redux';
import { blue, brown, purple, red, yellow } from './colors'
import Constants from 'expo-constants';
import { Ionicons } from '@expo/vector-icons';
import { MaterialIcons } from '@expo/vector-icons';
import { setLocalNotification } from './notifications';
const RouteConfigs = {
DeckList:{
name: "DeckList",
component: DeckList,
options: {tabBarIcon: ({tintColor}) => <Ionicons name='ios-file-tray-full-outline' size={24} color={yellow} />, title: 'Decks'}
},
AddDeck:{
component: AddDeck,
name: "AddDeck",
options: {tabBarIcon: ({tintColor}) => <MaterialIcons name="create-new-folder" size={24} color={yellow} />, title: 'Add Deck'}
},
}
const TabNavigatorConfig = {
navigationOptions: {
header: null
},
tabBarOptions: {
activeTintColor: yellow,
style: {
// height: 56,
backgroundColor: blue,
shadowColor: "rgba(0, 0, 0, 0.24)",
shadowOffset: {
width: 0,
height: 3
},
shadowRadius: 6,
shadowOpacity: 1
}
},
backBehaviour: 'initialRoute',
initialRouteName: 'DeckList'
};
const Tab = Platform.OS === 'ios'
? createBottomTabNavigator()
: createMaterialTopTabNavigator()
const Tabs = ({navigation}) => {
return <Tab.Navigator {...TabNavigatorConfig}>
<Tab.Screen {...RouteConfigs['DeckList']} />
<Tab.Screen {...RouteConfigs['AddDeck']} />
</Tab.Navigator>
}
const Stack = createStackNavigator()
const store = createStore(reducer)
export default function App() {
useEffect(() => {
setLocalNotification()
}, [])
return (
<NavigationContainer>
<Provider store={store}>
<View style={{flex: 1}} >
{/* <StatusBar backgroundColor='black' barStyle='light-content'/> */}
<View style={{backgroundColor: blue, height: Constants.statusBarHeight}}>
<StatusBar translucent backgroundColor={red} barStyle="light-content" />
</View>
<Stack.Navigator
initialRouteName="Decks"
headerMode="screen"
screenOptions={{
headerStyle: {
backgroundColor: blue,
},
headerTintColor: '#fff',
}}
>
<Stack.Screen
name="Decks"
component={Tabs}
/>
<Stack.Screen
name="Deck"
component={Deck}
/>
<Stack.Screen
name="NewQuestion"
component={NewQuestion}
/>
<Stack.Screen
name="Quiz"
component={Quiz}
/>
</Stack.Navigator>
</View>
</Provider>
</NavigationContainer>
);
}