Skip to content

Commit cfbc6ae

Browse files
committed
hide mostpop ad slot on liveblogs at the leftcol breakpoint
1 parent 052a7a8 commit cfbc6ae

File tree

2 files changed

+52
-36
lines changed

2 files changed

+52
-36
lines changed

dotcom-rendering/src/components/MostViewedFooterLayout.tsx

Lines changed: 51 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -29,38 +29,50 @@ const fixedWidthsPageSkin = css`
2929
}
3030
`;
3131

32-
const advertMargin = (hasHideButton: boolean, isDeeplyRead: boolean) => css`
33-
margin-top: 9px;
34-
${from.desktop} {
35-
margin-top: 0;
36-
margin-left: 10px;
37-
}
38-
${from.leftCol} {
39-
margin-top: 10px;
40-
}
41-
${from.wide} {
42-
margin-left: 16px;
43-
}
44-
${hasHideButton && from.leftCol} {
45-
margin-top: 2px;
46-
}
47-
${hasHideButton && from.wide} {
48-
margin-top: 36px;
49-
}
50-
${hasHideButton && isDeeplyRead && from.desktop} {
32+
const advertMargin = (
33+
hasHideButton: boolean,
34+
isDeeplyRead: boolean,
35+
isLiveblog: boolean,
36+
hasPageskin: boolean,
37+
) => {
38+
if (hasPageskin) {
39+
return css`
40+
margin: 9px 0 0 10px;
41+
`;
42+
}
43+
return css`
5144
margin-top: 9px;
52-
}
53-
${hasHideButton && isDeeplyRead && from.leftCol} {
54-
margin-top: 38px;
55-
}
56-
${hasHideButton && isDeeplyRead && from.wide} {
57-
margin-top: 54px;
58-
}
59-
`;
60-
61-
const advertMarginWithPageSkin = css`
62-
margin: 9px 0 0 10px;
63-
`;
45+
${from.desktop} {
46+
margin-top: 0;
47+
margin-left: 10px;
48+
}
49+
${from.leftCol} {
50+
margin-top: 10px;
51+
}
52+
${from.wide} {
53+
margin-left: 16px;
54+
}
55+
/* Due to the larger left column on liveblogs we hide the ad slot at leftcol to prevent overflow */
56+
${isLiveblog && between.leftCol.and.wide} {
57+
display: none;
58+
}
59+
${hasHideButton && from.leftCol} {
60+
margin-top: 2px;
61+
}
62+
${hasHideButton && from.wide} {
63+
margin-top: 36px;
64+
}
65+
${hasHideButton && isDeeplyRead && from.desktop} {
66+
margin-top: 9px;
67+
}
68+
${hasHideButton && isDeeplyRead && from.leftCol} {
69+
margin-top: 38px;
70+
}
71+
${hasHideButton && isDeeplyRead && from.wide} {
72+
margin-top: 54px;
73+
}
74+
`;
75+
};
6476

6577
const frontStyles = (hasPageSkin: boolean) => css`
6678
${from.wide} {
@@ -89,6 +101,7 @@ type Props = {
89101
isFront?: boolean;
90102
renderAds?: boolean;
91103
isDeeplyRead?: boolean;
104+
isLiveblog?: boolean;
92105
};
93106

94107
export const MostViewedFooterLayout = ({
@@ -97,6 +110,7 @@ export const MostViewedFooterLayout = ({
97110
renderAds,
98111
hasPageSkin = false,
99112
isDeeplyRead = false,
113+
isLiveblog = false,
100114
}: Props) => {
101115
return (
102116
<div
@@ -115,11 +129,12 @@ export const MostViewedFooterLayout = ({
115129
</div>
116130
{renderAds && (
117131
<div
118-
css={
119-
hasPageSkin
120-
? advertMarginWithPageSkin
121-
: advertMargin(!!isFront, isDeeplyRead)
122-
}
132+
css={advertMargin(
133+
!!isFront,
134+
isDeeplyRead,
135+
isLiveblog,
136+
hasPageSkin,
137+
)}
123138
>
124139
<AdSlot position="mostpop" />
125140
</div>

dotcom-rendering/src/layouts/LiveLayout.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1059,6 +1059,7 @@ export const LiveLayout = (props: WebProps | AppsProps) => {
10591059
>
10601060
<MostViewedFooterLayout
10611061
renderAds={isWeb && renderAds}
1062+
isLiveblog={true}
10621063
>
10631064
<Island
10641065
priority="feature"

0 commit comments

Comments
 (0)