diff --git a/components/auth/ForgotPassword.tsx b/components/auth/ForgotPassword.tsx index 261c171af..597ee328e 100644 --- a/components/auth/ForgotPassword.tsx +++ b/components/auth/ForgotPassword.tsx @@ -15,7 +15,9 @@ const ForgotPassword: FC = () => { const { setModalView, closeModal } = useUI() - const handleSignup = async () => { + const handleResetPassword = async (e: React.SyntheticEvent) => { + e.preventDefault() + if (!dirty && !disabled) { setDirty(true) handleValidation() @@ -34,7 +36,10 @@ const ForgotPassword: FC = () => { }, [handleValidation]) return ( -
+
@@ -47,7 +52,7 @@ const ForgotPassword: FC = () => {
-
+ ) } diff --git a/components/auth/LoginView.tsx b/components/auth/LoginView.tsx index 33cb88c21..785d9ab8a 100644 --- a/components/auth/LoginView.tsx +++ b/components/auth/LoginView.tsx @@ -18,7 +18,9 @@ const LoginView: FC = () => { const login = useLogin() - const handleLogin = async () => { + const handleLogin = async (e: React.SyntheticEvent) => { + e.preventDefault() + if (!dirty && !disabled) { setDirty(true) handleValidation() @@ -54,7 +56,10 @@ const LoginView: FC = () => { }, [handleValidation]) return ( -
+
@@ -75,7 +80,7 @@ const LoginView: FC = () => {
- + ) } diff --git a/components/auth/SignUpView.tsx b/components/auth/SignUpView.tsx index f0cfa8458..adc091732 100644 --- a/components/auth/SignUpView.tsx +++ b/components/auth/SignUpView.tsx @@ -21,7 +21,9 @@ const SignUpView: FC = () => { const signup = useSignup() const { setModalView, closeModal } = useUI() - const handleSignup = async () => { + const handleSignup = async (e: React.SyntheticEvent) => { + e.preventDefault() + if (!dirty && !disabled) { setDirty(true) handleValidation() @@ -59,7 +61,10 @@ const SignUpView: FC = () => { }, [handleValidation]) return ( -
+
@@ -83,7 +88,7 @@ const SignUpView: FC = () => {
-
+ ) }