|
|
|
@@ -16,6 +16,7 @@ export default function ClientForm() { |
|
|
|
const { clientForm, setClientForm } = useContext(ClientFormContext); |
|
|
|
const [sucMsg, setSucMsg] = useState(false); |
|
|
|
const captchaRef = useRef(null); |
|
|
|
const captchaRef2 = useRef(null); |
|
|
|
const [msgText, setMsgText] = useState(''); |
|
|
|
const changeFormHandler = event => { |
|
|
|
const { name, value } = event.target; |
|
|
|
@@ -67,8 +68,12 @@ export default function ClientForm() { |
|
|
|
Lastname: values.lastName, |
|
|
|
Description: values.description, |
|
|
|
}; |
|
|
|
const token = captchaRef.current.getValue(); |
|
|
|
const token = |
|
|
|
captchaRef.current.getValue() || captchaRef2.current.getValue(); |
|
|
|
captchaRef.current.reset(); |
|
|
|
captchaRef2.current.reset(); |
|
|
|
|
|
|
|
console.log(token); |
|
|
|
if (token.length === 0) { |
|
|
|
setSucMsg(true); |
|
|
|
setMsgText('Please fill reCAPTCHA and try again. Thank you!'); |
|
|
|
@@ -247,7 +252,7 @@ export default function ClientForm() { |
|
|
|
<div className="flex items-center justify-end sm:hidden"> |
|
|
|
<ReCAPTCHA |
|
|
|
sitekey={process.env.REACT_APP_SITE_KEY} |
|
|
|
ref={captchaRef} |
|
|
|
ref={captchaRef2} |
|
|
|
size="compact" |
|
|
|
/> |
|
|
|
</div> |