Skip to content

Commit

Permalink
Merge pull request #359 from dappforce/deploy/fix-bot
Browse files Browse the repository at this point in the history
Fix ReCaptcha in Home Page Showing Challenge outside of the website
  • Loading branch information
olehmell authored Aug 30, 2023
2 parents 0422216 + 57db85f commit 0f3024c
Showing 1 changed file with 7 additions and 11 deletions.
18 changes: 7 additions & 11 deletions src/components/captcha/CaptchaInvisible.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { getCaptchaSiteKey } from '@/utils/env/client'
import React, { useRef } from 'react'
import { createPortal } from 'react-dom'
import ReCAPTCHA from 'react-google-recaptcha'
import { toast } from 'react-hot-toast'
import Toast from '../Toast'
Expand Down Expand Up @@ -39,16 +38,13 @@ export default function CaptchaInvisible({ children }: CaptchaInvisibleProps) {
{children(runCaptcha, (className) => (
<CaptchaTermsAndService className={className} />
))}
{createPortal(
<ReCAPTCHA
sitekey={getCaptchaSiteKey()}
theme='dark'
ref={captchaRef}
size='invisible'
badge='inline'
/>,
document.body
)}
<ReCAPTCHA
sitekey={getCaptchaSiteKey()}
theme='dark'
ref={captchaRef}
size='invisible'
badge='inline'
/>
</>
)
}

0 comments on commit 0f3024c

Please sign in to comment.