Skip to content

Commit

Permalink
Fix, A fragment with only one child is redundant
Browse files Browse the repository at this point in the history
  • Loading branch information
eunjuhuss committed Mar 1, 2024
1 parent 416ae3d commit 3365bfc
Showing 1 changed file with 19 additions and 23 deletions.
42 changes: 19 additions & 23 deletions src/components/Common/Captcha.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { CaptchaProps } from "components/Signup/SignupCaptcha";
import { useAppSelector } from "eduid-hooks";
import React, { useMemo, useState } from "react";
import { useMemo, useState } from "react";
import { FormattedMessage } from "react-intl";
import Recaptcha from "react-recaptcha";
import ScriptLoader from "react-script-loader-hoc";
Expand All @@ -21,24 +21,22 @@ function LoadingCaptcha(props: LoadingCaptchaProps) {
}

return (
<React.Fragment>
<div id="captcha-container">
<div id="captcha">
<Recaptcha
sitekey={recaptcha_key}
render="explicit"
verifyCallback={props.handleCaptchaCompleted}
onloadCallback={loadedCaptcha}
/>
</div>
<div id="captcha-buttons" className="buttons">
<EduIDButton onClick={props.handleCaptchaCancel} buttonstyle="secondary" id="cancel-captcha-button">
<FormattedMessage defaultMessage="Cancel" description="Signup cancel button" />
</EduIDButton>
<DevSubmitCaptchaButton {...props} />
</div>
<div id="captcha-container">
<div id="captcha">
<Recaptcha
sitekey={recaptcha_key}
render="explicit"
verifyCallback={props.handleCaptchaCompleted}
onloadCallback={loadedCaptcha}
/>
</div>
</React.Fragment>
<div id="captcha-buttons" className="buttons">
<EduIDButton onClick={props.handleCaptchaCancel} buttonstyle="secondary" id="cancel-captcha-button">
<FormattedMessage defaultMessage="Cancel" description="Signup cancel button" />
</EduIDButton>
<DevSubmitCaptchaButton {...props} />
</div>
</div>
);
}

Expand Down Expand Up @@ -78,10 +76,8 @@ export function Captcha(props: CaptchaProps) {
}

return (
<React.Fragment>
<Splash showChildren={scriptLoaded}>
<WrappedCaptcha {...props} scriptLoadedCallback={scriptLoadedCallback} />
</Splash>
</React.Fragment>
<Splash showChildren={scriptLoaded}>
<WrappedCaptcha {...props} scriptLoadedCallback={scriptLoadedCallback} />
</Splash>
);
}

0 comments on commit 3365bfc

Please sign in to comment.