Skip to content

Commit 7adbeeb

Browse files
Merge branch 'main' into cc/three-tier-baner-v2
2 parents bc3339b + 23a8130 commit 7adbeeb

15 files changed

+109
-126
lines changed

apps-rendering/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,9 @@
3737
"@babel/core": "7.26.10",
3838
"@babel/preset-env": "7.26.9",
3939
"@creditkarma/thrift-server-core": "1.0.4",
40-
"@emotion/cache": "11.11.0",
41-
"@emotion/jest": "11.11.0",
42-
"@emotion/react": "11.11.3",
40+
"@emotion/cache": "11.14.0",
41+
"@emotion/jest": "11.13.0",
42+
"@emotion/react": "11.14.0",
4343
"@emotion/server": "11.11.0",
4444
"@guardian/apps-rendering-api-models": "11.0.0",
4545
"@guardian/bridget": "7.0.0",

dotcom-rendering/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@
3333
"@braze/web-sdk-core": "3.5.1",
3434
"@creditkarma/thrift-server-core": "1.0.4",
3535
"@emotion/babel-plugin": "11.13.5",
36-
"@emotion/cache": "11.11.0",
37-
"@emotion/react": "11.11.3",
36+
"@emotion/cache": "11.14.0",
37+
"@emotion/react": "11.14.0",
3838
"@emotion/server": "11.11.0",
3939
"@guardian/ab-core": "8.0.0",
4040
"@guardian/braze-components": "22.0.0",
@@ -50,7 +50,7 @@
5050
"@guardian/libs": "22.0.0",
5151
"@guardian/ophan-tracker-js": "2.2.5",
5252
"@guardian/react-crossword": "2.0.2",
53-
"@guardian/react-crossword-next": "npm:@guardian/react-crossword@6.0.0",
53+
"@guardian/react-crossword-next": "npm:@guardian/react-crossword@6.2.0",
5454
"@guardian/shimport": "1.0.2",
5555
"@guardian/source": "9.0.0",
5656
"@guardian/source-development-kitchen": "17.0.0",

dotcom-rendering/src/components/FollowButtons.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
import { css } from '@emotion/react';
2-
import type { EmotionJSX } from '@emotion/react/types/jsx-namespace';
32
import { space, textSans15 } from '@guardian/source/foundations';
43
import {
54
SvgCheckmark,
65
SvgNotificationsOff,
76
SvgNotificationsOn,
87
SvgPlus,
98
} from '@guardian/source/react-components';
9+
import type { ReactNode } from 'react';
1010
import { palette } from '../palette';
1111

1212
type IconProps = {
1313
isFollowing?: boolean;
14-
iconIsFollowing: EmotionJSX.Element;
15-
iconIsNotFollowing: EmotionJSX.Element;
14+
iconIsFollowing: ReactNode;
15+
iconIsNotFollowing: ReactNode;
1616
};
1717

