Make code for MatchTable in tournament view more readable (fFix react error message)
This commit is contained in:
parent
b30971385f
commit
115df26572
|
|
@ -145,7 +145,7 @@ function MatchModal(props) {
|
||||||
switch (props.match.state) {
|
switch (props.match.state) {
|
||||||
case 'in_progress':
|
case 'in_progress':
|
||||||
title = 'Spiel läuft';
|
title = 'Spiel läuft';
|
||||||
actionButton = <Button color='primary' onClick={props.toggle}>Spiel beenden</Button>
|
actionButton = <Button color='primary' onClick={props.toggle}>Spiel beenden</Button>;
|
||||||
break;
|
break;
|
||||||
case 'team1_won':
|
case 'team1_won':
|
||||||
title = 'Spiel beendet';
|
title = 'Spiel beendet';
|
||||||
|
|
@ -206,22 +206,35 @@ function MatchTable(props) {
|
||||||
case 'undecided':
|
case 'undecided':
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
return (
|
if(props.match.state === 'single_team'){
|
||||||
<Table className='mb-0'>
|
return (
|
||||||
<tbody>
|
<Table className='mb-0'>
|
||||||
<tr>
|
<tbody>
|
||||||
{props.match.state !== 'single_team' ?
|
<tr>
|
||||||
<th className='stage border-top-0'>{props.match.scoreTeam1}</th> : ''}
|
<td className={'border-top-0 ' + team1Class}>{props.match.team1}</td>
|
||||||
<td className={'border-top-0 ' + team1Class}>{props.match.team1}</td>
|
</tr>
|
||||||
</tr>
|
<tr>
|
||||||
<tr>
|
<td className={team2Class}>kein Gegner</td>
|
||||||
{props.match.state !== 'single_team' ?
|
</tr>
|
||||||
<th className='stage'>{props.match.scoreTeam2}</th> : ''}
|
</tbody>
|
||||||
<td className={team2Class}>{props.match.state === 'single_team' ? 'kein Gegner' : props.match.team2}</td>
|
</Table>
|
||||||
</tr>
|
)
|
||||||
</tbody>
|
}else{
|
||||||
</Table>
|
return (
|
||||||
)
|
<Table className='mb-0'>
|
||||||
|
<tbody>
|
||||||
|
<tr>
|
||||||
|
<th className='stage border-top-0'>{props.match.scoreTeam1}</th>
|
||||||
|
<td className={'border-top-0 ' + team1Class}>{props.match.team1}</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<th className='stage'>{props.match.scoreTeam2}</th>
|
||||||
|
<td className={team2Class}>{props.match.team2}</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</Table>
|
||||||
|
)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function EditableMatchTable(props) {
|
function EditableMatchTable(props) {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue