diff options
Diffstat (limited to 'src/components/comments')
-rw-r--r-- | src/components/comments/AddComment.tsx | 50 |
1 files changed, 30 insertions, 20 deletions
diff --git a/src/components/comments/AddComment.tsx b/src/components/comments/AddComment.tsx index 65c0b066..ac1628da 100644 --- a/src/components/comments/AddComment.tsx +++ b/src/components/comments/AddComment.tsx @@ -1,5 +1,11 @@ import * as React from 'react'; -import {Image, StyleSheet, TextInput, View} from 'react-native'; +import { + Image, + KeyboardAvoidingView, + Platform, + StyleSheet, + View, +} from 'react-native'; import AsyncStorage from '@react-native-community/async-storage'; import {AuthContext} from '../../routes'; import {TaggBigInput} from '../onboarding'; @@ -58,25 +64,29 @@ const AddComment: React.FC<AddCommentProps> = ({ }; return ( - <View style={styles.container}> - <Image - style={styles.avatar} - source={ - avatar - ? {uri: avatar} - : require('../../assets/images/avatar-placeholder.png') - } - /> - <TaggBigInput - style={styles.text} - multiline - placeholder="Add a comment....." - placeholderTextColor="gray" - onChangeText={handleCommentUpdate} - onSubmitEditing={postComment} - value={comment} - /> - </View> + <KeyboardAvoidingView + behavior={Platform.OS === 'ios' ? 'padding' : 'height'} + keyboardVerticalOffset={130}> + <View style={styles.container}> + <Image + style={styles.avatar} + source={ + avatar + ? {uri: avatar} + : require('../../assets/images/avatar-placeholder.png') + } + /> + <TaggBigInput + style={styles.text} + multiline + placeholder="Add a comment....." + placeholderTextColor="gray" + onChangeText={handleCommentUpdate} + onSubmitEditing={postComment} + value={comment} + /> + </View> + </KeyboardAvoidingView> ); }; const styles = StyleSheet.create({ |