-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathApp.js
More file actions
97 lines (87 loc) · 2.3 KB
/
App.js
File metadata and controls
97 lines (87 loc) · 2.3 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
import React from 'react';
import {StyleSheet, View, StatusBar} from 'react-native';
import {createStore, applyMiddleware} from 'redux'
import {Provider} from 'react-redux'
import decks from './reducers'
import {logger} from './middleware'
import thunk from 'redux-thunk'
import Constants from 'expo-constants'
import {createBottomTabNavigator, createStackNavigator, createAppContainer} from 'react-navigation'
import {MaterialCommunityIcons, AntDesign} from '@expo/vector-icons'
import AddDeck from './components/AddDeck'
import AddCard from './components/AddCard'
import DeckList from './components/DeckList'
import DeckMenu from './components/DeckMenu'
import Quiz from './components/Quiz'
import QuizSummary from './components/QuizSummary'
import {setLocalNotification} from './utils/helpers'
const CardsStatusBar = ({backgroundColor, ...props}) => {
return (
<View style={{backgroundColor, height: Constants.statusBarHeight}}>
<StatusBar translucent backgroundColor={backgroundColor} {...props}/>
</View>
)
}
const Tabs = createBottomTabNavigator({
DeckList: {
screen: DeckList,
navigationOptions: {
tabBarLabel: 'Decks',
tabBarIcon: ({tintColor}) => <MaterialCommunityIcons name='cards-outline' color={tintColor}/>
}
},
AddDeck: {
screen: AddDeck,
navigationOptions: {
tabBarLabel: 'Add Deck',
tabBarIcon: ({tintColor}) => <AntDesign name='pluscircleo' color={tintColor}/>
}
}
})
const MainNavigator = createStackNavigator({
Home: {
screen: Tabs,
navigationOptions: {
header: null
}
},
DeckMenu: {
screen: DeckMenu
},
AddCard: {
screen: AddCard,
navigationOptions: {
title: 'Add New Card'
}
},
Quiz: {
screen: Quiz
},
QuizSummary: {
screen: QuizSummary,
navigationOptions: {
header: null
}
}
})
const AppContainer = createAppContainer(MainNavigator)
const store = createStore(decks, applyMiddleware(thunk, logger))
class App extends React.Component {
componentDidMount() {
setLocalNotification()
}
render() {
return (
<Provider store={store}>
<View style={styles}>
<CardsStatusBar barStyle='light-content'/>
<AppContainer/>
</View>
</Provider>
)
}
}
const styles = StyleSheet.create({
flex: 1
})
export default App