This repository has been archived by the owner on Oct 9, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 7
/
App.js
84 lines (77 loc) · 1.83 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
/**
* React Natives App
* https://github.com/react-natives/react-natives-app
* @flow
*/
import React, { Component } from "react";
import { StyleSheet, View, StatusBar, AsyncStorage } from "react-native";
import { StackNavigator } from "react-navigation";
import { createStore, applyMiddleware } from "redux";
import { Provider } from "react-redux";
import { persistStore, autoRehydrate } from "redux-persist";
import { composeWithDevTools } from "remote-redux-devtools";
import logger from "redux-logger";
import Map from "./js/meetups/map";
import List from "./js/meetups/list";
import Videos from "./js/meetups/videos";
import reducer from "./js/reducers/";
const composeEnhancers = composeWithDevTools(
{
// Specify here name, actionsBlacklist, actionsCreators and other options if needed
}
);
const store = createStore(
reducer,
/* preloadedState, */
composeEnhancers(applyMiddleware(logger), autoRehydrate())
);
persistStore(store, { storage: AsyncStorage });
const Router = StackNavigator(
{
List: { screen: List },
Map: { screen: Map },
Videos: { screen: Videos }
},
{
navigationOptions: {
header: {
style: {
backgroundColor: "#5555FF"
},
tintColor: "white"
}
}
}
);
export default class App extends Component {
render() {
return (
<Provider store={store}>
<View style={styles.flex}>
<StatusBar barStyle="light-content" />
<Router />
</View>
</Provider>
);
}
}
let styles = {
flex: {
flex: 1
},
container: {
...StyleSheet.absoluteFillObject,
justifyContent: "flex-end",
flex: 1,
alignItems: "center",
backgroundColor: "#F5FCFF"
},
navBar: {
backgroundColor: "#5555FF"
},
navBarText: {
color: "white",
fontWeight: "bold"
}
};
styles = StyleSheet.create(styles);