-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathApp.js
More file actions
93 lines (86 loc) · 2.36 KB
/
App.js
File metadata and controls
93 lines (86 loc) · 2.36 KB
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, { Component } from 'react';
// import { AppRegistry } from 'react-native';
import {
createStore,
applyMiddleware,
} from 'redux';
import { StackNavigator } from 'react-navigation';
import { createLogger } from 'redux-logger';
import { Provider } from 'react-redux';
import thunk from 'redux-thunk';
import { getAllBooks } from './src/actions';
import reducer from './src/reducers';
import HomeScreenContainer from './src/containers/HomeScreenContainer';
import SearchView from './src/components/HomeScreen/SearchView';
import DetailScreenContainer from './src/containers/DetailScreenContainer';
import LentScanScreenContainer from './src/containers/LentScanScreenContainer';
import EntryScreenContainer from './src/containers/EntryScreenContainer';
import ScanScreenContainer from './src/containers/ScanScreenContainer';
import EntryTagsScreenContainer from './src/containers/EntryTagsScreenContainer';
import { setTopLevelNavigator } from './src/utils/NavigationService';
const RootStack = StackNavigator(
{
Home: {
screen: HomeScreenContainer,
},
Entry: {
screen: EntryScreenContainer,
},
Scan: {
screen: ScanScreenContainer,
},
EntryTags: {
screen: EntryTagsScreenContainer,
},
Detail: {
screen: DetailScreenContainer,
},
Search: {
screen: SearchView,
},
LentScan: {
screen: LentScanScreenContainer,
},
},
{
initialRouteName: 'Home',
// header config
navigationOptions: {
headerStyle: {
backgroundColor: '#c0c0c0',
borderColor: 'transparent',
borderWidth: 0,
shadowColor: 'transparent',
shadowRadius: 0,
elevation: 0, // remove shadow on Android
shadowOpacity: 0, // remove shadow on iOS
shadowOffset: {
height: 0,
width: 0,
},
},
headerTintColor: '#ffffff',
},
},
);
const middleware = [thunk];
if (__DEV__ === true) {
middleware.push(createLogger());
}
const store = createStore(
reducer,
applyMiddleware(...middleware),
);
store.dispatch(getAllBooks());
export default class App extends Component {
render() {
return (
<Provider store={store}>
<RootStack
ref={navigatorRef => setTopLevelNavigator(navigatorRef)}
/>
</Provider>
);
}
}
// AppRegistry.registerComponent('BookSeeker', () => App);