-
Notifications
You must be signed in to change notification settings - Fork 0
/
App.tsx
71 lines (67 loc) · 1.99 KB
/
App.tsx
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
import { GoogleSignin } from '@react-native-community/google-signin';
import React, { useEffect } from 'react';
import { Router, Scene } from 'react-native-router-flux';
import { Provider } from 'react-redux';
import { combineReducers, createStore } from 'redux';
import { env } from './env';
import BooksList from './src/components/BooksList';
import DetailedInfo from './src/components/DetailedInfo';
import NavigationTabs from './src/components/NavigationTabs';
import SignInContainer from './src/components/SignInContainer';
import UploadBookForm from './src/components/UploadBookForm';
import { ownedBooksReducer } from './src/redux/reducers/OwnedBooksReducer';
import { userReducer } from './src/redux/reducers/UserReducer';
const App = () => {
useEffect(() => {
GoogleSignin.configure({
webClientId: env.FIREBASE_WEB_CLIENT_ID,
offlineAccess: true,
forceCodeForRefreshToken: true,
});
});
const rootReducer = combineReducers({
user: userReducer,
ownedBooks: ownedBooksReducer,
});
const store = createStore(rootReducer);
return (
<Provider store={store}>
<Router>
<Scene key="root">
<Scene
key="loading"
component={SignInContainer}
title="Loading"
hideNavBar={true}
initial
/>
<Scene
key="nav"
component={NavigationTabs}
hideNavBar={true}
title="NavigationTabs"
/>
<Scene
key="uploadBook"
component={UploadBookForm}
hideNavBar={true}
title="UploadBookForm"
/>
<Scene
key="booksList"
component={BooksList}
hideNavBar={true}
title="BooksList"
/>
<Scene
key="detailedInfo"
component={DetailedInfo}
hideNavBar={true}
title="DetailedInfo"
/>
</Scene>
</Router>
</Provider>
);
};
export default App;