Skip to content

Commit

Permalink
refactor: captcha components with loadable
Browse files Browse the repository at this point in the history
  • Loading branch information
nzambello committed Aug 8, 2021
1 parent 4e7556c commit 83d504b
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/components/FormView.jsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import React, { useCallback, useState, useEffect, useRef } from 'react';
import { useIntl, defineMessages } from 'react-intl';
import HCaptcha from '@hcaptcha/react-hcaptcha';
import { GoogleReCaptcha } from 'react-google-recaptcha-v3';
import loadable from '@loadable/component';
import {
Segment,
Message,
Expand All @@ -14,6 +13,11 @@ import { getFieldName } from './utils';
import Field from 'volto-form-block/components/Field';
import './FormView.css';

const HCaptcha = loadable(() => import('@hcaptcha/react-hcaptcha'));
const { GoogleReCaptcha } = loadable.lib(() =>
import('react-google-recaptcha-v3'),
);

const messages = defineMessages({
default_submit_label: {
id: 'form_default_submit_label',
Expand Down

0 comments on commit 83d504b

Please sign in to comment.