Skip to content

Commit 2e67137

Browse files
Merge branch 'main' into lp-add-annual-discount
2 parents cc859af + a2cc3bb commit 2e67137

31 files changed

+457
-290
lines changed

dotcom-rendering/fixtures/manual/footballData.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import type { Region } from '../../src/footballDataPage';
21
import type { FootballMatches } from '../../src/footballMatches';
2+
import type { Region } from '../../src/sportDataPage';
33

44
export const regions: Region[] = [
55
{
Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
import { css } from '@emotion/react';
2+
import { from, headlineBold20, space } from '@guardian/source/foundations';
3+
import type { CricketMatch } from '../cricketMatch';
4+
import { grid } from '../grid';
5+
import { palette } from '../palette';
6+
import { CricketScorecard } from './CricketScorecard';
7+
8+
type Props = {
9+
match: CricketMatch;
10+
guardianBaseUrl: string;
11+
};
12+
13+
export const CricketScorecardPage = ({ match, guardianBaseUrl }: Props) => (
14+
<main
15+
id="maincontent"
16+
data-layout="CricketMatchPageLayout"
17+
css={css`
18+
${grid.paddedContainer}
19+
position: relative;
20+
${from.tablet} {
21+
&::before,
22+
&::after {
23+
content: '';
24+
position: absolute;
25+
border-left: 1px solid ${palette('--article-border')};
26+
top: 0;
27+
bottom: 0;
28+
}
29+
30+
&::after {
31+
right: 0;
32+
}
33+
}
34+
35+
padding-bottom: ${space[9]}px;
36+
`}
37+
>
38+
<h1
39+
css={css`
40+
${headlineBold20}
41+
padding: ${space[2]}px 0 ${space[3]}px;
42+
${grid.column.centre}
43+
grid-row: 1;
44+
${from.leftCol} {
45+
${grid.between('left-column-start', 'centre-column-end')}
46+
}
47+
color: ${palette('--sport-competition-text')};
48+
`}
49+
>
50+
<a
51+
href={`${guardianBaseUrl}/sport/cricket`}
52+
css={css`
53+
text-decoration: none;
54+
color: inherit;
55+
:hover {
56+
text-decoration: underline;
57+
}
58+
`}
59+
>
60+
Cricket
61+
</a>
62+
</h1>
63+
<div
64+
css={css`
65+
${grid.column.centre}
66+
grid-row: 2;
67+
${from.leftCol} {
68+
${grid.between('left-column-start', 'centre-column-end')}
69+
}
70+
position: relative;
71+
`}
72+
>
73+
<CricketScorecard
74+
allInnings={match.innings}
75+
officials={match.officials}
76+
homeTeam={match.homeTeam}
77+
awayTeam={match.awayTeam}
78+
/>
79+
</div>
80+
</main>
81+
);

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ type Story = StoryObj<typeof meta>;
2222
export const FootballCompetitionSelect = {
2323
args: {
2424
regions,
25-
kind: 'Result',
25+
kind: 'FootballResults',
2626
pageId: 'football/live',
2727
onChange: fn(),
2828
},

dotcom-rendering/src/components/FootballCompetitionSelect.tsx

Lines changed: 12 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,36 @@
11
import { Option, Select } from '@guardian/source/react-components';
2-
import type { Region } from '../footballDataPage';
3-
import type { FootballMatchKind } from '../footballMatches';
42
import { palette } from '../palette';
5-
6-
type FootballSelectKind = FootballMatchKind | 'Tables';
3+
import type { FootballPageKind, Region } from '../sportDataPage';
74

85
type Props = {
96
regions: Region[];
10-
kind: FootballSelectKind;
7+
kind: FootballPageKind;
118
pageId: string;
129
onChange: (competitionTag: string) => void;
1310
};
1411

15-
const allLabel = (kind: FootballSelectKind): string => {
12+
const allLabel = (kind: FootballPageKind): string => {
1613
switch (kind) {
17-
case 'Fixture':
14+
case 'FootballFixtures':
1815
return 'All fixtures';
19-
case 'Result':
16+
case 'FootballResults':
2017
return 'All results';
21-
case 'Live':
18+
case 'FootballLiveScores':
2219
return 'All live';
23-
case 'Tables':
20+
case 'FootballTables':
2421
return 'All tables';
2522
}
2623
};
2724

28-
const getPagePath = (kind: FootballSelectKind) => {
25+
const getPagePath = (kind: FootballPageKind) => {
2926
switch (kind) {
30-
case 'Fixture':
27+
case 'FootballFixtures':
3128
return '/football/fixtures';
32-
case 'Live':
29+
case 'FootballLiveScores':
3330
return '/football/live';
34-
case 'Result':
31+
case 'FootballResults':
3532
return '/football/results';
36-
case 'Tables':
33+
case 'FootballTables':
3734
return '/football/tables';
3835
}
3936
};

dotcom-rendering/src/components/FootballMatchList.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ const CompetitionName = (props: { children: ReactNode }) => (
109109
css={css`
110110
${textSansBold14}
111111
grid-column: centre-column-start / centre-column-end;
112-
color: ${palette('--football-competition-text')};
112+
color: ${palette('--sport-competition-text')};
113113
border-top: 1px solid ${palette('--sport-top-border')};
114114
padding: ${space[2]}px;
115115
background-color: ${palette('--sport-list-background')};

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ export const Results = {
1616
now: '2025-03-24T15:53:12.604Z',
1717
regions,
1818
guardianBaseUrl: 'https://www.theguardian.com',
19-
kind: 'Result',
19+
kind: 'FootballResults',
2020
initialDays,
2121
edition: 'UK',
2222
goToCompetitionSpecificPage: fn(),
@@ -28,13 +28,13 @@ export const Results = {
2828
export const LiveScores = {
2929
args: {
3030
...Results.args,
31-
kind: 'Live',
31+
kind: 'FootballLiveScores',
3232
},
3333
} satisfies Story;
3434

3535
export const Fixtures = {
3636
args: {
3737
...Results.args,
38-
kind: 'Fixture',
38+
kind: 'FootballFixtures',
3939
},
4040
} satisfies Story;

dotcom-rendering/src/components/FootballMatchesPage.tsx

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,20 +5,20 @@ import {
55
space,
66
until,
77
} from '@guardian/source/foundations';
8-
import type { Region } from '../footballDataPage';
9-
import type { FootballMatches, FootballMatchKind } from '../footballMatches';
8+
import type { FootballMatches } from '../footballMatches';
109
import { grid } from '../grid';
1110
import type { EditionId } from '../lib/edition';
1211
import type { Result } from '../lib/result';
1312
import { palette } from '../palette';
13+
import type { FootballMatchListPageKind, Region } from '../sportDataPage';
1414
import { AdSlot } from './AdSlot.web';
1515
import { FootballCompetitionSelect } from './FootballCompetitionSelect';
1616
import { FootballMatchList } from './FootballMatchList';
1717

1818
type Props = {
1919
regions: Region[];
2020
guardianBaseUrl: string;
21-
kind: FootballMatchKind;
21+
kind: FootballMatchListPageKind;
2222
initialDays: FootballMatches;
2323
edition: EditionId;
2424
goToCompetitionSpecificPage: (tag: string) => void;
@@ -28,17 +28,17 @@ type Props = {
2828
now: string;
2929
};
3030

31-
const createTitle = (kind: FootballMatchKind, edition: EditionId) => {
32-
if (edition === 'US' && kind === 'Fixture') {
31+
const createTitle = (kind: FootballMatchListPageKind, edition: EditionId) => {
32+
if (edition === 'US' && kind === 'FootballFixtures') {
3333
return 'Soccer schedules';
3434
}
3535

3636
switch (kind) {
37-
case 'Fixture':
37+
case 'FootballFixtures':
3838
return 'Football fixtures';
39-
case 'Live':
39+
case 'FootballLiveScores':
4040
return 'Live football scores';
41-
case 'Result':
41+
case 'FootballResults':
4242
return 'Football results';
4343
}
4444
};

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

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,16 @@
11
import { isObject, isUndefined } from '@guardian/libs';
22
import type { Dispatch, SetStateAction } from 'react';
33
import { useState } from 'react';
4-
import type { Region } from '../footballDataPage';
54
import {
65
type FootballMatches,
7-
type FootballMatchKind,
86
getParserErrorMessage,
97
parse,
108
} from '../footballMatches';
119
import type { FEFootballMatchListPage } from '../frontend/feFootballMatchListPage';
1210
import type { EditionId } from '../lib/edition';
1311
import type { Result } from '../lib/result';
1412
import { error, ok } from '../lib/result';
13+
import type { FootballMatchListPageKind, Region } from '../sportDataPage';
1514
import { FootballMatchesPage } from './FootballMatchesPage';
1615

1716
export const getMoreDays =
@@ -66,7 +65,7 @@ type Props = {
6665
now: string;
6766
guardianBaseUrl: string;
6867
ajaxUrl: string;
69-
kind: FootballMatchKind;
68+
kind: FootballMatchListPageKind;
7069
initialDays: FootballMatches;
7170
secondPage?: string;
7271
edition: EditionId;

dotcom-rendering/src/components/FootballTable.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ const hideUntilTabletStyle = css`
5353

5454
const linkStyles = css`
5555
text-decoration: none;
56-
color: ${palette('--football-competition-text')};
56+
color: ${palette('--sport-competition-text')};
5757
:hover {
5858
text-decoration: underline;
5959
}

dotcom-rendering/src/components/FootballTableList.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,15 +70,15 @@ const CompetitionName = ({
7070
${textSansBold14}
7171
grid-row: ${hasGroups ? 2 : 1};
7272
grid-column: centre-column-start / centre-column-end;
73-
color: ${palette('--football-competition-text')};
73+
color: ${palette('--sport-competition-text')};
7474
border-top: 1px solid ${palette('--sport-top-border')};
7575
padding: ${space[2]}px;
7676
background-color: ${palette('--sport-list-background')};
7777
7878
${from.leftCol} {
7979
grid-row: 1;
8080
display: block;
81-
color: ${palette('--football-competition-text')};
81+
color: ${palette('--sport-competition-text')};
8282
border-top: 1px solid ${palette('--sport-list-border')};
8383
background-color: transparent;
8484
margin-top: 0;

0 commit comments

Comments
 (0)