-
Notifications
You must be signed in to change notification settings - Fork 3
/
App.js
executable file
·46 lines (41 loc) · 1.21 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
import "react-native-gesture-handler";
import React, { Component } from "react";
import { StatusBar } from "react-native";
import { NavigationContainer } from "@react-navigation/native";
import * as Font from "expo-font";
import { AppLoading } from "expo";
import Dashboard from "./screen/dashboard";
let customFonts = {
"Poppins-Regular": require("./assets/fonts/Poppins-Regular.otf"),
"Poppins-Light": require("./assets/fonts/Poppins-Light.otf"),
"Poppins-SemiBold": require("./assets/fonts/Poppins-SemiBold.otf"),
"Poppins-Bold": require("./assets/fonts/Poppins-Bold.otf"),
"Roboto-medium": require("./assets/fonts/Poppins-Medium.otf"),
};
export default class App extends Component {
state = {
fontsLoaded: false,
};
async _loadFontsAsync() {
await Font.loadAsync(customFonts);
this.setState({ fontsLoaded: true });
}
componentDidMount() {
this._loadFontsAsync();
}
render() {
if (this.state.fontsLoaded) {
return (
<NavigationContainer>
<Dashboard />
<StatusBar
barStyle="light-content"
backgroundColor="#121212"
></StatusBar>
</NavigationContainer>
);
} else {
return <AppLoading />;
}
}
}