Skip to content

Commit

Permalink
refactor: disable button logic and env vars
Browse files Browse the repository at this point in the history
  • Loading branch information
nzambello committed Aug 20, 2021
1 parent 76ce1b3 commit d09dcce
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions src/components/FormView.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,9 @@ const FormView = ({
}) => {
const intl = useIntl();

const captcha = process.env.RAZZLE_HCAPTCHA_KEY
const captcha = !!process.env.RAZZLE_HCAPTCHA_KEY
? 'HCaptcha'
: process.env.RAZZLE_RECAPTCHA_KEY
: !!process.env.RAZZLE_RECAPTCHA_KEY
? 'GoogleReCaptcha'
: null;

Expand Down Expand Up @@ -174,10 +174,7 @@ const FormView = ({
primary
type="submit"
disabled={
(!validToken?.current &&
(!!process.env.RAZZLE_RECAPTCHA_KEY ||
!!process.env.RAZZLE_HCAPTCHA_KEY)) ||
formState.loading
(captcha && !validToken?.current) || formState.loading
}
>
{data.submit_label ||
Expand Down

0 comments on commit d09dcce

Please sign in to comment.