import { ThemedText } from "@/components/themed-text"; import { ThemedTextInput } from "@/components/themed-textinput"; import { ThemedView } from "@/components/themed-view"; import { router } from "expo-router"; import { signInWithEmailAndPassword } from "firebase/auth"; import React, { useState } from "react"; import { Button, StyleSheet, View } from "react-native"; import { auth } from "../../firebase_config"; import { useUser } from "../ContextUser"; const DEFAULT_ROLE = "resp"; const LoginScreen: React.FC = () => { const [email, setEmail] = useState(""); const [password, setPassword] = useState(""); const { setUser, setRole } = useUser(); const handleLogin = async () => { try { await signInWithEmailAndPassword(auth, email, password); router.replace("/(tabs)"); } catch (error: any) { alert(error.message); } }; /*const handleRegister = async () => { try { await createUserWithEmailAndPassword(auth, email, password); router.replace("/(tabs)"); } catch (error: any) { alert(error.message); } }; */ return ( Se connecter / S'incrire