From 7939e519deb7a992e82bc3d3afdfd7fddd8ccedb Mon Sep 17 00:00:00 2001 From: u-e Date: Fri, 25 Jan 2019 19:12:55 +0300 Subject: [PATCH] added language and enhanced a bit --- .../noInternetConnectionStyle.js | 4 ++-- .../noInternetConnectionView.js | 17 +++++++++++------ src/config/locales/en-US.json | 3 ++- src/config/locales/ru-RU.json | 3 ++- src/config/locales/tr-TR.json | 3 ++- .../application/screen/applicationScreen.js | 6 ++---- 6 files changed, 21 insertions(+), 15 deletions(-) diff --git a/src/components/basicUIElements/view/noInternetConnection/noInternetConnectionStyle.js b/src/components/basicUIElements/view/noInternetConnection/noInternetConnectionStyle.js index 07332bb2c..8f8dbf635 100644 --- a/src/components/basicUIElements/view/noInternetConnection/noInternetConnectionStyle.js +++ b/src/components/basicUIElements/view/noInternetConnection/noInternetConnectionStyle.js @@ -3,12 +3,12 @@ import EStyleSheet from 'react-native-extended-stylesheet'; export default EStyleSheet.create({ container: { alignItems: 'center', - height: 30, + height: 50, backgroundColor: '$primaryRed', justifyContent: 'center', }, text: { - color: '$primaryDarkGray', + color: '$pureWhite', fontSize: 14, fontWeight: 'bold', }, diff --git a/src/components/basicUIElements/view/noInternetConnection/noInternetConnectionView.js b/src/components/basicUIElements/view/noInternetConnection/noInternetConnectionView.js index ee8b322d1..cc0fa6ec2 100644 --- a/src/components/basicUIElements/view/noInternetConnection/noInternetConnectionView.js +++ b/src/components/basicUIElements/view/noInternetConnection/noInternetConnectionView.js @@ -1,11 +1,16 @@ import React from 'react'; -import { View, Text } from 'react-native'; +import { injectIntl } from 'react-intl'; +import { Text, SafeAreaView } from 'react-native'; import styles from './noInternetConnectionStyle'; -const NoInternetConnection = () => ( - - No internet conenction - +const NoInternetConnection = props => ( + + + {props.intl.formatMessage({ + id: 'alert.no_internet', + })} + + ); -export default NoInternetConnection; +export default injectIntl(NoInternetConnection); diff --git a/src/config/locales/en-US.json b/src/config/locales/en-US.json index 0bea154a8..2f1ec3af0 100644 --- a/src/config/locales/en-US.json +++ b/src/config/locales/en-US.json @@ -136,7 +136,8 @@ "remove_alert": "Are you sure you want to remove?", "cancel": "Cancel", "delete": "Delete", - "copied": "Copied!" + "copied": "Copied!", + "no_internet": "No internet connection" }, "post": { "reblog_alert": "Are you sure you want to reblog?" diff --git a/src/config/locales/ru-RU.json b/src/config/locales/ru-RU.json index 9c35c857f..79645ee99 100644 --- a/src/config/locales/ru-RU.json +++ b/src/config/locales/ru-RU.json @@ -136,7 +136,8 @@ "remove_alert": "Вы уверены, что хотите удалить?", "cancel": "Отмена", "delete": "Удалить", - "copied": "Copied!" + "copied": "Copied!", + "no_internet": "No internet connection" }, "post": { "reblog_alert": "Вы уверены, что хотите сделать репост?" diff --git a/src/config/locales/tr-TR.json b/src/config/locales/tr-TR.json index e5234cfbf..85f3ce7d2 100644 --- a/src/config/locales/tr-TR.json +++ b/src/config/locales/tr-TR.json @@ -136,7 +136,8 @@ "remove_alert": "Are you sure want to remove?", "cancel": "Cancel", "delete": "Delete", - "copied": "Copied!" + "copied": "Copied!", + "no_internet": "No internet connection" }, "post": { "reblog_alert": "Reblog yapma istediginize emin misiniz?" diff --git a/src/screens/application/screen/applicationScreen.js b/src/screens/application/screen/applicationScreen.js index f4647a85d..f8220698a 100644 --- a/src/screens/application/screen/applicationScreen.js +++ b/src/screens/application/screen/applicationScreen.js @@ -1,8 +1,6 @@ import React, { Component, Fragment } from 'react'; import { IntlProvider } from 'react-intl'; -import { - View, Text, StatusBar, Platform, -} from 'react-native'; +import { StatusBar, Platform } from 'react-native'; import EStyleSheet from 'react-native-extended-stylesheet'; import { ReduxNavigation } from '../../../navigation/reduxNavigation'; import { flattenMessages } from '../../../utils/flattenMessages'; @@ -28,7 +26,7 @@ class ApplicationScreen extends Component { render() { const { isConnected, isDarkTheme, locale } = this.props; - const barStyle = isDarkTheme ? 'light-content' : 'dark-content'; + const barStyle = isDarkTheme || !isConnected ? 'light-content' : 'dark-content'; const barColor = isDarkTheme ? '#1e2835' : '#fff'; return (