| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455 |
- /**
- * 入口文件
- * @邠心vbe on 2020/05/20
- */
- import React, { Component } from 'react';
- import './app/i18n'
- import {AppRegistry} from 'react-native';
- import 'react-native-gesture-handler';
- import './app/utils/themes'
- import './app/utils/constant';
- import './app/utils/notification';
- import './app/utils/vector_icon';
- import Router from './app/pages/Router';
- import app from './app.json';
- import ModalPortal from './app/components/ModalPortal';
- import {RootSiblingParent} from 'react-native-root-siblings';
- import { SafeAreaView } from 'react-native-safe-area-context';
- import MyStatusBar from './app/components/MyStatusBar';
- import { i18nUtil } from './app/i18n';
- class Index extends Component {
- constructor(props) {
- super(props);
- this.state = {
- visible: false,
- refreshTime: 0
- }
- }
- componentDidMount() {
- i18nUtil.init(() => {
- this.setState({
- visible: true
- })
- })
- }
- render() {
- return (
- <RootSiblingParent>
- <MyStatusBar/>
- { this.state.visible
- ? <Router/>
- : <></>
- }
- <ModalPortal />
- { isIOS && (
- <SafeAreaView style={{flex: 0, backgroundColor: colorLight}}></SafeAreaView>)
- }
- </RootSiblingParent>
- );
- }
- };
- AppRegistry.registerComponent(app.name, () => Index);
|