|
|
|
@@ -16,7 +16,6 @@ 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; |
|
|
|
@@ -68,12 +67,9 @@ export default function ClientForm() { |
|
|
|
Lastname: values.lastName, |
|
|
|
Description: values.description, |
|
|
|
}; |
|
|
|
const token = |
|
|
|
captchaRef.current.getValue() || captchaRef2.current.getValue(); |
|
|
|
const token = captchaRef.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!'); |
|
|
|
@@ -243,19 +239,12 @@ export default function ClientForm() { |
|
|
|
/> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<div className="items-center justify-end hidden sm:flex"> |
|
|
|
<div className="items-center justify-end flex"> |
|
|
|
<ReCAPTCHA |
|
|
|
sitekey={process.env.REACT_APP_SITE_KEY} |
|
|
|
ref={captchaRef} |
|
|
|
/> |
|
|
|
</div> |
|
|
|
<div className="flex items-center justify-end sm:hidden"> |
|
|
|
<ReCAPTCHA |
|
|
|
sitekey={process.env.REACT_APP_SITE_KEY} |
|
|
|
ref={captchaRef2} |
|
|
|
size="compact" |
|
|
|
/> |
|
|
|
</div> |
|
|
|
<div className=" py-3 text-right"> |
|
|
|
<button |
|
|
|
type="submit" |