mirror of
https://github.com/ecency/ecency-mobile.git
synced 2024-12-21 12:21:31 +03:00
Introduced short method for checking RTL
This commit is contained in:
parent
8ab12e379e
commit
8265573987
@ -1,5 +1,5 @@
|
||||
import EStyleSheet from 'react-native-extended-stylesheet';
|
||||
import { NativeModules } from 'react-native';
|
||||
import { isRTL } from '../../../utils/I18nUtils';
|
||||
import scalePx from '../../../utils/scalePx';
|
||||
|
||||
export default EStyleSheet.create({
|
||||
@ -19,7 +19,7 @@ export default EStyleSheet.create({
|
||||
headerContentWrapper: {
|
||||
alignItems: 'center',
|
||||
height: 70,
|
||||
flexDirection: NativeModules.I18nManager.isRTL ? 'row-reverse' : 'row',
|
||||
flexDirection: isRTL() ? 'row-reverse' : 'row',
|
||||
alignSelf: 'center',
|
||||
flex: 1,
|
||||
},
|
||||
@ -27,8 +27,8 @@ export default EStyleSheet.create({
|
||||
flex: 4,
|
||||
},
|
||||
userAvatar: {
|
||||
marginLeft: NativeModules.I18nManager.isRTL ? 15 : 32,
|
||||
marginRight: NativeModules.I18nManager.isRTL ? 15 : 0,
|
||||
marginLeft: isRTL() ? 15 : 32,
|
||||
marginRight: isRTL() ? 15 : 0,
|
||||
},
|
||||
otherUserAvatar: {
|
||||
borderWidth: 0.1,
|
||||
|
@ -2,6 +2,8 @@ import { Alert, NativeModules } from 'react-native';
|
||||
import RNRestart from 'react-native-restart';
|
||||
import rtlDetect from 'rtl-detect';
|
||||
|
||||
export const isRTL = () => NativeModules.I18nManager.isRTL;
|
||||
|
||||
export const languageRestart = (prevLang, lang, intl) => {
|
||||
if (prevLang != lang) {
|
||||
// if selected lang is RTL, switch the layout
|
||||
|
Loading…
Reference in New Issue
Block a user