-
Notifications
You must be signed in to change notification settings - Fork 0
/
App.js
47 lines (41 loc) · 1.26 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
import React from "react";
import { StyleSheet } from "react-native";
import { AppLoading } from "expo";
import * as Font from "expo-font";
import Navigation from "./navigation";
import { Block, Text } from "./components";
export default class App extends React.Component {
// add fonts support
state = {
isLoadingComplete: false
};
handleResourcesAsync = async () => {
return Promise.all([
Font.loadAsync({
"Rubik-Regular": require("./assets/fonts/Rubik-Regular.ttf"),
"Rubik-Black": require("./assets/fonts/Rubik-Black.ttf"),
"Rubik-Bold": require("./assets/fonts/Rubik-Bold.ttf"),
"Rubik-Italic": require("./assets/fonts/Rubik-Italic.ttf"),
"Rubik-Light": require("./assets/fonts/Rubik-Light.ttf"),
"Rubik-Medium": require("./assets/fonts/Rubik-Medium.ttf")
})
]);
};
render() {
if (!this.state.isLoadingComplete && !this.props.skipLoadingScreen) {
return (
<AppLoading
startAsync={this.handleResourcesAsync}
onError={error => console.warn(error)}
onFinish={() => this.setState({ isLoadingComplete: true })}
/>
);
}
return (
<Block>
<Navigation />
</Block>
);
}
}
const styles = StyleSheet.create({});