diff --git a/src/app/auth/_layout.tsx b/src/app/auth/_layout.tsx index 0578a39c..cf7d8349 100644 --- a/src/app/auth/_layout.tsx +++ b/src/app/auth/_layout.tsx @@ -5,6 +5,7 @@ function StackLayout() { + ); diff --git a/src/app/auth/login.tsx b/src/app/auth/login.tsx new file mode 100644 index 00000000..4015aabd --- /dev/null +++ b/src/app/auth/login.tsx @@ -0,0 +1,62 @@ +import React, { useState } from 'react'; +import { Redirect, Link } from 'expo-router'; +import { Alert, View } from 'react-native'; +import { Button, Input } from 'react-native-elements'; +import { useSession } from '../../utils/AuthContext'; +import globalStyles from '../../styles/globalStyles'; + +function LoginScreen() { + const sessionHandler = useSession(); + const [email, setEmail] = useState(''); + const [password, setPassword] = useState(''); + const [loading, setLoading] = useState(false); + + if (sessionHandler.session) { + return ; + } + + const signInWithEmail = async () => { + setLoading(true); + const { error, data } = await sessionHandler.signInWithEmail( + email, + password, + ); + + if (error) Alert.alert(error.message); + setLoading(false); + }; + + return ( + + + setEmail(text)} + value={email} + placeholder="email@address.com" + autoCapitalize="none" + /> + + + setPassword(text)} + value={password} + secureTextEntry + placeholder="Password" + autoCapitalize="none" + /> + + + Don't have an account? Sign Up + + +