aboutsummaryrefslogtreecommitdiff
path: root/src/components
diff options
context:
space:
mode:
authorShravya Ramesh <37447613+shravyaramesh@users.noreply.github.com>2020-11-04 08:26:14 -0800
committerGitHub <noreply@github.com>2020-11-04 11:26:14 -0500
commitd9995cd016d540c54fa10ed0eed38e247c19e4bf (patch)
tree31a4d0fb3d723e325094fb4fe928586ee55dbfb3 /src/components
parent95f00471cec3198b8a68fd42206b3781b573cc84 (diff)
[TMA-328] Enable keyboard avoiding view captions comments (#93)
* resizes non square images to be displayed without being cropped * Enabled keyboard avoiding view on caption screen and comments screen * Delete TaggPost.tsx * Delete TwitterTaggPost.tsx * removed unnecessarilyy deleted files Co-authored-by: Husam Salhab <47015061+hsalhab@users.noreply.github.com>
Diffstat (limited to 'src/components')
-rw-r--r--src/components/comments/AddComment.tsx50
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({