From 0fcbdcdbad4fab65cf33969387c92deddaea9922 Mon Sep 17 00:00:00 2001 From: Mustafa Buyukcelebi Date: Thu, 18 Jul 2019 11:10:34 +0300 Subject: [PATCH] Intl moved --- src/index.js | 30 +++++++++++--- .../application/screen/applicationScreen.js | 39 +++++++------------ 2 files changed, 37 insertions(+), 32 deletions(-) diff --git a/src/index.js b/src/index.js index 0230ec5f3..1a502e197 100755 --- a/src/index.js +++ b/src/index.js @@ -1,14 +1,32 @@ import React from 'react'; -import { Provider } from 'react-redux'; +import { Provider, connect } from 'react-redux'; import { PersistGate } from 'redux-persist/integration/react'; +import { IntlProvider } from 'react-intl'; + +import { flattenMessages } from './utils/flattenMessages'; +import messages from './config/locales'; import Application from './screens/application'; import { store, persistor } from './redux/store/store'; -export default () => ( - - +const _renderApp = ({ locale }) => ( + + - - + + ); + +const mapStateToProps = state => ({ + locale: state.application.language, +}); + +const App = connect(mapStateToProps)(_renderApp); + +export default () => { + return ( + + + + ); +}; diff --git a/src/screens/application/screen/applicationScreen.js b/src/screens/application/screen/applicationScreen.js index 79e919a5b..9263b408c 100644 --- a/src/screens/application/screen/applicationScreen.js +++ b/src/screens/application/screen/applicationScreen.js @@ -1,10 +1,7 @@ import React, { Component, Fragment } from 'react'; -import { IntlProvider } from 'react-intl'; import { StatusBar, Platform, View } from 'react-native'; import EStyleSheet from 'react-native-extended-stylesheet'; import { ReduxNavigation } from '../../../navigation/reduxNavigation'; -import { flattenMessages } from '../../../utils/flattenMessages'; -import messages from '../../../config/locales'; // Services import { toastNotification as toastNotificationAction } from '../../../redux/actions/uiAction'; @@ -47,14 +44,7 @@ class ApplicationScreen extends Component { }; render() { - const { - isConnected, - isDarkTheme, - locale, - toastNotification, - isReady, - isPinCodeReqiure, - } = this.props; + const { isConnected, isDarkTheme, toastNotification, isReady, isPinCodeReqiure } = this.props; const { isShowToastNotification } = this.state; const barStyle = isDarkTheme ? 'light-content' : 'dark-content'; const barColor = isDarkTheme ? '#1e2835' : '#fff'; @@ -66,21 +56,18 @@ class ApplicationScreen extends Component { ) : ( )} - - - - {!isConnected && } - - - - - - + + {!isConnected && } + + + + + {Platform.OS === 'android' && } {isShowToastNotification && (