Skip to content

Instantly share code, notes, and snippets.

@youneshenniwrites
Last active January 13, 2019 12:12
Show Gist options
  • Save youneshenniwrites/21abd8c7f2578439bbdf08edbbe61de2 to your computer and use it in GitHub Desktop.
Save youneshenniwrites/21abd8c7f2578439bbdf08edbbe61de2 to your computer and use it in GitHub Desktop.
Sign in screen layout for RNAuthAWS
export default class SignInScreen extends React.Component {
//... same code as before in the above
render() {
return (
<SafeAreaView style={styles.container}>
<StatusBar/>
<KeyboardAvoidingView style={styles.container} behavior='padding' enabled>
<TouchableWithoutFeedback style={styles.container} onPress={Keyboard.dismiss}>
<View style={styles.container}>
<Container style={styles.infoContainer}>
<View style={styles.container}>
<Item rounded style={styles.itemStyle}>
<Icon
active
name='person'
style={styles.iconStyle}
/>
<Input
style={styles.input}
placeholder='Username'
placeholderTextColor='#adb4bc'
keyboardType={'email-address'}
returnKeyType='next'
autoCapitalize='none'
autoCorrect={false}
onSubmitEditing={(event) => {this.refs.SecondInput._root.focus()}}
onChangeText={value => this.onChangeText('username', value)}
/>
</Item>
<Item rounded style={styles.itemStyle}>
<Icon
active
name='lock'
style={styles.iconStyle}
/>
<Input
style={styles.input}
placeholder='Password'
placeholderTextColor='#adb4bc'
returnKeyType='go'
autoCapitalize='none'
autoCorrect={false}
secureTextEntry={true}
ref='SecondInput'
onChangeText={value => this.onChangeText('password', value)}
/>
</Item>
<TouchableOpacity
onPress={() => this.signIn()}
style={styles.buttonStyle}>
<Text style={styles.buttonText}>
Sign In
</Text>
</TouchableOpacity>
</View>
</Container>
</View>
</TouchableWithoutFeedback>
</KeyboardAvoidingView>
</SafeAreaView>
)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment