Skip to content

Commit ec5bb26

Browse files
committed
add atom to football matches list
1 parent 977783b commit ec5bb26

File tree

4 files changed

+16
-4
lines changed

4 files changed

+16
-4
lines changed

dotcom-rendering/src/components/FootballMatchesPage.tsx

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import {
66
until,
77
} from '@guardian/source/foundations';
88
import type { FootballMatches } from '../footballMatches';
9+
import type { FootballNavAtom as FootballNavAtomModel } from '../footballNavAtom';
910
import { grid } from '../grid';
1011
import type { EditionId } from '../lib/edition';
1112
import type { Result } from '../lib/result';
@@ -14,6 +15,7 @@ import type { FootballMatchListPageKind, Region } from '../sportDataPage';
1415
import { AdSlot } from './AdSlot.web';
1516
import { FootballCompetitionSelect } from './FootballCompetitionSelect';
1617
import { FootballMatchList } from './FootballMatchList';
18+
import { FootballNavAtom } from './FootballNavAtom';
1719

1820
type Props = {
1921
regions: Region[];
@@ -27,6 +29,7 @@ type Props = {
2729
renderAds: boolean;
2830
pageId: string;
2931
now: string;
32+
navAtom?: FootballNavAtomModel;
3033
};
3134

3235
const createTitle = (kind: FootballMatchListPageKind, edition: EditionId) => {
@@ -56,6 +59,7 @@ export const FootballMatchesPage = ({
5659
getMoreDays,
5760
renderAds,
5861
pageId,
62+
navAtom,
5963
}: Props) => (
6064
<main
6165
id="maincontent"
@@ -81,12 +85,13 @@ export const FootballMatchesPage = ({
8185
padding-bottom: ${space[9]}px;
8286
`}
8387
>
88+
<FootballNavAtom navAtom={navAtom} />
8489
<h1
8590
css={css`
8691
${headlineBold20}
8792
padding: ${space[2]}px 0 ${space[3]}px;
8893
${grid.column.centre}
89-
grid-row: 1;
94+
grid-row: ${navAtom !== undefined ? 2 : 1};
9095
${from.leftCol} {
9196
${grid.between('left-column-start', 'centre-column-end')}
9297
}
@@ -100,7 +105,7 @@ export const FootballMatchesPage = ({
100105
margin-top: ${space[3]}px;
101106
margin-bottom: ${space[6]}px;
102107
${grid.column.centre}
103-
grid-row: 2;
108+
grid-row: ${navAtom !== undefined ? 3 : 2};
104109
`}
105110
>
106111
<FootballCompetitionSelect
@@ -114,7 +119,7 @@ export const FootballMatchesPage = ({
114119
<div
115120
css={css`
116121
${grid.column.centre}
117-
grid-row: 3;
122+
grid-row: ${navAtom !== undefined ? 4 : 3};
118123
${from.leftCol} {
119124
${grid.between('left-column-start', 'centre-column-end')}
120125
}
@@ -137,6 +142,7 @@ export const FootballMatchesPage = ({
137142
${grid.column.right}
138143
/** This allows the ad to grow beyond the third row content (up to line 5) */
139144
grid-row: 1 / 5;
145+
grid-row: ${navAtom !== undefined ? '2 / 6' : '1 / 5'};
140146
${until.desktop} {
141147
display: none;
142148
}

dotcom-rendering/src/components/FootballMatchesPageWrapper.importable.tsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import {
66
getParserErrorMessage,
77
parse,
88
} from '../footballMatches';
9+
import type { FootballNavAtom as FootballNavAtomModel } from '../footballNavAtom';
910
import type { FEFootballMatchListPage } from '../frontend/feFootballMatchListPage';
1011
import type { EditionId } from '../lib/edition';
1112
import type { Result } from '../lib/result';
@@ -72,6 +73,7 @@ type Props = {
7273
edition: EditionId;
7374
renderAds: boolean;
7475
pageId: string;
76+
navAtom?: FootballNavAtomModel;
7577
};
7678

7779
export const FootballMatchesPageWrapper = ({
@@ -86,6 +88,7 @@ export const FootballMatchesPageWrapper = ({
8688
edition,
8789
renderAds,
8890
pageId,
91+
navAtom,
8992
}: Props) => {
9093
const [nextPage, setNextPage] = useState(secondPage);
9194

@@ -108,6 +111,7 @@ export const FootballMatchesPageWrapper = ({
108111
}
109112
renderAds={renderAds}
110113
pageId={pageId}
114+
navAtom={navAtom}
111115
/>
112116
);
113117
};

dotcom-rendering/src/layouts/SportDataPageLayout.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ const SportsPage = ({
4545
edition={sportData.editionId}
4646
renderAds={renderAds}
4747
pageId={sportData.config.pageId}
48+
navAtom={sportData.navAtom}
4849
/>
4950
</Island>
5051
);
@@ -57,6 +58,7 @@ const SportsPage = ({
5758
tableCompetitions={sportData.tables}
5859
renderAds={renderAds}
5960
guardianBaseUrl={sportData.guardianBaseURL}
61+
navAtom={sportData.navAtom}
6062
/>
6163
);
6264
case 'CricketMatch':

dotcom-rendering/src/lib/unifyPageContent.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ export const unifyPageContent = ({
1313
renderingTarget: RenderingTarget;
1414
}): string =>
1515
renderToString(
16-
<html lang="en">
16+
<html lang="en" style={{ overflow: 'hidden' }}>
1717
<head>
1818
<meta charSet="utf-8" />
1919
<meta

0 commit comments

Comments
 (0)