From f2a930622378c68197c0450c7990e99549f281a9 Mon Sep 17 00:00:00 2001 From: Justin Shillingford Date: Tue, 30 Jun 2020 09:01:13 -0400 Subject: Added ability to dismiss keyboard on outside tap --- src/screens/Login.tsx | 118 ++++++++++++++++++++++++++------------------------ 1 file changed, 61 insertions(+), 57 deletions(-) (limited to 'src') diff --git a/src/screens/Login.tsx b/src/screens/Login.tsx index 77bc1b61..fe5748fc 100644 --- a/src/screens/Login.tsx +++ b/src/screens/Login.tsx @@ -9,6 +9,8 @@ import { Image, TouchableOpacity, StyleSheet, + Keyboard, + TouchableWithoutFeedback } from 'react-native'; import {RootStackParams} from '../routes'; @@ -101,66 +103,68 @@ const Login = ({navigation}: LoginProps) => { return ( <> - - - - handleUsernameUpdate(user)} - onSubmitEditing={() => handleUsernameSubmit()} - isValid={data.isValidUser} - validationWarning={'Username must be at least 6 characters long.'} - /> - handlePasswordUpdate(user)} - focusPasswordInput={data.focusPasswordInput} - onSubmitEditing={() => handleLogin()} - isValid={data.isValidPassword} - validationWarning={'Password must be at least 8 characters long.'} - /> - Alert.alert("tagg! You're it!")}> - Forgot password - - handleLogin()}> - Let's Start! - - - New to tagg?{' '} + {Keyboard.dismiss()}}> + + + + handleUsernameUpdate(user)} + onSubmitEditing={() => handleUsernameSubmit()} + isValid={data.isValidUser} + validationWarning={'Username must be at least 6 characters long.'} + /> + handlePasswordUpdate(user)} + focusPasswordInput={data.focusPasswordInput} + onSubmitEditing={() => handleLogin()} + isValid={data.isValidPassword} + validationWarning={'Password must be at least 8 characters long.'} + /> + Alert.alert("tagg! You're it!")}> + Forgot password + + handleLogin()}> + Let's Start! + - Alert.alert('I get the tagg flip it and tumble it.') - }> - Get started! + accessibilityLabel="New to tagg?" + style={styles.newUser}> + New to tagg?{' '} + + Alert.alert('I get the tagg flip it and tumble it.') + }> + Get started! + - - - + + + ); }; -- cgit v1.2.3-70-g09d2