Skip to content

Commit 4f16e5c

Browse files
authored
Merge branch 'main' into ih/ab-testing-ui-branch
2 parents 27f8730 + 6ea6c95 commit 4f16e5c

File tree

4 files changed

+37
-7
lines changed

4 files changed

+37
-7
lines changed

dotcom-rendering/src/components/CardHeadline.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,7 @@ export const CardHeadline = ({
227227
css={css`
228228
color: ${headlineColour};
229229
`}
230-
className="show-underline"
230+
className="show-underline headline-text"
231231
>
232232
{headlineText}
233233
{isExternalLink && (

dotcom-rendering/src/components/Masthead/HighlightsCard.tsx

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,16 @@ const content = css`
100100
${from.tablet} {
101101
padding-bottom: 10px;
102102
}
103+
104+
/**
105+
* We're deliberately using a font-size that is not in Source so that
106+
* the headline doesn't exceed three lines across all mobile breakpoints
107+
*/
108+
${between.mobileMedium.and.mobileLandscape} {
109+
.headline-text {
110+
font-size: 1rem;
111+
}
112+
}
103113
`;
104114

105115
const starWrapper = css`
@@ -144,7 +154,7 @@ export const HighlightsCard = ({
144154
desktop: 'xxsmall',
145155
tablet: 'xxsmall',
146156
mobileMedium: 'xxsmall',
147-
mobile: 'tiny',
157+
mobile: 'xxxsmall',
148158
}}
149159
showPulsingDot={
150160
format.design === ArticleDesign.LiveBlog

dotcom-rendering/src/components/ScrollableHighlights.stories.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ const meta: Meta<typeof ScrollableHighlights> = {
1111
chromatic: {
1212
viewports: [
1313
breakpoints.mobile,
14+
breakpoints.mobileMedium,
1415
breakpoints.mobileLandscape,
1516
breakpoints.tablet,
1617
breakpoints.wide,

dotcom-rendering/src/components/SignInGate/displayRules.ts

Lines changed: 24 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,18 @@ export const hasRequiredConsents = (): Promise<boolean> =>
5858
.then(({ canTarget }: ConsentState) => canTarget)
5959
.catch(() => false);
6060

61+
export const pageMetaDataMakesItEligibleForGateDisplay = (
62+
contentType: string,
63+
sectionId: string | undefined,
64+
tags: TagType[],
65+
): boolean => {
66+
return (
67+
isValidContentType(contentType) &&
68+
isValidSection(sectionId) &&
69+
isValidTag(tags)
70+
);
71+
};
72+
6173
export const canShowSignInGate = ({
6274
isSignedIn,
6375
currentTest,
@@ -66,23 +78,30 @@ export const canShowSignInGate = ({
6678
tags,
6779
isPaidContent,
6880
isPreview,
69-
}: CanShowGateProps): Promise<boolean> =>
70-
Promise.resolve(
81+
}: CanShowGateProps): Promise<boolean> => {
82+
// This check is functionally identical to the same check in SDC
83+
// This logically ensures that SDC will get a subset of the pages for which
84+
// pageMetaDataMakesItEligibleForGateDisplay return true
85+
if (
86+
!pageMetaDataMakesItEligibleForGateDisplay(contentType, sectionId, tags)
87+
) {
88+
return Promise.resolve(false);
89+
}
90+
91+
return Promise.resolve(
7192
!isSignedIn &&
7293
!hasUserDismissedGateMoreThanCount(
7394
currentTest.variant,
7495
currentTest.name,
7596
5,
7697
) &&
7798
isNPageOrHigherPageView(3) &&
78-
isValidContentType(contentType) &&
79-
isValidSection(sectionId) &&
80-
isValidTag(tags) &&
8199
// hide the sign in gate on isPaidContent
82100
!isPaidContent &&
83101
// hide the sign in gate on internal tools preview &&
84102
!isPreview,
85103
);
104+
};
86105

87106
export const canShowSignInGateMandatory: ({
88107
isSignedIn,

0 commit comments

Comments
 (0)