-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathApp.js
More file actions
52 lines (44 loc) · 1.04 KB
/
Copy pathApp.js
File metadata and controls
52 lines (44 loc) · 1.04 KB
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
import React, { Component } from "react";
import { Rajdhani_600SemiBold } from "@expo-google-fonts/rajdhani";
import * as Font from "expo-font";
import LoginScreen from "./screens/Login";
import BottomTabNavigator from "./components/BottomTabNavigator";
import { createSwitchNavigator, createAppContainer } from "react-navigation";
export default class App extends Component {
constructor() {
super();
this.state = {
fontLoaded: false
};
}
async loadFonts() {
await Font.loadAsync({
Rajdhani_600SemiBold: Rajdhani_600SemiBold
});
this.setState({ fontLoaded: true });
}
componentDidMount() {
this.loadFonts();
}
render() {
const { fontLoaded } = this.state;
if (fontLoaded) {
return <AppContainer />;
}
return null;
}
}
const AppSwitchNavigator = createSwitchNavigator(
{
Login: {
screen: LoginScreen
},
BottomTab: {
screen: BottomTabNavigator
}
},
{
initialRouteName: "Login"
}
);
const AppContainer = createAppContainer(AppSwitchNavigator);