fixed error for captcha

This commit is contained in:
oriofir 2022-08-29 15:14:36 -07:00
parent 369f46defe
commit b8ce4cc15e

View File

@ -40,7 +40,7 @@ const CustomForm = ({ data }: FormProps) => {
const [errorMsg, setErrorMsg] = useState('')
const [isFormSent, setIsFormSent] = useState(false)
const [isSending, setIsSending] = useState(false)
const reRef = useRef<ReCAPTCHA>()
// const reRef = useRef<ReCAPTCHA>()
const handleSubmit = async (e: any) => {
e.preventDefault()
@ -61,7 +61,7 @@ const CustomForm = ({ data }: FormProps) => {
inquiry: selectedOption.value
}
const token = await reRef.current.executeAsync()
// const token = await reRef.current.executeAsync()
await fetch(`${process.env.NEXT_PUBLIC_API}/api/contact`, {
method: 'POST',
@ -127,11 +127,11 @@ const CustomForm = ({ data }: FormProps) => {
onChange={(e) => setText(e.target.value)}
></textarea>
</label>
<ReCAPTCHA
{/* <ReCAPTCHA
siteKey={process.env.NEXT_PUBLIC_RECAPTCHA_SITE_KEY}
size="invisible"
ref={reRef}
/>
/> */}
<Button size="medium" variant="primary">
{data?.formLabelButton}
</Button>