Skip to content

Commit da093f9

Browse files
Merge pull request #15519 from guardian/clean-team-name-match-nav
Switch PA team name Ivory Coast to Côte d’Ivoire
2 parents d2702c3 + 4161882 commit da093f9

3 files changed

Lines changed: 18 additions & 3 deletions

File tree

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

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import { from } from '@guardian/source/foundations';
44
import type { SWRConfiguration } from 'swr';
55
import { ArticleDesign, type ArticleFormat } from '../lib/articleFormat';
66
import { useApi } from '../lib/useApi';
7+
import { cleanTeamName } from '../sportDataPage';
78
import type { TeamType } from '../types/sport';
89
import type { TagType } from '../types/tag';
910
import { ArticleHeadline } from './ArticleHeadline';
@@ -138,11 +139,23 @@ export const GetMatchNav = ({
138139

139140
const isDataValid = validateMatchData(data);
140141
if (isDataValid) {
142+
const cleanedData = {
143+
...data,
144+
homeTeam: {
145+
...data.homeTeam,
146+
name: cleanTeamName(data.homeTeam.name),
147+
},
148+
awayTeam: {
149+
...data.awayTeam,
150+
name: cleanTeamName(data.awayTeam.name),
151+
},
152+
};
153+
141154
return (
142155
<MatchNav
143-
homeTeam={data.homeTeam}
144-
awayTeam={data.awayTeam}
145-
comments={data.comments}
156+
homeTeam={cleanedData.homeTeam}
157+
awayTeam={cleanedData.awayTeam}
158+
comments={cleanedData.comments}
146159
usage="Article"
147160
/>
148161
);

dotcom-rendering/src/footballMatches.test.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,7 @@ describe('footballMatches', () => {
116116
const uncleanToCleanNames: Record<string, string> = {
117117
Ladies: '',
118118
Holland: 'The Netherlands',
119+
'Ivory Coast': 'Côte d’Ivoire',
119120
'Union Saint Gilloise': 'Union Saint-Gilloise',
120121
};
121122

dotcom-rendering/src/sportDataPage.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@ export const cleanTeamName = (teamName: string): string => {
8181
return teamName
8282
.replace('Ladies', '')
8383
.replace('Holland', 'The Netherlands')
84+
.replace('Ivory Coast', 'Côte d’Ivoire')
8485
.replace('Bialystock', 'Białystok')
8586
.replace('Union Saint Gilloise', 'Union Saint-Gilloise');
8687
};

0 commit comments

Comments
 (0)