diff options
author | Ansh Nanda <anshnanda10@gmail.com> | 2023-04-12 20:28:01 -0700 |
---|---|---|
committer | Ansh Nanda <anshnanda10@gmail.com> | 2023-04-12 20:28:01 -0700 |
commit | c88903dad4ce14715146e6a34b1dfae911862c28 (patch) | |
tree | dc9616e19117b1026888e5c50cdc8923afeff8d8 /src | |
parent | 0d227676091cc39536c8232ad1f9eb30aaf5a85a (diff) | |
download | voidsky-c88903dad4ce14715146e6a34b1dfae911862c28.tar.zst |
fix composer SafeAreaView
Diffstat (limited to 'src')
-rw-r--r-- | src/view/com/composer/Composer.tsx | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/src/view/com/composer/Composer.tsx b/src/view/com/composer/Composer.tsx index 99bcf91cf..7d72899fc 100644 --- a/src/view/com/composer/Composer.tsx +++ b/src/view/com/composer/Composer.tsx @@ -10,7 +10,7 @@ import { TouchableWithoutFeedback, View, } from 'react-native' -import {SafeAreaView} from 'react-native-safe-area-context' +import {useSafeAreaInsets} from 'react-native-safe-area-context' import LinearGradient from 'react-native-linear-gradient' import {FontAwesomeIcon} from '@fortawesome/react-native-fontawesome' import {RichText} from '@atproto/api' @@ -75,6 +75,8 @@ export const ComposePost = observer(function ComposePost({ [store], ) + const insets = useSafeAreaInsets() + // HACK // there's a bug with @mattermost/react-native-paste-input where if the input // is focused during unmount, an exception will throw (seems that a blur method isnt implemented) @@ -209,7 +211,14 @@ export const ComposePost = observer(function ComposePost({ behavior={Platform.OS === 'ios' ? 'padding' : 'height'} style={styles.outer}> <TouchableWithoutFeedback onPressIn={onPressContainer}> - <SafeAreaView style={[s.flex1]}> + <View + style={[ + s.flex1, + { + paddingBottom: Platform.OS === 'android' ? insets.bottom : 0, + paddingTop: Platform.OS === 'android' ? insets.top : 15, + }, + ]}> <View style={styles.topbar}> <TouchableOpacity testID="composerCancelButton" @@ -339,7 +348,7 @@ export const ComposePost = observer(function ComposePost({ <View style={s.flex1} /> <CharProgress count={graphemeLength} /> </View> - </SafeAreaView> + </View> </TouchableWithoutFeedback> </KeyboardAvoidingView> ) |