RootView.js 1.17 KB
Newer Older
Giang Tran committed
1
import React, {useEffect} from 'react';
Giang Tran committed
2
import {View, Text, ImageBackground, StyleSheet, StatusBar} from 'react-native';
Giang Tran committed
3 4 5 6 7

import {connect} from 'react-redux';
import StackNavigation from './routers/StackNavigation';
import Modal from 'react-native-modal';
import {SkypeIndicator} from 'react-native-indicators';
Giang Tran committed
8
import {enableScreens} from 'react-native-screens';
Giang Tran committed
9
import NoInternetComponent from './components/NoInternet';
Giang Tran committed
10

Nguyễn Thị Thúy committed
11 12
import DeviceInfo from 'react-native-device-info';
import VersionChecker from './Screens/VersionChecker';
Giang Tran committed
13

Giang Tran committed
14
enableScreens();
Giang Tran committed
15

Giang Tran committed
16
const RootView = (props) => {
Giang Tran committed
17 18 19 20
  useEffect(() => {
  }, []);

  const checkVersion = (props) => {
Nguyễn Thị Thúy committed
21
    const verCurrent = DeviceInfo.getVersion();
Giang Tran committed
22 23 24
    console.log('version current', verCurrent);
  };

Giang Tran committed
25
  return (
Giang Tran committed
26 27 28 29 30 31 32 33
    <>
      <View style={{flex: 1}}>
        <Modal isVisible={props.loadingModal.isVisible}>
          <SkypeIndicator color={'white'} />
        </Modal>

        <StackNavigation />
      </View>
Nguyễn Thị Thúy committed
34
      {/*<VersionChecker/>*/}
Giang Tran committed
35 36
      <NoInternetComponent />
    </>
Giang Tran committed
37 38 39 40 41 42 43 44 45 46
  );
};

const mapStateToProps = (state) => {
  return {
    loadingModal: state.ModalLoadingReducer,
  };
};

export default connect(mapStateToProps, {})(RootView);