-
Notifications
You must be signed in to change notification settings - Fork 0
/
App.js
56 lines (49 loc) · 1.42 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
import React, {Component} from "react";
import {KeyboardAvoidingView, Platform, SafeAreaView, StatusBar, Text, View} from "react-native";
import AppLoading from 'expo-app-loading';
import {Root} from "native-base";
import {Provider} from "unstated";
export default class App extends Component {
state = {isReady: false};
async componentDidMount() {
try {
// removed code
} catch (e) {
console.error(e);
} finally {
this.setState({isReady: true});
}
}
render() {
if (!this.state.isReady) {
return (
<AppLoading/>
);
}
return (
<SafeAreaView style={{flex: 1, backgroundColor: "#eaeaea"}}>
<KeyboardAvoidingView behavior={Platform.OS === "ios" ? "padding" : "height"}
style={{flex: 1, backgroundColor: "#eaeaea"}}>
<StatusBar
backgroundColor="rgba(0, 0, 0, 0.20)"
barStyle="light-content"
translucent
animated
/>
<Provider>
<Root>
<View style={{backgroundColor: "#343434", flex: 1,
alignItems: "center",
justifyContent: "center"
}}>
<Text style={{color: "#FFFFFF"}}>
{"App is running..."}
</Text>
</View>
</Root>
</Provider>
</KeyboardAvoidingView>
</SafeAreaView>
);
}
}