@@ -42,10 +42,17 @@ const footballTablesGridStyles = css`
42
42
}
43
43
` ;
44
44
45
- const CompetitionName = ( { children } : { children : ReactNode } ) => (
45
+ const CompetitionName = ( {
46
+ children,
47
+ hasGroups,
48
+ } : {
49
+ children : ReactNode ;
50
+ hasGroups : boolean ;
51
+ } ) => (
46
52
< h2
47
53
css = { css `
48
54
${ textSansBold14 }
55
+ grid-row : ${ hasGroups ? 2 : 1 } ;
49
56
grid-column : centre-column-start / centre-column-end;
50
57
color : ${ palette ( '--football-competition-text' ) } ;
51
58
border-top : 1px solid ${ palette ( '--football-top-border' ) } ;
@@ -79,6 +86,7 @@ const GroupName = ({
79
86
< h3
80
87
css = { css `
81
88
grid-column : centre-column-start / centre-column-end;
89
+ grid-row : ${ 1 + 3 * index } ;
82
90
padding-top : ${ space [ 1 ] } px;
83
91
padding-bottom : ${ space [ 3 ] } px;
84
92
border-top : 1px solid ${ palette ( '--football-list-border' ) } ;
@@ -102,15 +110,12 @@ export const FootballTableList = ({ competitions, guardianBaseUrl }: Props) => (
102
110
< section key = { competition . name } css = { footballTablesGridStyles } >
103
111
{ competition . tables . map ( ( table , groupIndex ) => (
104
112
< >
105
- { competition . hasGroups && (
106
- < GroupName index = { groupIndex } >
107
- { table . groupName }
108
- </ GroupName >
109
- ) }
110
113
{
111
114
// Only show the competition name above/beside the first group
112
115
groupIndex === 0 && (
113
- < CompetitionName >
116
+ < CompetitionName
117
+ hasGroups = { competition . hasGroups }
118
+ >
114
119
< a
115
120
href = { `${ guardianBaseUrl } ${ competition . url } ` }
116
121
css = { css `
@@ -126,8 +131,16 @@ export const FootballTableList = ({ competitions, guardianBaseUrl }: Props) => (
126
131
</ CompetitionName >
127
132
)
128
133
}
134
+ { competition . hasGroups && (
135
+ < GroupName index = { groupIndex } >
136
+ { table . groupName }
137
+ </ GroupName >
138
+ ) }
129
139
< div
130
140
css = { css `
141
+ grid-row : ${ competition . hasGroups
142
+ ? 3 + 3 * groupIndex
143
+ : 1 } ;
131
144
grid-column : centre-column-start /
132
145
centre-column-end;
133
146
` }
0 commit comments