-
Notifications
You must be signed in to change notification settings - Fork 0
/
App.js
101 lines (96 loc) · 2.31 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
import React from 'react'
import { View, StatusBar } from 'react-native'
import { createStore } from 'redux'
import { Provider } from 'react-redux'
import { createBottomTabNavigator, createStackNavigator, createAppContainer } from 'react-navigation'
import { Constants } from 'expo'
import { FontAwesome } from '@expo/vector-icons'
import reducer from './reducers'
import middleware from './middleware'
import DecksList from './components/DecksList'
import DeckPage from './components/DeckPage'
import NewDeck from './components/NewDeck'
import NewCard from './components/NewCard'
import Quiz from './components/Quiz'
import { setLocalNotification } from './utils/helpers'
function UdaciStatusBar() {
return (
<View style={{ height: Constants.statusBarHeight }}>
<StatusBar />
</View>
)
}
const Tabs = createAppContainer(createBottomTabNavigator({
DecksList: {
screen: DecksList,
navigationOptions: {
tabBarLabel: 'Decks',
tabBarIcon: ({ tintColor }) => <FontAwesome name="book" color={tintColor} size={30} />
}
},
NewDeck: {
screen: NewDeck,
navigationOptions: {
tabBarLabel: 'Add Deck',
tabBarIcon: ({ tintColor }) => <FontAwesome name="plus-square-o" color={tintColor} size={30} />
}
}
}, {
tabBarOptions: {
inactiveTintColor: '#bbb',
activeTintColor: '#15b394',
style: {
borderTopWidth: 1,
borderStyle: 'solid',
borderTopColor: '#ddd',
height: 56
}
}
}))
const MainNavigator = createAppContainer(createStackNavigator({
Home: {
screen: Tabs
},
DeckPage: {
screen: DeckPage
},
NewCard: {
screen: NewCard,
navigationOptions: {
title: 'Add Card'
}
},
Quiz: {
screen: Quiz,
navigationOptions: {
title: 'Quiz'
}
}
}, {
defaultNavigationOptions: {
headerTintColor: '#15b394',
headerStyle: {
borderBottomWidth: 1,
borderStyle: 'solid',
borderBottomColor: '#ddd'
},
headerTitleStyle: {
color: '#000000'
}
}
}))
export default class App extends React.Component {
componentDidMount() {
setLocalNotification()
}
render() {
return (
<Provider store={createStore(reducer, middleware)}>
<View style={{flex: 1}}>
<UdaciStatusBar />
<MainNavigator />
</View>
</Provider>
)
}
}