import { useState } from "react"; import { Link, router } from "expo-router"; import { ActivityIndicator, Image, Pressable, Text, TextInput, View } from "react-native"; import { Ionicons } from "@expo/vector-icons"; import { supabase } from "@/lib/supabase"; export default function LoginScreen() { const [email, setEmail] = useState(""); const [password, setPassword] = useState(""); const [showPassword, setShowPassword] = useState(false); const [loading, setLoading] = useState(false); const [error, setError] = useState(null); async function onSubmit() { setError(null); setLoading(true); const { error: signInError } = await supabase.auth.signInWithPassword({ email, password }); setLoading(false); if (signInError) { setError(signInError.message); return; } router.replace("/"); } return ( {/* Brand Icon Header */} MenuL.io AI destekli dijital restoran menü yöneticisi {error ? ( {error} ) : null} {/* Email Input */} {/* Password Input */} setShowPassword(!showPassword)} style={{ padding: 4 }}> {/* Submit Button */} ({ backgroundColor: "#1C1917", borderRadius: 12, padding: 16, flexDirection: "row", alignItems: "center", justifyContent: "center", gap: 8, opacity: loading || !email || !password ? 0.6 : pressed ? 0.9 : 1, shadowColor: "#000", shadowOffset: { width: 0, height: 2 }, shadowOpacity: 0.1, shadowRadius: 8, elevation: 3, })} > {loading ? ( ) : ( <> Giriş Yap )} Hesabın yok mu? Kayıt ol ); }