Skip to content

Commit aa54163

Browse files
author
Juarez Mota
committed
feat: move has string to separate file
1 parent 7fef552 commit aa54163

File tree

3 files changed

+3
-2
lines changed

3 files changed

+3
-2
lines changed

dotcom-rendering/src/components/SignInGate/gateDesigns/SignInGateAuxiaV1.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import {
1010
textSansBold15,
1111
} from '@guardian/source/foundations';
1212
import { SvgCross, SvgGuardianLogo } from '@guardian/source/react-components';
13+
import { has } from '../../../lib/has-string';
1314
import { AuthProviderButtons } from '../../AuthProviderButtons/AuthProviderButtons';
1415
import { useConfig } from '../../ConfigContext';
1516
import { ExternalLink } from '../../ExternalLink/ExternalLink';
@@ -47,7 +48,6 @@ export const SignInGateAuxiaV1 = ({
4748
first_cta_link: firstCtaLink,
4849
} = JSON.parse(userTreatment.treatmentContent) as TreatmentContentDecoded;
4950

50-
const has = (s?: string) => !!s && s.trim() !== '';
5151
const isDismissible = userTreatment.treatmentType.startsWith(
5252
'DISMISSABLE_SIGN_IN_GATE',
5353
);

dotcom-rendering/src/components/SignInGate/gateDesigns/SignInGateAuxiaV2.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ import {
1515
import { SvgCross, SvgGuardianLogo } from '@guardian/source/react-components';
1616
import { useEffect } from 'react';
1717
import { getZIndex } from '../../../lib/getZIndex';
18+
import { has } from '../../../lib/has-string';
1819
import { AuthProviderButtons } from '../../AuthProviderButtons/AuthProviderButtons';
1920
import { useConfig } from '../../ConfigContext';
2021
import { ExternalLink } from '../../ExternalLink/ExternalLink';
@@ -51,7 +52,6 @@ export const SignInGateAuxiaV2 = ({
5152
first_cta_link: firstCtaLink,
5253
} = JSON.parse(userTreatment.treatmentContent) as TreatmentContentDecoded;
5354

54-
const has = (s?: string) => !!s && s.trim() !== '';
5555
const isDismissible = userTreatment.treatmentType.startsWith(
5656
'DISMISSABLE_SIGN_IN_GATE',
5757
);
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export const has = (s?: string): boolean => !!s && s.trim() !== '';

0 commit comments

Comments
 (0)