misc: improved ux by requiring captcha entry before submission

This commit is contained in:
Sheen Capadngan
2024-06-06 21:24:25 +08:00
parent 81e4129e51
commit 65d88ef08e
3 changed files with 10 additions and 1 deletions
@@ -141,6 +141,7 @@ export const InitialStep = ({ setStep, email, setEmail, password, setPassword }:
captchaRef.current.resetCaptcha();
}
setCaptchaToken("");
setIsLoading(false);
};
@@ -274,6 +275,7 @@ export const InitialStep = ({ setStep, email, setEmail, password, setPassword }:
)}
<div className="mt-3 w-1/4 min-w-[21.2rem] rounded-md text-center md:min-w-[20.1rem] lg:w-1/6">
<Button
disabled={shouldShowCaptcha && captchaToken === ""}
type="submit"
size="sm"
isFullWidth
@@ -180,6 +180,7 @@ export const PasswordStep = ({
if (captchaRef.current) {
captchaRef.current.resetCaptcha();
}
setCaptchaToken("");
};
return (
@@ -223,6 +224,7 @@ export const PasswordStep = ({
)}
<div className="mx-auto mt-4 flex w-1/4 w-full min-w-[22rem] items-center justify-center rounded-md text-center lg:w-1/6">
<Button
disabled={shouldShowCaptcha && captchaToken === ""}
type="submit"
colorSchema="primary"
variant="outline_bg"