-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathApp.js
45 lines (38 loc) · 1.14 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
import { AppLoading } from 'expo';
import * as Font from 'expo-font';
import React, { useState } from 'react';
import { Platform, UIManager } from 'react-native';
import { Provider } from 'react-redux';
import { combineReducers, createStore } from 'redux';
import Navigator from './navigation/Navigator';
import { cardReducer } from './store/reducres';
const combinedReducers = combineReducers({
cards: cardReducer
})
const store = createStore(combinedReducers)
const fetchFonts = () => {
return Font.loadAsync({
'impact': require('./assets/Fonts/impact.ttf'),
'arial': require('./assets/Fonts/arial.ttf'),
'calibril-light': require('./assets/Fonts/calibril.ttf')
})
}
export default function App() {
const [fontsLoaded, setFontsLoaded] = useState(false)
if (Platform.OS === 'android') {
if (UIManager.setLayoutAnimationEnabledExperimental) {
UIManager.setLayoutAnimationEnabledExperimental(true);
}
}
if (!fontsLoaded) {
return <AppLoading startAsync={fetchFonts}
onFinish={() => {
setFontsLoaded(true)
}} />
}
return (
<Provider store={store}>
<Navigator />
</Provider>
);
}