forked from watanabeyu/react-native-simple-instagram
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathApp.js
More file actions
41 lines (36 loc) · 1013 Bytes
/
App.js
File metadata and controls
41 lines (36 loc) · 1013 Bytes
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
import React from 'react'
import { AppLoading, Asset, Font, Constants } from 'expo'
import Navigation from 'rnstexampleapp/src'
/* npm */
import instagram from 'react-native-simple-instagram'
export default class App extends React.Component {
constructor(props) {
super(props)
this.state = {
isLoadingComplete: false
}
}
render() {
if (!this.state.isLoadingComplete && !this.props.skipLoadingScreen) {
return (
<AppLoading
startAsync={this._loadResourcesAsync}
onError={(error) => console.warn(error)}
onFinish={() => this.setState({ isLoadingComplete: true })}
/>
)
}
else {
return <Navigation />
}
}
_loadResourcesAsync = async () => {
return Promise.all([
Asset.loadAsync([
require('rnstexampleapp/assets/images/icon.png'),
require('rnstexampleapp/assets/images/ok_man.png')
]),
instagram.setClientId(Constants.manifest.extra.instagram.clientId)
])
};
}