Skip to content

Commit 75dfef3

Browse files
authored
Merge pull request #14510 from guardian/dina/rollout-topAboveNav250Reservation
Rollout the `top-above-nav` 250px reservation
2 parents 9695fe3 + 94eae85 commit 75dfef3

17 files changed

+20
-102
lines changed

dotcom-rendering/fixtures/generated/cricket-match.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1871,7 +1871,6 @@ export const cricketMatchData: FECricketMatchPage = {
18711871
idCookieRefresh: true,
18721872
discussionPageSize: true,
18731873
smartAppBanner: false,
1874-
topAboveNav250Reservation: true,
18751874
historyTags: true,
18761875
brazeContentCards: true,
18771876
remoteBanner: true,

dotcom-rendering/src/components/AdSlot.web.tsx

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,6 @@ type DefaultProps = {
4747
display?: ArticleDisplay;
4848
isPaidContent?: boolean;
4949
hasPageskin?: boolean;
50-
isIn250ReservationVariant?: boolean;
5150
};
5251

5352
// for dark ad labels
@@ -115,14 +114,6 @@ const topAboveNavContainerStyles = css`
115114
margin: 0 auto;
116115
text-align: left;
117116
display: block;
118-
`;
119-
120-
const topAboveNavContainerVariantStyles = css`
121-
padding-bottom: ${space[5]}px;
122-
position: relative;
123-
margin: 0 auto;
124-
text-align: left;
125-
display: block;
126117
width: 100%;
127118
min-height: ${containerMinHeight}px;
128119
@@ -475,7 +466,6 @@ export const AdSlot = ({
475466
isPaidContent = false,
476467
index,
477468
hasPageskin = false,
478-
isIn250ReservationVariant,
479469
}: Props) => {
480470
switch (position) {
481471
case 'right':
@@ -641,13 +631,7 @@ export const AdSlot = ({
641631
}
642632
case 'top-above-nav': {
643633
return (
644-
<AdSlotWrapper
645-
css={
646-
isIn250ReservationVariant
647-
? topAboveNavContainerVariantStyles
648-
: topAboveNavContainerStyles
649-
}
650-
>
634+
<AdSlotWrapper css={topAboveNavContainerStyles}>
651635
<div
652636
id="dfp-ad--top-above-nav"
653637
className={[

dotcom-rendering/src/components/HeaderAdSlot.tsx

Lines changed: 4 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,13 @@
11
import { css, Global } from '@emotion/react';
2-
import { adSizes, constants } from '@guardian/commercial-core';
3-
import { space } from '@guardian/source/foundations';
42
import { palette } from '../palette';
5-
import type { ServerSideTests } from '../types/config';
63
import { AdSlot } from './AdSlot.web';
74
import { Hide } from './Hide';
85

96
const headerWrapper = css`
107
position: static;
118
`;
129

13-
const { TOP_ABOVE_NAV_HEIGHT, AD_LABEL_HEIGHT } = constants;
14-
15-
const padding = space[4] + 2; // 18px - currently being reviewed
16-
const borderBottomHeight = 1;
17-
const headerMinHeight =
18-
TOP_ABOVE_NAV_HEIGHT + padding + AD_LABEL_HEIGHT + borderBottomHeight;
19-
20-
const headerAdWrapperStylesVariant = css`
10+
const headerAdWrapperStyles = css`
2111
z-index: 1080;
2212
width: 100%;
2313
background-color: ${palette('--ad-background')};
@@ -31,32 +21,7 @@ const headerAdWrapperStylesVariant = css`
3121
top: 0;
3222
`;
3323

34-
const headerAdWrapperStylesControl = css`
35-
z-index: 1080;
36-
width: 100%;
37-
background-color: ${palette('--ad-background')};
38-
min-height: ${headerMinHeight}px;
39-
border-bottom: 1px solid ${palette('--ad-border')};
40-
41-
display: flex;
42-
flex-direction: column;
43-
justify-content: center;
44-
45-
position: sticky;
46-
top: 0;
47-
`;
48-
49-
/**
50-
* Ensure the top-above-nav/ad-block-ask containing div is always of a certain minimum height
51-
*/
52-
const headerMinSizeStyles = css`
53-
min-height: ${adSizes.leaderboard.height}px;
54-
min-width: ${adSizes.leaderboard.width}px;
55-
`;
56-
57-
export const HeaderAdSlot = ({ abTests }: { abTests: ServerSideTests }) => {
58-
const isIn250ReservationVariant =
59-
abTests.topAboveNav250ReservationVariant === 'variant';
24+
export const HeaderAdSlot = () => {
6025
return (
6126
<div css={headerWrapper}>
6227
<Global
@@ -74,23 +39,10 @@ export const HeaderAdSlot = ({ abTests }: { abTests: ServerSideTests }) => {
7439
/>
7540
<Hide when="below" breakpoint="tablet">
7641
<div
77-
css={[
78-
isIn250ReservationVariant
79-
? headerAdWrapperStylesVariant
80-
: headerAdWrapperStylesControl,
81-
]}
42+
css={headerAdWrapperStyles}
8243
className="top-banner-ad-container"
8344
>
84-
<div
85-
css={!isIn250ReservationVariant && headerMinSizeStyles}
86-
>
87-
<AdSlot
88-
position="top-above-nav"
89-
isIn250ReservationVariant={
90-
isIn250ReservationVariant
91-
}
92-
/>
93-
</div>
45+
<AdSlot position="top-above-nav" />
9446
</div>
9547
</Hide>
9648
</div>

dotcom-rendering/src/layouts/AudioLayout.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ export const AudioLayout = (props: WebProps) => {
168168
padSides={false}
169169
shouldCenter={false}
170170
>
171-
<HeaderAdSlot abTests={article.config.abTests} />
171+
<HeaderAdSlot />
172172
</Section>
173173
</Stuck>
174174
)}

dotcom-rendering/src/layouts/CommentLayout.tsx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -318,9 +318,7 @@ export const CommentLayout = (props: WebProps | AppsProps) => {
318318
padSides={false}
319319
shouldCenter={false}
320320
>
321-
<HeaderAdSlot
322-
abTests={article.config.abTests}
323-
/>
321+
<HeaderAdSlot />
324322
</Section>
325323
</Stuck>
326324
)}

dotcom-rendering/src/layouts/CrosswordLayout.tsx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -138,9 +138,7 @@ export const CrosswordLayout = (props: Props) => {
138138
padSides={false}
139139
shouldCenter={false}
140140
>
141-
<HeaderAdSlot
142-
abTests={article.config.abTests}
143-
/>
141+
<HeaderAdSlot />
144142
</Section>
145143
</div>
146144
</Stuck>

dotcom-rendering/src/layouts/FrontLayout.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ export const FrontLayout = ({ front, NAV }: Props) => {
198198
'--article-section-background',
199199
)}
200200
>
201-
<HeaderAdSlot abTests={abTests} />
201+
<HeaderAdSlot />
202202
</Section>
203203
</Stuck>
204204
)}

dotcom-rendering/src/layouts/FullPageInteractiveLayout.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ const NavHeader = ({ article, NAV, renderAds }: HeaderProps) => {
162162
shouldCenter={false}
163163
element="aside"
164164
>
165-
<HeaderAdSlot abTests={article.config.abTests} />
165+
<HeaderAdSlot />
166166
</Section>
167167
</div>
168168
</Stuck>

dotcom-rendering/src/layouts/GalleryLayout.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,6 @@ export const GalleryLayout = (props: WebProps | AppProps) => {
144144

145145
const {
146146
config: {
147-
abTests,
148147
idUrl,
149148
mmaUrl,
150149
discussionApiUrl,
@@ -195,7 +194,7 @@ export const GalleryLayout = (props: WebProps | AppProps) => {
195194
padSides={false}
196195
shouldCenter={false}
197196
>
198-
<HeaderAdSlot abTests={abTests} />
197+
<HeaderAdSlot />
199198
</Section>
200199
</Stuck>
201200
)}

dotcom-rendering/src/layouts/InteractiveLayout.tsx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -272,9 +272,7 @@ export const InteractiveLayout = (props: WebProps | AppsProps) => {
272272
padSides={false}
273273
shouldCenter={false}
274274
>
275-
<HeaderAdSlot
276-
abTests={article.config.abTests}
277-
/>
275+
<HeaderAdSlot />
278276
</Section>
279277
</div>
280278
</Stuck>

0 commit comments

Comments
 (0)