Render group information per match
This commit is contained in:
parent
3c4a77bbeb
commit
c12ca27ac9
|
|
@ -118,13 +118,21 @@ export class Match extends React.Component {
|
||||||
smallMessage = 'Spiel kann gestartet werden';
|
smallMessage = 'Spiel kann gestartet werden';
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const groupInformation = this.state.match.group ?
|
||||||
|
<div className="mb-2 mt-2">Gr. {this.state.match.group.number}</div> :
|
||||||
|
'';
|
||||||
|
|
||||||
return (<div className='mb-3'>
|
return (<div className='mb-3'>
|
||||||
<Card className={'shadow-sm match '} onClick={this.toggleModal}>
|
<Card className={'shadow-sm match '} onClick={this.toggleModal}>
|
||||||
<div className="d-flex flex-row">
|
<div className="d-flex flex-row">
|
||||||
<CardBody className={borderClass + ' border py-2 ' + cardClass + ' ' + styles.match_bg}>
|
<CardBody className={borderClass + ' border py-2 ' + cardClass + ' ' + styles.match_bg}>
|
||||||
<MatchTable match={this.state.match} borderColor={borderClass}/>
|
<MatchTable match={this.state.match} borderColor={borderClass}/>
|
||||||
</CardBody>
|
</CardBody>
|
||||||
<span className="badge bg-secondary align-items-center">{this.state.match.position}</span>
|
<span className="badge bg-secondary align-items-center">
|
||||||
|
{groupInformation}
|
||||||
|
<div className="mb-2 mt-2">Sp. {this.state.match.position}</div>
|
||||||
|
</span>
|
||||||
</div>
|
</div>
|
||||||
</Card>
|
</Card>
|
||||||
<small className='text-muted'>{smallMessage}</small>
|
<small className='text-muted'>{smallMessage}</small>
|
||||||
|
|
|
||||||
|
|
@ -110,7 +110,8 @@ function convertMatch(apiMatch, allowUndecided) {
|
||||||
state: apiMatch.state,
|
state: apiMatch.state,
|
||||||
allowUndecided: allowUndecided,
|
allowUndecided: allowUndecided,
|
||||||
winnerTeamId: apiMatch.winner === null ? null : apiMatch.winner.id,
|
winnerTeamId: apiMatch.winner === null ? null : apiMatch.winner.id,
|
||||||
position: apiMatch.position + 1
|
position: apiMatch.position + 1,
|
||||||
|
group: apiMatch.group ? {id: apiMatch.group.id, number: apiMatch.group.number} : null
|
||||||
};
|
};
|
||||||
|
|
||||||
if (apiMatch.match_scores.length === 2) {
|
if (apiMatch.match_scores.length === 2) {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue