-
Notifications
You must be signed in to change notification settings - Fork 0
/
App.js
94 lines (88 loc) · 1.93 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
import React from 'react';
import { StyleSheet, View , StatusBar} from 'react-native';
import {Provider} from 'react-redux';
import {applyMiddleware} from 'redux';
import reducers from './reducers';
import thunk from 'redux-thunk';
import DeckView from './components/DeckView';
import NewDeck from './components/NewDeck';
import DeckDetail from './components/DeckDetail';
import CardDetail from './components/CardDetail';
import {TabNavigator, StackNavigator} from 'react-navigation';
import {black} from './utils/colors';
import {Constants} from 'expo';
import * as Redux from 'redux';
const store = Redux.createStore(
reducers,
applyMiddleware(thunk)
);
function StatusBarCus({backgroundColor, ...props}){
return (
<View style={{backgroundColor, height:Constants.statusBarHeight}}>
<StatusBar translucent {...{backgroundColor}} {...props}/>
</View>
);
}
const HomeTab = TabNavigator({
DeckView:{
screen:DeckView,
navigationOptions:{
tabBarLabel:'Deck'
}
},
NewDeck:{
screen:NewDeck,
navigationOptions:{
tabBarLabel:'New Deck'
}
}
},{
tabBarOptions:{
style:{
height:56,
backgroundColor: black
}
}
});
const StackNav = StackNavigator({
HomeTab:{
screen:HomeTab,
navigationOptions:{
header:null
}
},
DeckDetail:{
screen:DeckDetail,
navigationOptions:{
headerStyle:{
backgroundColor:black
},
headerTitleStyle:{
color:'white'
}
}
},
CardDetail:{
screen:CardDetail,
navigationOptions:{
headerStyle:{
backgroundColor:black
},
headerTitleStyle:{
color:'white'
}
}
}
});
export default class App extends React.Component {
render() {
return (
<Provider store={store}>
<View style={{flex:1}}>
<StatusBarCus backgroundColor={black} barStyle='light-content' />
<StackNav />
</View>
</Provider>
);
}
}