import { defaultStyles } from "@/constants/defaultStyles"; import { supabase } from "@/lib/supabase"; import { router, Stack } from "expo-router"; import { useState } from "react"; import { Alert, Button, Keyboard, KeyboardAvoidingView, Platform, Text, TextInput, TouchableWithoutFeedback, View } from "react-native"; export default function Login() { const [email, setEmail] = useState(''); const [password, setPassword] = useState(''); const login = async () => { if(email.trim() === '' || password.trim() === '') { Alert.alert("All fields are required!"); return; } const { error } = await supabase.auth.signInWithPassword({ email, password }); if (error) { Alert.alert("Login failed, please check your credentials and try again"); return; } router.replace("/"); } return ( Login