first commit in repo

This commit is contained in:
Adolfo Reyna
2022-03-05 20:51:45 -08:00
parent fe2ec54139
commit 195e8f11ef
4 changed files with 360 additions and 14 deletions

49
components/Login.js Normal file
View File

@@ -0,0 +1,49 @@
import { StatusBar } from 'expo-status-bar';
import React, { useState } from 'react';
import { Text, View, TextInput, Button } from 'react-native';
import API from './../API.js';
let LoginForm = ()=>{
let [email, setEmail] = useState('');
let [password, setPassword] = useState('');
return (
<View>
<Text>Log in</Text>
<TextInput
style={{
height: 40,
width: 200,
borderColor: 'gray',
borderWidth: 1
}}
onChangeText={text => setEmail(text)}
defaultValue={email}
placeholder=" email"
/>
<TextInput
style={{
height: 40,
width: 200,
borderColor: 'gray',
borderWidth: 1
}}
onChangeText={text => setPassword(text)}
defaultValue={password}
placeholder=" password"
textContentType="password"
secureTextEntry={true}
/>
<Button
onPress={async () => {
let r = await API.logIn(email, password);
console.log(r);
}}
title={"login"}
/>
</View>
);
}
export default LoginForm;