-
Notifications
You must be signed in to change notification settings - Fork 0
/
App.js
57 lines (50 loc) · 1.71 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
import React, { useState, Fragment } from "react";
import { StyleSheet, StatusBar, SafeAreaView } from "react-native";
import AppNavigator from "./navigation/AppNavigator";
import { AppLoading } from "expo";
import * as Font from "expo-font";
import { createStore, applyMiddleware } from "redux";
import allReducers from "./store/reducers";
import { Provider } from "react-redux";
import thunk from "redux-thunk";
import firebase from "firebase";
import { firebaseConfig } from "./config";
import Colors from "./constants/Colors";
import 'react-native-gesture-handler';
firebase.initializeApp(firebaseConfig);
export const store = createStore(allReducers, applyMiddleware(thunk));
const fetchFonts = () => {
return Font.loadAsync({
Roboto_medium: require("./assets/fonts/Roboto-Medium.ttf"),
Roboto: require("./assets/fonts/Roboto-Regular.ttf"),
Quicksand: require("./assets/fonts/Quicksand-Bold.ttf"),
Pacifico: require("./assets/fonts/Pacifico-Regular.ttf"),
Bebas:require("./assets/fonts/BebasNeue-Regular.ttf"),
GreatVibes:require("./assets/fonts/GreatVibes-Regular.ttf")
});
};
export default function App() {
const [fontLoaded, setFontLoaded] = useState(false);
if (!fontLoaded) {
return (
<AppLoading
startAsync={fetchFonts}
onFinish={() => {
setFontLoaded(true);
}}
/>
);
}
return (
<Fragment>
<SafeAreaView style={{ flex: 0, backgroundColor: Colors.primary }} />
<SafeAreaView style={{ flex: 1, backgroundColor: Colors.primary }}>
<StatusBar barStyle="auto" />
<Provider store={store}>
<AppNavigator />
</Provider>
</SafeAreaView>
</Fragment>
);
}
const styles = StyleSheet.create({});