Fix navigation

This commit is contained in:
Elias Nahum
2021-12-14 11:45:12 +02:00
parent 86dfcf0515
commit 442159ab78
9 changed files with 45 additions and 20 deletions

View File

@@ -1,9 +1,10 @@
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
// See LICENSE.txt for license information.
import React from 'react';
import {StyleSheet, TextStyle, View} from 'react-native';
import React, {useEffect} from 'react';
import {Keyboard, StyleSheet, TextStyle, View} from 'react-native';
import DeviceInfo from 'react-native-device-info';
import Animated, {useAnimatedStyle, useSharedValue, withTiming} from 'react-native-reanimated';
import FormattedText from '@components/formatted_text';
import {t} from '@i18n';
@@ -26,6 +27,27 @@ type AppVersionProps = {
}
const AppVersion = ({isWrapped = true, textStyle = {}}: AppVersionProps) => {
const opacity = useSharedValue(1);
const animatedStyle = useAnimatedStyle(() => {
return {
opacity: withTiming(opacity.value, {duration: 250}),
};
});
useEffect(() => {
const willHide = Keyboard.addListener('keyboardDidHide', () => {
opacity.value = 1;
});
const willShow = Keyboard.addListener('keyboardDidShow', () => {
opacity.value = 0;
});
return () => {
willHide.remove();
willShow.remove();
};
}, []);
const appVersion = (
<FormattedText
id={t('mobile.about.appVersion')}
@@ -43,11 +65,14 @@ const AppVersion = ({isWrapped = true, textStyle = {}}: AppVersionProps) => {
}
return (
<View pointerEvents='none'>
<Animated.View
pointerEvents='none'
style={animatedStyle}
>
<View style={style.info}>
{appVersion}
</View>
</View>
</Animated.View>
);
};

View File

@@ -187,7 +187,7 @@ const ForgotPassword = ({serverUrl, theme}: Props) => {
bounces={false}
contentContainerStyle={styles.innerContainer}
enableAutomaticScroll={Platform.OS === 'android'}
enableOnAndroid={true}
enableOnAndroid={false}
enableResetScrollToCoords={true}
extraScrollHeight={0}
keyboardDismissMode='on-drag'

View File

@@ -173,7 +173,7 @@ const LoginOptions = ({config, extra, hasLoginForm, launchType, launchError, lic
bounces={false}
contentContainerStyle={[styles.innerContainer, additionalContainerStyle]}
enableAutomaticScroll={Platform.OS === 'android'}
enableOnAndroid={true}
enableOnAndroid={false}
enableResetScrollToCoords={true}
extraScrollHeight={0}
keyboardDismissMode='on-drag'

View File

@@ -291,7 +291,7 @@ const Server = ({componentId, extra, launchType, launchError, theme}: ServerProp
bounces={false}
contentContainerStyle={styles.scrollContainer}
enableAutomaticScroll={Platform.OS === 'android'}
enableOnAndroid={true}
enableOnAndroid={false}
enableResetScrollToCoords={true}
extraScrollHeight={20}
keyboardDismissMode='on-drag'