diff --git a/client/screens/LoginScreen.js b/client/screens/LoginScreen.js index 99aa740f70..e898d4a137 100644 --- a/client/screens/LoginScreen.js +++ b/client/screens/LoginScreen.js @@ -12,11 +12,10 @@ import { View, } from "native-base"; - import { FontAwesome } from "@expo/vector-icons"; -import * as WebBrowser from 'expo-web-browser'; -import * as Google from 'expo-auth-session/providers/google'; +import * as WebBrowser from "expo-web-browser"; +import * as Google from "expo-auth-session/providers/google"; import { useState, useEffect } from "react"; import useLogin from "../hooks/useLogin"; import { useAuth } from "../auth/provider"; @@ -25,30 +24,30 @@ import { useRouter } from "expo-router"; import { theme } from "../theme"; // import { signInWithGoogle } from "../auth/firebase"; import { signInWithGoogle } from "../auth/firebase"; - - - +import { useDispatch } from "react-redux"; +import { signIn } from "../store/authStore"; export default function Login() { const [email, setEmail] = useState(""); const [password, setPassword] = useState(""); - const [code, setCode] = useState("") + const [code, setCode] = useState(""); - const [status, setStatus] = useState("login") - const [error, setError] = useState("") + const [status, setStatus] = useState("login"); + const [error, setError] = useState(""); + + const dispatch = useDispatch(); const { signInWithEmailPasswordProvider } = useAuth(); const { loginUser } = useLogin(); - const router = useRouter(); - + const router = useRouter(); const [token, setToken] = useState(""); const [userInfo, setUserInfo] = useState(null); - - - + const handleLogin = () => { + dispatch(signIn({ email, password })); + }; // useEffect(() => { // if (response?.type === 'success') { @@ -144,11 +143,14 @@ export default function Login() {