Skip to content

Commit 975db80

Browse files
(Admin) Jonathan Ruda(Admin) Jonathan Ruda
authored andcommitted
Improvement of params and conditions, PR suggestion
1 parent 9062917 commit 975db80

File tree

1 file changed

+5
-11
lines changed

1 file changed

+5
-11
lines changed

dotcom-rendering/src/components/ManyNewslettersFormFields.tsx

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -33,15 +33,10 @@ const optInCheckboxTextSmall = css`
3333
}
3434
`;
3535

36-
const recaptchaContainerStyle = (
37-
visibleRecaptcha: boolean,
38-
firstInteractionOccurred: boolean,
39-
) => css`
40-
margin-bottom: ${visibleRecaptcha && firstInteractionOccurred
41-
? space[3]
42-
: 0}px;
43-
padding: ${visibleRecaptcha && firstInteractionOccurred ? space[2] : 0}px;
44-
background-color: ${visibleRecaptcha && firstInteractionOccurred
36+
const recaptchaContainerStyle = (showRecaptchaContainer: boolean) => css`
37+
margin-bottom: ${showRecaptchaContainer ? space[3] : 0}px;
38+
padding: ${showRecaptchaContainer ? space[2] : 0}px;
39+
background-color: ${showRecaptchaContainer
4540
? palette.neutral[93]
4641
: 'transparent'};
4742
@@ -114,8 +109,7 @@ export const ManyNewslettersFormFields: FC<ManyNewslettersFormFieldsProps> = ({
114109
{useReCaptcha && !!captchaSiteKey && (
115110
<div
116111
css={recaptchaContainerStyle(
117-
visibleRecaptcha,
118-
firstInteractionOccurred,
112+
visibleRecaptcha && firstInteractionOccurred,
119113
)}
120114
>
121115
{(!visibleRecaptcha || firstInteractionOccurred) && (

0 commit comments

Comments
 (0)