-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathApp.js
40 lines (36 loc) · 1.29 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
import React, { useEffect, useState } from "react";
import AppLoading from "expo-app-loading";
import { useFonts } from "expo-font";
import { createStore, combineReducers, applyMiddleware } from "redux";
import { Provider } from "react-redux";
import ReduxThunk from "redux-thunk";
import { NavigationContainer } from "@react-navigation/native";
import statsReducer from "./store/reducers/stats";
import authReducer from "./store/reducers/auth";
import userReducer from "./store/reducers/user";
import permissionReducer from "./store/reducers/permission";
import TabNavigation from "./navigation/TabNavigation";
export default function App() {
let [fontsLoaded] = useFonts({
"open-sans": require("./assets/fonts/OpenSans-Regular.ttf"),
"open-sans-semibold": require("./assets/fonts/OpenSans-Semibold.ttf"),
"open-sans-bold": require("./assets/fonts/OpenSans-Bold.ttf"),
});
const rootReducer = combineReducers({
stats: statsReducer,
auth: authReducer,
user: userReducer,
permission: permissionReducer,
});
const store = createStore(rootReducer, applyMiddleware(ReduxThunk));
if (!fontsLoaded) {
return <AppLoading />;
}
return (
<Provider store={store}>
<NavigationContainer>
<TabNavigation />
</NavigationContainer>
</Provider>
);
}