-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathApp.js
75 lines (59 loc) · 2 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
64
65
66
67
68
69
70
71
72
73
74
75
import React from "react";
import { AppLoading } from "expo";
import { Asset } from "expo-asset";
import Navigation from "./navigation";
//wyłączenie ostrzeżeń
console.disableYellowBox = true;
// import all used images
const images = [
require("./assets/logo1.png"),
require("./assets/logo1.png"),
require("./assets/coronainfo.png"),
require("./assets/coronainfo2.png"),
require("./assets/images/explore_1.jpg"),
require("./assets/images/mapa-polski/t00.png"),
require("./assets/images/mapa-polski/t02.png"),
require("./assets/images/mapa-polski/t04.png"),
require("./assets/images/mapa-polski/t06.png"),
require("./assets/images/mapa-polski/t08.png"),
require("./assets/images/mapa-polski/t10.png"),
require("./assets/images/mapa-polski/t12.png"),
require("./assets/images/mapa-polski/t14.png"),
require("./assets/images/mapa-polski/t16.png"),
require("./assets/images/mapa-polski/t18.png"),
require("./assets/images/mapa-polski/t20.png"),
require("./assets/images/mapa-polski/t22.png"),
require("./assets/images/mapa-polski/t24.png"),
require("./assets/images/mapa-polski/t26.png"),
require("./assets/images/mapa-polski/t28.png"),
require("./assets/images/mapa-polski/t30.png"),
require("./assets/images/mapa-polski/t32.png")
];
export default class App extends React.Component {
state = {
isLoadingComplete: false,
isLoading: true,
};
handleResourcesAsync = async () => {
// we're caching all the images
// for better performance on the app
const cacheImages = images.map(image => {
return Asset.fromModule(image).downloadAsync();
});
return Promise.all(cacheImages);
};
render() {
if (!this.state.isLoadingComplete && !this.props.skipLoadingScreen) {
return (
<AppLoading
startAsync={this.handleResourcesAsync}
onError={error => console.warn(error)}
onFinish={() => this.setState({ isLoadingComplete: true })}
/>
);
}
return (
<Navigation />
);
}
}