diff --git a/src/index.js b/src/index.js index 40ed1c916..36ff2203c 100755 --- a/src/index.js +++ b/src/index.js @@ -1,7 +1,7 @@ import React from 'react'; import { Provider } from 'react-redux'; -import { Application } from './screens/application'; +import Application from './screens/application'; import store from './redux/store/store'; export default () => ( diff --git a/src/screens/application/container/applicationContainer.js b/src/screens/application/container/applicationContainer.js index 2a5e26b17..8408b69f3 100644 --- a/src/screens/application/container/applicationContainer.js +++ b/src/screens/application/container/applicationContainer.js @@ -399,21 +399,27 @@ class ApplicationContainer extends Component { }; render() { - const { selectedLanguage, isConnected, toastNotification } = this.props; + const { + selectedLanguage, + isConnected, + toastNotification, + isDarkTheme: _isDarkTheme, + children, + } = this.props; const { isRenderRequire, isReady, isThemeReady } = this.state; - if (isRenderRequire && isThemeReady) { - return ( - - ); - } - return ; + return ( + children && + children({ + isConnected, + toastNotification, + isReady, + isRenderRequire, + isThemeReady, + isDarkTheme: _isDarkTheme, + locale: selectedLanguage, + }) + ); } } diff --git a/src/screens/application/index.js b/src/screens/application/index.js index 958b89a31..f1d65be27 100644 --- a/src/screens/application/index.js +++ b/src/screens/application/index.js @@ -1,5 +1,35 @@ -import ApplicationScreen from './screen/applicationScreen'; -import Application from './container/applicationContainer'; +import React from 'react'; + +import ApplicationScreen from './screen/applicationScreen'; +import ApplicationContainer from './container/applicationContainer'; + +const Application = () => ( + + {({ + isConnected, + locale, + toastNotification, + isReady, + isDarkTheme, + isRenderRequire, + isThemeReady, + }) => { + if (!isRenderRequire || !isThemeReady) { + return null; + } + return ( + + ); + }} + +); -export { Application, ApplicationScreen }; export default Application; + +export { ApplicationContainer, ApplicationScreen }; diff --git a/src/screens/root/container/rootContainer.js b/src/screens/root/container/rootContainer.js index f5ea0a278..3e72b9b0c 100644 --- a/src/screens/root/container/rootContainer.js +++ b/src/screens/root/container/rootContainer.js @@ -1,7 +1,6 @@ import React, { Component, Fragment } from 'react'; import { AppState, Platform, Linking, Alert } from 'react-native'; import { connect } from 'react-redux'; -import Push from 'appcenter-push'; import { injectIntl } from 'react-intl'; import get from 'lodash/get';