-
Notifications
You must be signed in to change notification settings - Fork 1
/
App.js
63 lines (57 loc) · 1.57 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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
import React, { Component } from "react";
import { Platform, StyleSheet, Text, View } from "react-native";
import { AppLoading } from "expo";
import { Asset } from "expo-asset";
import * as Font from "expo-font";
import { Root, Container } from "native-base";
import { createStackNavigator } from "react-navigation";
import Initiatives from "./src/screens/initiatives";
import SideBar from "./src/screens/sidebar";
import About from "./src/screens/About";
import Index from "./index";
const AppNavigator = createStackNavigator({
IndexScreen: { screen: Index },
SideScreen: { screen: SideBar },
InitScreen: { screen: Initiatives },
AboutScreen: { screen: About }
});
console.disableYellowBox = true;
export default class App extends Component {
state = {
fontLoaded: false
};
async componentWillMount() {
Promise.all([
Asset.loadAsync([
require("./assets/icon.png"),
require("./assets/splash.png"),
require("./src/images/dn.png"),
require("./src/images/mp3.gif")
])
]),
await Font.loadAsync({
Roboto: require("native-base/Fonts/Roboto.ttf"),
Roboto_medium: require("native-base/Fonts/Roboto_medium.ttf")
});
this.setState({
fontLoaded: true
});
}
render() {
if (!this.state.fontLoaded) {
return <AppLoading />;
}
return (
<Root>
<Container
style={{
paddingTop:
Platform.OS === "ios" ? 0 : Expo.Constants.statusBarHeight
}}
>
<AppNavigator />
</Container>
</Root>
);
}
}