From 0ba3289b30ad3d3965a47716c01df349249f8599 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luis=20Chavarr=C3=ADa?= Date: Mon, 5 Dec 2022 05:47:45 -0600 Subject: [PATCH] fix: move fields when keyboard shows (#369) fix: move fields when keyboard shows fix: move fields when keyboard shows fix: move fields when keyboard shows fix: move fields when keyboard shows --- src/screens/contacts/ContactFormScreen.tsx | 125 ++++++++++++--------- 1 file changed, 71 insertions(+), 54 deletions(-) diff --git a/src/screens/contacts/ContactFormScreen.tsx b/src/screens/contacts/ContactFormScreen.tsx index f900d7786..41d1e5004 100644 --- a/src/screens/contacts/ContactFormScreen.tsx +++ b/src/screens/contacts/ContactFormScreen.tsx @@ -4,7 +4,14 @@ import { RootStackScreenProps, } from 'navigation/rootNavigator/types' import { useContext, useState } from 'react' -import { StyleSheet, Text, View } from 'react-native' +import { + StyleSheet, + Text, + View, + ScrollView, + KeyboardAvoidingView, + Platform, +} from 'react-native' import { TextInput } from 'react-native-gesture-handler' import Icon from 'react-native-vector-icons/Ionicons' import { PrimaryButton } from 'src/components/button/PrimaryButton' @@ -62,62 +69,73 @@ export const ContactFormScreen = ({ } return ( - - - - navigation.navigate(contactsStackRouteNames.ContactsList) - } - backgroundColor={colors.background.primary} - color={colors.lightPurple} - style={styles.backButton} - size={15} - borderRadius={20} - /> - - {initialValue.id ? 'Edit Contact' : 'Create Contact'} - - - - name - - - {/* alias */} - address + + + + + + navigation.navigate(contactsStackRouteNames.ContactsList) + } + backgroundColor={colors.background.primary} + color={colors.lightPurple} + style={styles.backButton} + size={15} + borderRadius={20} + /> + + {initialValue.id ? 'Edit Contact' : 'Create Contact'} + + + + name + + + {/* alias */} + address + + + + + + - - - - - - + + ) } const styles = StyleSheet.create({ + screen: { + flex: 1, + backgroundColor: colors.background.darkBlue, + }, parent: { alignContent: 'space-around', height: '100%', @@ -165,8 +183,7 @@ const styles = StyleSheet.create({ marginBottom: 20, }, footer: { - flex: 2, - justifyContent: 'flex-end', + marginTop: 25, }, saveButton: { justifyContent: 'center',