Compare commits
No commits in common. "bc48c17c2a024c92c8031f416934f721d5d3cb6f" and "a175f83170919e4298ae7a24f0bc297718726ef2" have entirely different histories.
bc48c17c2a
...
a175f83170
@ -31,7 +31,7 @@ const ContactForm = () => {
|
||||
const { name, value } = e.target;
|
||||
setForms({ ...forms, [name]: value });
|
||||
|
||||
if (validator.allValid() && recaptchaToken) {
|
||||
if (validator.allValid()) {
|
||||
validator.hideMessages();
|
||||
} else {
|
||||
validator.showMessages();
|
||||
@ -40,15 +40,12 @@ const ContactForm = () => {
|
||||
|
||||
const handleRecaptcha = (token) => {
|
||||
setRecaptchaToken(token);
|
||||
if (validator.allValid() && token) {
|
||||
validator.hideMessages();
|
||||
}
|
||||
};
|
||||
|
||||
const submitHandler = async (e) => {
|
||||
e.preventDefault();
|
||||
|
||||
if (validator.allValid() && recaptchaToken) {
|
||||
if (validator.allValid()) {
|
||||
validator.hideMessages();
|
||||
|
||||
const emailPayload = {
|
||||
@ -205,9 +202,6 @@ const ContactForm = () => {
|
||||
sitekey={RECAPTCHA_SITEKEY}
|
||||
onChange={handleRecaptcha}
|
||||
/>
|
||||
{!recaptchaToken &&
|
||||
<div className="errorMessage">{t("form.requiredMessages.recaptcha")}</div>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user