Skip to content

Instantly share code, notes, and snippets.

@youneshenniwrites
Last active January 14, 2019 09:04
Show Gist options
  • Save youneshenniwrites/e13e77e530e2dde4e1280b8b60af21ce to your computer and use it in GitHub Desktop.
Save youneshenniwrites/e13e77e530e2dde4e1280b8b60af21ce to your computer and use it in GitHub Desktop.
Settings screen layout for RNAuthAWS
export default class SettingsScreen extends React.Component {
// ... same code above this line
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}>
{/*Infos*/}
<Container style={styles.infoContainer}>
<View style={styles.container}>
<View
style={
[styles.buttonStyle, {borderRadius: 4, marginBottom: 20}]
}>
<Text style={styles.buttonText}>Change password</Text>
</View>
{/* Old password */}
<Item rounded style={styles.itemStyle}>
<Icon
active
name='lock'
style={styles.iconStyle}
/>
<Input
style={styles.input}
placeholder='Old password'
placeholderTextColor='#adb4bc'
returnKeyType='next'
autoCapitalize='none'
autoCorrect={false}
secureTextEntry={true}
onSubmitEditing={(event) => { this.refs.SecondInput._root.focus()}}
onChangeText={value => this.onChangeText('password1', value)}
/>
</Item>
{/* New password */}
<Item rounded style={styles.itemStyle}>
<Icon
active
name='lock'
style={styles.iconStyle}
/>
<Input
style={styles.input}
placeholder='New password'
placeholderTextColor='#adb4bc'
returnKeyType='go'
autoCapitalize='none'
autoCorrect={false}
secureTextEntry={true}
ref='SecondInput'
onChangeText={value => this.onChangeText('password2', value)}
/>
</Item>
<TouchableOpacity
style={styles.buttonStyle}>
<Text style={styles.buttonText}>
Submit
</Text>
</TouchableOpacity>
<View
style={
{
justifyContent: 'center',
alignItems: 'center',
paddingBottom: 100
}
}
/>
<TouchableOpacity
style={
[styles.buttonStyle,
{
flexDirection: 'row',
justifyContent: 'center'
}
]
}
onPress={() => this.singOut()}>
<Icon name='md-power' style={{color: '#fff', paddingRight: 10}}/>
<Text style={styles.buttonText}>
Sign out
</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