diff --git a/src/app/login/page.tsx b/src/app/login/page.tsx index e294b9c..cff433e 100644 --- a/src/app/login/page.tsx +++ b/src/app/login/page.tsx @@ -1,3 +1,4 @@ + 'use client'; import React from 'react'; @@ -15,6 +16,7 @@ function Page() { const [email, setEmail] = useState(''); const [password, setPassword] = useState(''); const [disabled, setDisabled] = useState(false); + const [loginLoading, setLoginLoading] = useState(false); const login = useAuthStore((state: any) => state.login); useEffect(() => { @@ -34,6 +36,13 @@ function Page() { } else { toast.error('Wrong email or password'); } + setLoginLoading(false); + } + + async function handleLogin() { + setLoginLoading(true); + await userLogin(); + setLoginLoading(false); } return ( @@ -107,15 +116,25 @@ function Page() {
- -
+ {loginLoading ? ( + + ) : ( + + )} + ' @@ -136,3 +155,4 @@ function Page() { } export default Page; +