-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathApp.js
More file actions
61 lines (55 loc) · 1.92 KB
/
App.js
File metadata and controls
61 lines (55 loc) · 1.92 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
import React, { useState } from 'react';
import GigTrackerNavigator from './navigation/GigTrackerNavigator';
import { createStore, combineReducers, applyMiddleware } from 'redux';
import { Provider } from 'react-redux';
import ReduxThunk from 'redux-thunk';
import { AppLoading } from 'expo';
import * as Font from 'expo-font';
import { YellowBox } from 'react-native';
import _ from 'lodash';
import eventsReducer from './store/reducers/events'
import userReducer from './store/reducers/user';
import { composeWithDevTools } from 'redux-devtools-extension';
const rootReducer = combineReducers({
events: eventsReducer,
user: userReducer
});
const store = createStore(rootReducer, composeWithDevTools(applyMiddleware(ReduxThunk)));
//Look into, andriod issue where you get warnings when communicating with firebase/api
YellowBox.ignoreWarnings(['Setting a timer']);
// Get error for having a dropdown picker (iOS) in create event screen
YellowBox.ignoreWarnings(['VirtualizedLists should never be nested']);
const _console = _.clone(console);
console.warn = message => {
if (message.indexOf('Setting a timer') <= -1) {
_console.warn(message);
}
};
const fetchFonts = async() => {
await Font.loadAsync({
'jack-silver': require('./assets/fonts/Jacksilver.ttf'),
'dumbledor': require('./assets/fonts/dumbledor.3-cut-up.ttf'),
'Helvetica-Bold': require('./assets/fonts/Helvetica-Bold-Font.ttf'),
'Helvetica': require('./assets/fonts/Helvetica.ttf'),
Roboto: require("native-base/Fonts/Roboto.ttf"),
Roboto_medium: require("native-base/Fonts/Roboto_medium.ttf")
});
};
export default function App() {
const [fontLoaded, setFontLoaded] = useState(false);
if (!fontLoaded) {
return (
<AppLoading
startAsync={fetchFonts}
onFinish={() => {
setFontLoaded(true);
}}
/>
);
}
return (
<Provider store={store} >
<GigTrackerNavigator />
</Provider>
);
};