-
Notifications
You must be signed in to change notification settings - Fork 0
/
App.js
93 lines (85 loc) · 2.58 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
import React from 'react';
import {
StyleSheet,
Text,
View,
TouchableOpacity,
StatusBar
} from 'react-native';
import { Constants } from 'expo';
import { MaterialIcons } from '@expo/vector-icons';
import { TabNavigator, StackNavigator } from 'react-navigation';
import { createStore, applyMiddleware } from 'redux';
import { Provider } from 'react-redux';
import reducer from './reducers';
import ReduxThunk from 'redux-thunk';
import { FontAwesome, Ionicons } from '@expo/vector-icons'
import CreateDeck from './components/CreateDeack'
import DeckView from './components/DeckView'
import ListDecks from './components/ListDecks'
import AddQuizItem from "./components/AddQuizItem";
import Exam from './components/Exam'
import { setLocalNotification } from "./utils/notifications"
import { purple, blue, white} from "./utils/colors"
// custom status bar
function FlashCardStatusBar ({ backgroundColor, ...props }) {
return (
<View style={{backgroundColor, height: Constants.statusBarHeight}}>
<StatusBar translucent backgroundColor={backgroundColor} {...props}/>
</View>
)
}
export default class App extends React.Component {
componentDidMount() {
setLocalNotification();
}
render() {
const Tabs = TabNavigator({
DeckList: {
screen: ListDecks,
navigationOptions: {
tabBarLabel: 'Deck List',
}
},
NewDeck: {
screen: CreateDeck,
navigationOptions: {
tabBarLabel: 'New Deck',
}
}
}
);
const navOptions = {
headerTintColor: '#FFF',
headerStyle: {
backgroundColor: '#1485ff'
}
}
const App = StackNavigator({
Home: {
screen: Tabs,
navigationOptions: { ...navOptions, title: 'FlashCards' }
},
DeckView: {
screen: DeckView,
navigationOptions: navOptions
},
AddQuizItem: {
screen: AddQuizItem,
navigationOptions: { ...navOptions, title: 'Add Quiz Item' }
},
Exam: {
screen: Exam,
navigationOptions: { ...navOptions, title: 'Exam' }
}
})
return (
<Provider store={createStore(reducer, applyMiddleware(ReduxThunk))}>
<View style={{flex: 1}}>
<FlashCardStatusBar backgroundColor={purple} barStyle='light-content'/>
<App/>
</View>
</Provider>
);
}
}