-
Notifications
You must be signed in to change notification settings - Fork 1
/
App.js
49 lines (41 loc) · 1.26 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
import './ReactotronConfig';
import Reactotron from 'reactotron-react-native'
import { AppLoading } from "expo";
import React, { Component } from "react";
import { Provider } from "react-redux";
import { Text, ActivityIndicator } from "react-native";
import Navigation from "./navigation";
import { getStore } from "./store";
import { initializeAssets } from "./assets";
import AuthenticationScreen from "./screens/Authentication/Authentication.screen";
const store = getStore();
const userIsAuthenticated = false;
const getComponentOrLoading = (assetsReady, userIsAuthenticated) => {
if(!assetsReady) {
return (<AppLoading />)
}
return userIsAuthenticated?(<Navigation/>):(<AuthenticationScreen/>)
}
export default class App extends Component {
state = { assetsReady: false,}
componentWillMount() {
// setInitialSessionId();
}
componentDidMount() {
const showAppContent = () => {
store.dispatch(() => { type: 'bluuuuuu'})
Reactotron.log('assets are readyyy');
this.setState({assetsReady: true})
}
initializeAssets.then(function(response) {
showAppContent();
})
}
render() {
return (
<Provider store={store}>
{getComponentOrLoading(this.state.assetsReady, userIsAuthenticated)}
</Provider>
);
}
}