Skip to content

Commit c4b65a6

Browse files
authored
Reorder the privacy settings link so it appears at the bottom of the final column in the footer. (#14593)
1 parent 165c321 commit c4b65a6

File tree

1 file changed

+20
-17
lines changed

1 file changed

+20
-17
lines changed

dotcom-rendering/src/components/Footer.tsx

Lines changed: 20 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ const footer = css`
4141
`;
4242

4343
const pillarWrap = css`
44-
${clearFix}
44+
${clearFix};
4545
border-left: ${footerBorders};
4646
border-right: ${footerBorders};
4747
padding-top: ${space[2]}px;
@@ -192,7 +192,7 @@ const acknowledgments = css`
192192
const copyright = css`
193193
${textSans12};
194194
padding: ${space[3]}px;
195-
padding-left: 20px;
195+
padding-left: ${space[5]}px;
196196
197197
${until.tablet} {
198198
margin-top: 11px;
@@ -222,7 +222,7 @@ const footerGrid = css`
222222
border: ${footerBorders};
223223
224224
${from.mobileLandscape} {
225-
padding: 0 20px;
225+
padding: 0 ${space[5]}px;
226226
}
227227
`;
228228

@@ -231,7 +231,7 @@ const bttPosition = css`
231231
padding: 0 5px;
232232
position: absolute;
233233
bottom: -21px;
234-
right: 20px;
234+
right: ${space[5]}px;
235235
`;
236236

237237
const FooterLinks = ({
@@ -241,22 +241,10 @@ const FooterLinks = ({
241241
pageFooter: FooterType;
242242
urls: ReaderRevenueCategories;
243243
}) => {
244-
const linkGroups = pageFooter.footerLinks.map((linkGroup) => {
244+
const linkGroups = pageFooter.footerLinks.map((linkGroup, index) => {
245245
const linkList = linkGroup.flatMap(
246246
({ url, extraClasses, dataLinkName, text }) =>
247247
[
248-
dataLinkName === 'privacy' ? (
249-
<li key="privacy-settings-link">
250-
<Island
251-
priority="critical"
252-
defer={{ until: 'visible' }}
253-
>
254-
<PrivacySettingsLink
255-
extraClasses={extraClasses}
256-
/>
257-
</Island>
258-
</li>
259-
) : null,
260248
<li key={url}>
261249
<a
262250
className={extraClasses}
@@ -269,6 +257,21 @@ const FooterLinks = ({
269257
</li>,
270258
].filter(isNonNullable),
271259
);
260+
const privacyClasses = linkGroup.find(
261+
(link) => link.dataLinkName === 'privacy',
262+
)?.extraClasses;
263+
264+
const isFinalColumn = index === pageFooter.footerLinks.length - 1;
265+
266+
if (isFinalColumn) {
267+
linkList.push(
268+
<li key="privacy-settings-link">
269+
<Island priority="critical" defer={{ until: 'visible' }}>
270+
<PrivacySettingsLink extraClasses={privacyClasses} />
271+
</Island>
272+
</li>,
273+
);
274+
}
272275
const key = linkGroup.reduce((acc, { text }) => `${acc}-${text}`, '');
273276
return <ul key={key}>{linkList}</ul>;
274277
});

0 commit comments

Comments
 (0)