Skip to content

Commit

Permalink
Remove portal from captha
Browse files Browse the repository at this point in the history
  • Loading branch information
teodorus-nathaniel committed Aug 30, 2023
1 parent 568fd9f commit 99ec7e9
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 99ec7e9

Please sign in to comment.