1818
const FollowIcon = ({

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ type Story = StoryObj<typeof meta>;
3434

3535
export const Default = {
3636
args: {
37+
now: '2025-03-24T15:53:12.604Z',
3738
edition: 'UK',
3839
guardianBaseUrl: 'https://www.theguardian.com',
3940
initialDays,

dotcom-rendering/src/components/FootballMatchList.tsx

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ type Props = {
3232
edition: EditionId;
3333
guardianBaseUrl: string;
3434
getMoreDays?: () => Promise<Result<'failed', FootballMatches>>;
35+
now: string;
3536
};
3637

3738
const REMOVE_TRAILING_DOTS_REGEX = /\.+$/;
@@ -221,10 +222,12 @@ const MatchWrapper = ({
221222
children,
222223
}: {
223224
match: FootballMatch;
224-
now: Date;
225+
now: string;
225226
children: ReactNode;
226227
}) => {
227-
if (shouldRenderMatchLink(new Date(match.dateTimeISOString), now)) {
228+
if (
229+
shouldRenderMatchLink(new Date(match.dateTimeISOString), new Date(now))
230+
) {
228231
return (
229232
<li css={matchListItemStyles}>
230233
<a
@@ -260,7 +263,7 @@ const Match = ({
260263
}: {
261264
match: FootballMatch;
262265
timeFormatter: Intl.DateTimeFormat;
263-
now: Date;
266+
now: string;
264267
}) => (
265268
<MatchWrapper match={match} now={now}>
266269
<MatchStatus match={match} timeFormatter={timeFormatter} />
@@ -387,14 +390,13 @@ export const FootballMatchList = ({
387390
guardianBaseUrl,
388391
initialDays,
389392
getMoreDays,
393+
now,
390394
}: Props) => {
391395
const dateFormatter = getDateFormatter(edition);
392396
const timeFormatter = getTimeFormatter(edition);
393397

394398
const [days, setDays] = useState(initialDays);
395399
const [isError, setIsError] = useState<boolean>(false);
396-
const now = new Date();
397-
398400
return (
399401
<>
400402
{days.map((day) => (

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ type Story = StoryObj<typeof meta>;
1313

1414
export const Results = {
1515
args: {
16+
now: '2025-03-24T15:53:12.604Z',
1617
regions,
1718
guardianBaseUrl: 'https://www.theguardian.com',
1819
kind: 'Result',

dotcom-rendering/src/components/FootballMatchesPage.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ type Props = {
2828
getMoreDays?: () => Promise<Result<'failed', FootballMatches>>;
2929
renderAds: boolean;
3030
pageId: string;
31+
now: string;
3132
};
3233

3334
const createTitle = (kind: FootballMatchKind, edition: EditionId) => {
@@ -47,6 +48,7 @@ const createTitle = (kind: FootballMatchKind, edition: EditionId) => {
4748

4849
export const FootballMatchesPage = ({
4950
regions,
51+
now,
5052
guardianBaseUrl,
5153
kind,
5254
initialDays,
@@ -121,6 +123,7 @@ export const FootballMatchesPage = ({
121123
`}
122124
>
123125
<FootballMatchList
126+
now={now}
124127
initialDays={initialDays}
125128
edition={edition}
126129
getMoreDays={getMoreDays}

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ const goToCompetitionSpecificPage =
6363

6464
type Props = {
6565
regions: Region[];
66+
now: string;
6667
guardianBaseUrl: string;
6768
ajaxUrl: string;
6869
kind: FootballMatchKind;
@@ -75,6 +76,7 @@ type Props = {
7576

7677
export const FootballMatchesPageWrapper = ({
7778
regions,
79+
now,
7880
guardianBaseUrl,
7981
ajaxUrl,
8082
kind,
@@ -92,6 +94,7 @@ export const FootballMatchesPageWrapper = ({
9294
guardianBaseUrl={guardianBaseUrl}
9395
kind={kind}
9496
initialDays={initialDays}
97+
now={now}
9598
edition={edition}
9699
goToCompetitionSpecificPage={goToCompetitionSpecificPage(
97100
guardianBaseUrl,

dotcom-rendering/src/components/FootballTableList.tsx

Lines changed: 20 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,17 @@ const footballTablesGridStyles = css`
4242
}
4343
`;
4444

45-
const CompetitionName = ({ children }: { children: ReactNode }) => (
45+
const CompetitionName = ({
46+
children,
47+
hasGroups,
48+
}: {
49+
children: ReactNode;
50+
hasGroups: boolean;
51+
}) => (
4652
<h2
4753
css={css`
4854
${textSansBold14}
55+
grid-row: ${hasGroups ? 2 : 1};
4956
grid-column: centre-column-start / centre-column-end;
5057
color: ${palette('--football-competition-text')};
5158
border-top: 1px solid ${palette('--football-top-border')};
@@ -79,6 +86,7 @@ const GroupName = ({
7986
<h3
8087
css={css`
8188
grid-column: centre-column-start / centre-column-end;
89+
grid-row: ${1 + 3 * index};
8290
padding-top: ${space[1]}px;
8391
padding-bottom: ${space[3]}px;
8492
border-top: 1px solid ${palette('--football-list-border')};
@@ -102,15 +110,12 @@ export const FootballTableList = ({ competitions, guardianBaseUrl }: Props) => (
102110
<section key={competition.name} css={footballTablesGridStyles}>
103111
{competition.tables.map((table, groupIndex) => (
104112
<>
105-
{competition.hasGroups && (
106-
<GroupName index={groupIndex}>
107-
{table.groupName}
108-
</GroupName>
109-
)}
110113
{
111114
// Only show the competition name above/beside the first group
112115
groupIndex === 0 && (
113-
<CompetitionName>
116+
<CompetitionName
117+
hasGroups={competition.hasGroups}
118+
>
114119
<a
115120
href={`${guardianBaseUrl}${competition.url}`}
116121
css={css`
@@ -126,8 +131,16 @@ export const FootballTableList = ({ competitions, guardianBaseUrl }: Props) => (
126131
</CompetitionName>
127132
)
128133
}
134+
{competition.hasGroups && (
135+
<GroupName index={groupIndex}>
136+
{table.groupName}
137+
</GroupName>
138+
)}
129139
<div
130140
css={css`
141+
grid-row: ${competition.hasGroups
142+
? 3 + 3 * groupIndex
143+
: 1};
131144
grid-column: centre-column-start /
132145
centre-column-end;
133146
`}

dotcom-rendering/src/components/marketing/lib/ReactComponent.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* This file was migrated from:
44
* https://github.com/guardian/support-dotcom-components/blob/9c3eae7cb0b159db4a1c40679d6b37710b0bb937/packages/modules/src/types.ts#L12
55
*/
6-
import type { EmotionJSX } from '@emotion/react/types/jsx-namespace';
6+
import type { ReactNode } from 'react';
77

88
// This type can be used in place of React.FC<T> which was previously widespread
99
// in this codebase but is no longer recommended. In many cases it's possible to
@@ -17,4 +17,4 @@ import type { EmotionJSX } from '@emotion/react/types/jsx-namespace';
1717

1818
export type ReactComponent<GenericProps = Record<string, never>> = (
1919
props: GenericProps,
20-
) => EmotionJSX.Element;
20+
) => ReactNode;

0 commit comments

Comments
 (0)