-
Notifications
You must be signed in to change notification settings - Fork 1
/
App.tsx
49 lines (39 loc) · 1.2 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
import React, { FC, useState } from "react";
import { LogBox } from "react-native";
import { Provider } from "react-redux";
import { createStore } from "redux";
import { userReducer } from "./reducers/user-reducer";
import { AppLoading } from "expo";
import * as firebase from "firebase";
import apiKeys from "./config/keys";
import { getFonts } from "./Components/getFonts";
import AppContainer from "./AppContainer";
//initialize firebase
if (!firebase.apps.length) {
firebase.initializeApp(apiKeys.firebaseConfig);
}
//Removes yellowbox warnings
LogBox.ignoreLogs(["Setting a timer for a long period of time"]);
//this warning only happens when you go from the login screen to the signup screen.
LogBox.ignoreLogs(["Can't perform a React state"]);
//configure redux store
const store = createStore(userReducer);
const App: FC = () => {
const [fontsLoaded, setFontsLoaded] = useState<boolean>(false);
if (fontsLoaded) {
return (
<Provider store={store}>
<AppContainer />
</Provider>
);
} else {
return (
<AppLoading
startAsync={getFonts}
onFinish={() => setFontsLoaded(true)}
onError={console.warn}
/>
);
}
};
export default App;