support RTL

This commit is contained in:
Mohammed
2018-11-22 21:20:59 +03:00
committed by satyajit.happy
parent 3a2d3ad12f
commit aafe764f72

View File

@@ -15,7 +15,7 @@
// that could be found when using the drawer component
import React, { Component } from 'react';
import { Animated, StyleSheet, View, Keyboard, StatusBar } from 'react-native';
import { Animated, StyleSheet, View, Keyboard, StatusBar, I18nManager } from 'react-native';
import invariant from '../utils/invariant';
import { AnimatedEvent } from 'react-native/Libraries/Animated/src/AnimatedEvent';
@@ -395,7 +395,7 @@ export default class DrawerLayout extends Component<PropType, StateType> {
}
const drawerStyles = {
transform: [{ translateX: drawerTranslateX }],
flexDirection: fromLeft ? 'row' : 'row-reverse',
flexDirection: (I18nManager.isRTL ? !fromLeft : fromLeft) ? 'row' : 'row-reverse'
};
return (