Skip to content

Commit b989524

Browse files
committed
Update LeagueTable component with the new data type
1 parent e3ae62d commit b989524

File tree

3 files changed

+8
-11
lines changed

3 files changed

+8
-11
lines changed

dotcom-rendering/src/components/FootballMatchInfo.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,15 @@ import type {
33
FootballMatchStats,
44
FootballMatchTeamWithStats,
55
} from '../footballMatchStats';
6-
import type { FootballTable as FootballTableData } from '../footballTables';
6+
import type { FootballTableSummary } from '../footballTables';
77
import { grid } from '../grid';
88
import { FootballMatchStat } from './FootballMatchStat';
99
import { LeagueTable } from './LeagueTable';
1010
import { Lineups } from './Lineups';
1111

1212
type Props = {
1313
match: FootballMatchStats;
14-
table?: FootballTableData;
14+
table?: FootballTableSummary;
1515
};
1616

1717
function teamHasStats({

dotcom-rendering/src/components/LeagueTable.tsx

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,11 @@ import {
77
textSansBold14,
88
textSansBold15,
99
} from '@guardian/source/foundations';
10-
import type {
11-
Entry,
12-
FootballTable as FootballTableData,
13-
} from '../footballTables';
10+
import type { EntrySummary, FootballTableSummary } from '../footballTables';
1411
import { palette } from '../palette';
1512

1613
type Props = {
17-
table: FootballTableData;
14+
table: FootballTableSummary;
1815
};
1916

2017
export const LeagueTable = ({ table }: Props) => {
@@ -43,7 +40,7 @@ const Title = ({ text }: { text: string }) => (
4340
</h3>
4441
);
4542

46-
const Table = ({ table }: { table: FootballTableData }) => {
43+
const Table = ({ table }: { table: FootballTableSummary }) => {
4744
return (
4845
<table
4946
css={css`
@@ -78,7 +75,7 @@ const Table = ({ table }: { table: FootballTableData }) => {
7875
);
7976
};
8077

81-
const TableRow = ({ entry }: { entry: Entry }) => {
78+
const TableRow = ({ entry }: { entry: EntrySummary }) => {
8279
return (
8380
<tr css={[gridContainer, tableRowStyles]}>
8481
<th scope="row" css={[between('pos', 'team'), position]}>

dotcom-rendering/src/footballTables.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ type Team = {
2828
url?: string;
2929
};
3030

31-
type EntrySummary = {
31+
export type EntrySummary = {
3232
position: number;
3333
team: Team;
3434
gamesPlayed: number;
@@ -41,7 +41,7 @@ type EntrySummary = {
4141
points: number;
4242
};
4343

44-
export type Entry = EntrySummary & {
44+
type Entry = EntrySummary & {
4545
results: TeamResult[];
4646
};
4747

0 commit comments

Comments
 (0)