From d9995cd016d540c54fa10ed0eed38e247c19e4bf Mon Sep 17 00:00:00 2001 From: Shravya Ramesh <37447613+shravyaramesh@users.noreply.github.com> Date: Wed, 4 Nov 2020 08:26:14 -0800 Subject: [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> --- src/components/comments/AddComment.tsx | 50 ++++++++++++-------- src/screens/profile/CaptionScreen.tsx | 85 ++++++++++++++++++++-------------- 2 files changed, 80 insertions(+), 55 deletions(-) (limited to 'src') 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 = ({ }; return ( - - - - + + + + + + ); }; const styles = StyleSheet.create({ diff --git a/src/screens/profile/CaptionScreen.tsx b/src/screens/profile/CaptionScreen.tsx index fd51c84f..08dd8e5b 100644 --- a/src/screens/profile/CaptionScreen.tsx +++ b/src/screens/profile/CaptionScreen.tsx @@ -1,8 +1,17 @@ import React from 'react'; -import {StyleSheet, View, Image, Alert, Text, Platform} from 'react-native'; +import { + StyleSheet, + View, + Image, + Alert, + Keyboard, + TouchableWithoutFeedback, + KeyboardAvoidingView, + Platform, +} from 'react-native'; import {Button} from 'react-native-elements'; -import {SearchBackground, TabsGradient, TaggBigInput} from '../../components'; -import {SCREEN_HEIGHT, SCREEN_WIDTH, StatusBarHeight} from '../../utils'; +import {SearchBackground, TaggBigInput} from '../../components'; +import {SCREEN_WIDTH, StatusBarHeight} from '../../utils'; import AsyncStorage from '@react-native-community/async-storage'; import {RouteProp} from '@react-navigation/native'; import {ProfileStackParams} from 'src/routes'; @@ -10,6 +19,7 @@ import {StackNavigationProp} from '@react-navigation/stack'; import {CaptionScreenHeader} from '../../components/'; import {MOMENTS_ENDPOINT} from '../../constants'; import {AuthContext} from '../../routes/authentication'; + /** * Upload Screen to allow users to upload posts to Tagg */ @@ -88,44 +98,49 @@ const CaptionScreen: React.FC = ({route, navigation}) => { return ( - - -