-
Notifications
You must be signed in to change notification settings - Fork 1
/
App.js
126 lines (120 loc) · 3.22 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
117
118
119
120
121
122
123
124
125
126
import React from 'react';
import { StyleSheet, Text, View, Platform, StatusBar } from 'react-native';
import CreateQuiz from './components/CreateQuiz'
import Quizzes from './components/Quizzes'
import Quiz from './components/Quiz'
import AddQuizCard from './components/AddQuizCard'
import QuizCard from './components/QuizCard'
import { TabNavigator, StackNavigator, TabBarBottom } from 'react-navigation'
import { lightGray, lightRed, black, yellow, white } from './utils/colors'
import { createStore } from 'redux'
import { Provider } from 'react-redux'
import reducer from './reducers'
import { Constants } from 'expo'
import { Ionicons } from '@expo/vector-icons'
import { getIcon, appNameFont, setLocalNotification, removeLocalNotification } from './utils/helpers'
function FlashCardsStatusBar ({ backgroundColor, ...props }) {
return (
<View style={{backgroundColor, height: Constants.statusBarHeight}}>
<StatusBar translucent backgroundColor={backgroundColor} {...props}/>
</View>
)
}
const Tabs = TabNavigator({
Quizzes: {
screen: Quizzes,
navigationOptions: {
tabBarLabel: 'Quizzes',
tabBarIcon: ({ tintColor }) => ( Platform.OS === 'ios'
? getIcon(Ionicons, tintColor, 'ios-list' )
: getIcon(Ionicons, tintColor, 'md-list' ) )
},
},
CreateQuiz: {
screen: CreateQuiz,
navigationOptions: {
tabBarLabel: 'Create Quiz',
tabBarIcon: ({ tintColor }) => ( Platform.OS === 'ios'
? getIcon(Ionicons, tintColor, 'ios-add-circle' )
: getIcon(Ionicons, tintColor, 'md-add-circle' ) )
}
},
},
{
navigationOptions: {
title: "Cartaz",
headerStyle: { backgroundColor: lightRed },
headerTitleStyle: { color: white, fontFamily: appNameFont, fontSize: 25 },
},
tabBarComponent: TabBarBottom,
tabBarPosition: 'bottom',
tabBarOptions: {
activeTintColor: white,
style: {
height: 56,
backgroundColor: black,
shadowColor: 'rgba(0, 0, 0, 0.24)',
shadowOffset: {
width: 0,
height: 3
},
shadowRadius: 6,
shadowOpacity: 1,
}
}
}
)
const MainNavigator = StackNavigator({
Home: {
screen: Tabs,
},
Quiz: {
screen: Quiz,
navigationOptions: {
headerTintColor: white,
headerStyle: {
backgroundColor: lightRed,
}
}
},
AddQuizCard: {
screen: AddQuizCard,
navigationOptions: {
headerTintColor: white,
headerStyle: {
backgroundColor: lightRed,
},
}
},
QuizCard: {
screen: QuizCard,
navigationOptions: {
headerTintColor: white,
headerStyle: {
backgroundColor: lightRed,
}
}
},
})
const store = createStore(reducer)
export default class App extends React.Component {
//TODO start setting local notifications reminder once past intial release stage
//componentDidMount () {
// setLocalNotification()
//}
render() {
return (
<Provider store={store}>
<View style={styles.container}>
<FlashCardsStatusBar backgroundColor={lightRed} barStyle='light-content'/>
<MainNavigator/>
</View>
</Provider>
);
}
}
const styles = StyleSheet.create({
container: {
flex: 1,
},
});