MM-20184 Remove ios drawer hack and Fix right drawer partially shown on landscape (#3933)

Co-authored-by: Elias Nahum <nahumhbl@gmail.com>
This commit is contained in:
Mattermost Build 2020-02-17 20:32:11 +01:00 committed by GitHub
parent 99bbc79953
commit cbae026f8e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -120,16 +120,6 @@ export default class DrawerLayout extends Component {
componentDidMount() {
Dimensions.addEventListener('change', this.handleDimensionsChange);
if (Platform.OS === 'ios') {
// on iOS force closing the drawers to prevent them for partially showing
// when channging the device orientation, probably caused by RN61
Animated.timing(this.openValue, {
toValue: 0,
duration: 10,
easing: Easing.out(Easing.cubic),
useNativeDriver: this.props.useNativeAnimations,
}).start();
}
}
componentWillUnmount() {
@ -198,9 +188,12 @@ export default class DrawerLayout extends Component {
};
/* Drawer styles */
let outputRange;
// ios main sidebar sits mostly under the main screen, with slight move
const translateDistance = Platform.OS === 'ios' && drawerPosition === 'left' ?
Math.floor(drawerWidth * 0.2) : drawerWidth
let translateDistance = drawerWidth;
if (Platform.OS === 'ios') {
// ios main sidebar sits mostly under the main screen, with slight move
translateDistance = drawerPosition === 'left' ?
Math.floor(drawerWidth * 0.2) : Math.floor(drawerWidth * 1.2)
}
if (this.getDrawerPosition() === 'left') {
outputRange = [-translateDistance, 0];