Created
May 20, 2020 16:55
-
-
Save mrcflorian/1d94b6907d3b6521d698512aa55ebeb7 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
import React, { useState } from 'react' | |
import { Image, Text, TextInput, TouchableOpacity, View } from 'react-native' | |
import { KeyboardAwareScrollView } from 'react-native-keyboard-aware-scroll-view'; | |
import styles from './styles'; | |
export default function LoginScreen({navigation}) { | |
const [email, setEmail] = useState('') | |
const [password, setPassword] = useState('') | |
const onFooterLinkPress = () => { | |
navigation.navigate('Registration') | |
} | |
const onLoginPress = () => { | |
} | |
return ( | |
<View style={styles.container}> | |
<KeyboardAwareScrollView | |
style={{ flex: 1, width: '100%' }} | |
keyboardShouldPersistTaps="always"> | |
<Image | |
style={styles.logo} | |
source={require('../../../assets/icon.png')} | |
/> | |
<TextInput | |
style={styles.input} | |
placeholder='E-mail' | |
placeholderTextColor="#aaaaaa" | |
onChangeText={(text) => setEmail(text)} | |
value={email} | |
underlineColorAndroid="transparent" | |
autoCapitalize="none" | |
/> | |
<TextInput | |
style={styles.input} | |
placeholderTextColor="#aaaaaa" | |
secureTextEntry | |
placeholder='Password' | |
onChangeText={(text) => setPassword(text)} | |
value={password} | |
underlineColorAndroid="transparent" | |
autoCapitalize="none" | |
/> | |
<TouchableOpacity | |
style={styles.button} | |
onPress={() => onLoginPress()}> | |
<Text style={styles.buttonTitle}>Log in</Text> | |
</TouchableOpacity> | |
<View style={styles.footerView}> | |
<Text style={styles.footerText}>Don't have an account? <Text onPress={onFooterLinkPress} style={styles.footerLink}>Sign up</Text></Text> | |
</View> | |
</KeyboardAwareScrollView> | |
</View> | |
) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment