Skip to content

Commit

Permalink
ok nevermnd
Browse files Browse the repository at this point in the history
  • Loading branch information
ryanidk committed Jun 28, 2024
1 parent 3ddb6da commit 72bf993
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions packages/webapp/src/pages/form/Render/CustomCode.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -80,15 +80,6 @@ export const CustomCode = ({ form, query }: { form: FormModel; query: Record<str
document.title = form.name ? `${form.name} - Forms` : 'Forms'
}, [form.name])

useEffect(() => {
if (form.settings!.captchaKind === CaptchaKindEnum.GOOGLE_RECAPTCHA) {
const script = document.createElement('script');
script.src = `https://www.google.com/recaptcha/api.js?render=${GOOGLE_RECAPTCHA_KEY}`;
script.async = true;
document.body.appendChild(script);
}
}, [form.settings!.captchaKind]);

return (
<>
<link href={fontURL} rel="stylesheet" />
Expand All @@ -97,6 +88,13 @@ export const CustomCode = ({ form, query }: { form: FormModel; query: Record<str
<style dangerouslySetInnerHTML={{ __html: form.themeSettings!.theme!.customCSS! }} />
)}

{form.settings!.captchaKind === CaptchaKindEnum.GOOGLE_RECAPTCHA && (
<script src={`https://www.google.com/recaptcha/api.js?render=${GOOGLE_RECAPTCHA_KEY}`} />
)}
{form.settings!.captchaKind === CaptchaKindEnum.GEETEST_CAPTCHA && (
<script src="https://static.geetest.com/v4/gt4.js" />
)}

{isStripeEnabled(form) && <script id="stripe" src="https://js.stripe.com/v3/" />}

{helper.isValid(integrations.googleanalytics) && (
Expand Down

0 comments on commit 72bf993

Please sign in to comment.