Created
October 14, 2018 15:26
-
-
Save calendee/39e3908940be9964e873b3dec0106ced to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Be sure to import the Keyboard | |
import { Keyboard } from 'react-native' | |
// Tell the view what to do with taps | |
const shouldSetResponse = () => true; | |
const onRelease = () => ( | |
Keyboard.dismiss() | |
); | |
// Your view | |
<SafeAreaView> | |
<View | |
onResponderRelease={ onRelease } | |
onStartShouldSetResponder={ shouldSetResponse } | |
style={ { height: '100%' } } | |
> | |
<TextInput | |
autoCapitalize="none" | |
keyboardType="email-address" | |
onChangeText={ this.changeEmailText } | |
placeholder="Email Address" | |
style={ [styles.textInput, emailInvalid ? styles.textInputError : null] } | |
testID="email" | |
value={ email } | |
/> | |
<TextInput | |
onChangeText={ this.changePasswordText } | |
placeholder="Password" | |
secureTextEntry | |
style={ [styles.textInput, passwordInvalid ? styles.textInputError : null] } | |
testID="password" | |
value={ password } | |
/> | |
<Text> | |
{ failureMessage } | |
</Text> | |
{ !loggingIn | |
&& ( | |
<Button | |
onPress={ this.login } | |
testID="button-login" | |
title="Login" | |
color="#841584" | |
accessibilityLabel="Login" | |
/> | |
) | |
} | |
<Button | |
onPress={ this.closeModal } | |
testID="button-close-modal" | |
title="Close" | |
color="#841584" | |
accessibilityLabel="Close" | |
/> | |
</View> | |
</SafeAreaView> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment