UNPKG

citizenship_app_news

Version:

News module for Citizenship project application

54 lines (46 loc) 1.71 kB
import React, { Component } from "react"; import { AppState, StatusBar, ActivityIndicator, View, YellowBox, BackHandler } from 'react-native'; import Router from "../configs/RouterConfig"; import { Provider } from 'react-redux' import { PersistGate } from 'redux-persist/integration/react' import configureStore from "../redux"; export const { store, persistor } = configureStore() export function getState() { return store.getState() } class Main extends Component { constructor(props) { super(props) YellowBox.ignoreWarnings([ 'Warning: componentWillMount is deprecated', 'Warning: componentWillReceiveProps is deprecated', ]); } componentDidMount() { // PlayerController.init() // SignalRController.initialize('http://192.168.1.105' , 'signalr-myChatHub', 'getMessage', 'token') AppState.addEventListener("change", (state) => { console.log('APP STATE', state) }) } componentWillUnmount() { console.log('Closed') } renderLoading = () => ( <View style={{ position: 'absolute', top: '50%', alignSelf: 'center' }}> <ActivityIndicator size='large' /> </View> ) render() { return ( <Provider store={store}> <PersistGate persistor={persistor} loading={this.renderLoading()} > <StatusBar barStyle={'dark-content'} backgroundColor={'#FFF0'} /> <Router /> </PersistGate> </Provider> ) } } export default Main;