-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathApp.js
116 lines (109 loc) · 3.04 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
116
import React from 'react'
import { StyleSheet, Text, View } from 'react-native'
import { TabNavigator, StackNavigator } from 'react-navigation'
import { FontAwesome, Ionicons } from '@expo/vector-icons'
import { createStore, applyMiddleware, compose } from 'redux'
import { Provider } from 'react-redux'
import thunk from 'redux-thunk'
import AddDeck from './components/AddDeck'
import AddCard from './components/AddCard'
import AllDecks from './components/AllDecks'
import EditDeck from './components/EditDeck'
import QuizMe from './components/QuizMe'
import FociStatusBar from './components/FociStatusBar'
import { scheduleStudyReminderNotification } from './api/notifications-api'
import { palette } from './api/palette-api'
import Reducer from './reducers'
//console.log(palette)
const TINT_COLOR = palette.textPrimaryColor.color
const BACKGROUND_COLOR = palette.defaultPrimaryColor.backgroundColor
const Decks=TabNavigator(
{
AllDecks: {
screen: AllDecks,
navigationOptions: {
tabBarLabel: 'All Foci',
tabBarIcon: ({tintColor}) => <Ionicons
name="ios-home"
size={30} color={tintColor} />
}
},
AddDeck: {
screen: AddDeck,
navigationOptions: {
tabBarLabel: 'Add Focus',
tabBarIcon: ({ tintColor }) => <FontAwesome name='plus-square'
size={30}
color={tintColor}
/>
}
}
},
{
tabBarOptions:{
activeTintColor: TINT_COLOR,
showIcon: true,
style:{
backgroundColor: BACKGROUND_COLOR
}
}
})
const Main = StackNavigator ({
Home: {
screen: Decks,
navigationOptions: {
headerTintColor: TINT_COLOR,
headerStyle: {
backgroundColor: BACKGROUND_COLOR
},
title: 'Foci - Focused Learning'
},
animationEnabled: true
},
EditDeck: {
screen: EditDeck,
navigationOptions: {
headerTintColor: TINT_COLOR,
headerStyle: {
backgroundColor: BACKGROUND_COLOR
}
}
},
QuizMe: {
screen: QuizMe,
navigationOptions: {
headerTintColor: TINT_COLOR,
headerStyle: {
backgroundColor: BACKGROUND_COLOR
}
}
},
AddCard: {
screen: AddCard,
navigationOptions: {
headerTintColor: TINT_COLOR,
headerStyle: {
backgroundColor: BACKGROUND_COLOR
}
}
}
})
export default class App extends React.Component {
componentDidMount(){
scheduleStudyReminderNotification()
}
render() {
const store = createStore(Reducer, compose(applyMiddleware(thunk)))
//console.log('store created')
return (
<Provider store={ store }>
<View style={{flex:1}}>
<FociStatusBar backgroundColor = {
palette.darkPrimaryColor.backgroundColor}
barStyle="light-content" />
<Main/>
</View>
</Provider>
);
}
}