From 2acd5d4af26c6ec51a5cdc08db819f892db061f7 Mon Sep 17 00:00:00 2001 From: f97 Date: Wed, 21 Sep 2022 13:12:16 +0700 Subject: [PATCH] chore: support html form (#236) --- web/src/pages/Auth.tsx | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/web/src/pages/Auth.tsx b/web/src/pages/Auth.tsx index 2899861e..aede8569 100644 --- a/web/src/pages/Auth.tsx +++ b/web/src/pages/Auth.tsx @@ -47,7 +47,9 @@ const Auth = () => { setPassword(text); }; - const handleSigninBtnsClick = async () => { + const handleSigninBtnsClick = async (e: React.FormEvent) => { + e.preventDefault(); + if (actionBtnLoadingState.isLoading) { return; } @@ -80,7 +82,9 @@ const Auth = () => { actionBtnLoadingState.setFinish(); }; - const handleSignUpAsHostBtnsClick = async () => { + const handleSignUpAsHostBtnsClick = async (e: React.FormEvent) => { + e.preventDefault(); + if (actionBtnLoadingState.isLoading) { return; } @@ -120,7 +124,7 @@ const Auth = () => { return (
-
+
(siteHost ? handleSigninBtnsClick(e) : handleSignUpAsHostBtnsClick(e))}>
@@ -130,19 +134,16 @@ const Auth = () => {
{t("common.email")} - +
{t("common.password")} - +
{!pageLoadingState.isLoading && ( - @@ -151,7 +152,7 @@ const Auth = () => {

{siteHost || pageLoadingState.isLoading ? t("auth.not-host-tip") : t("auth.host-tip")}

-
+
handleLocaleItemClick("en")}>