Skip to content

Instantly share code, notes, and snippets.

@popeating
Created August 4, 2020 19:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save popeating/3b3e1523e05f1a3ebff21a8b094d25bf to your computer and use it in GitHub Desktop.
Save popeating/3b3e1523e05f1a3ebff21a8b094d25bf to your computer and use it in GitHub Desktop.
import React, { useState } from 'react';
import {
View,
StyleSheet,
TouchableWithoutFeedback,
Keyboard,
} from 'react-native';
import { TextInput, Button } from 'react-native-paper';
import loc from '../utils/localization';
const SignUpScreen = ({ navigation }) => {
const [name, setName] = useState('');
const [email, setEmail] = useState('');
const [password, setPassword] = useState('');
return (
<TouchableWithoutFeedback onPress={() => Keyboard.dismiss()}>
<View style={styles.container}>
<View style={styles.inputContainer}>
<TextInput
placeholder="Email address"
onChangeText={(name) => setName(name)}
value={name}
label={loc.t('nome')}
mode="outlined"
/>
</View>
<View style={styles.inputContainer}>
<TextInput
placeholder="Email address"
onChangeText={(email) => setEmail(email)}
value={email}
label="Email"
keyboardType={'email-address'}
mode="outlined"
/>
</View>
<View style={styles.inputContainer}>
<TextInput
placeholder="Password"
onChangeText={(password) => setPassword(password)}
value={password}
secureTextEntry={true}
label="Password"
mode="outlined"
/>
</View>
<Button mode="contained" icon="login">
{loc.t('signupButton')}
</Button>
</View>
</TouchableWithoutFeedback>
);
};
const styles = StyleSheet.create({
inputContainer: {
width: '80%',
marginBottom: 20,
},
container: {
flex: 1,
//backgroundColor: '#fff',
alignItems: 'center',
justifyContent: 'center',
},
});
export default SignUpScreen;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment