Add ids for all matches with level and team id
This commit is contained in:
parent
6ecb27ffa7
commit
70655cb1d7
|
|
@ -127,7 +127,7 @@ export class Match extends React.Component {
|
||||||
<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} stageLevel={this.props.stageLevel} borderColor={borderClass}/>
|
||||||
</CardBody>
|
</CardBody>
|
||||||
<span className="badge bg-secondary align-items-center">
|
<span className="badge bg-secondary align-items-center">
|
||||||
{groupInformation}
|
{groupInformation}
|
||||||
|
|
|
||||||
|
|
@ -41,13 +41,16 @@ export function MatchTable(props) {
|
||||||
</tbody>
|
</tbody>
|
||||||
</Table>);
|
</Table>);
|
||||||
} else {
|
} else {
|
||||||
|
const team1Id = `favorite-team-level-${props.stageLevel}-${props.match.team1.id}`;
|
||||||
|
const team2Id = `favorite-team-level-${props.stageLevel}-${props.match.team1.id}`;
|
||||||
|
|
||||||
return (<Table className='mb-0'>
|
return (<Table className='mb-0'>
|
||||||
<tbody>
|
<tbody>
|
||||||
<tr>
|
<tr id={team1Id}>
|
||||||
<th className='stage border-top-0'>{props.match.team1.score}</th>
|
<th className='stage border-top-0'>{props.match.team1.score}</th>
|
||||||
<td className={'border-top-0 ' + team1Class}>{props.match.team1.name}</td>
|
<td className={'border-top-0 ' + team1Class}>{props.match.team1.name}</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr id={team2Id}>
|
||||||
<th className={'stage border-bottom-0 ' + props.borderColor}>{props.match.team2.score}</th>
|
<th className={'stage border-bottom-0 ' + props.borderColor}>{props.match.team2.score}</th>
|
||||||
<td className={'border-bottom-0 ' + props.borderColor + ' ' + team2Class}>
|
<td className={'border-bottom-0 ' + props.borderColor + ' ' + team2Class}>
|
||||||
{props.match.team2.name}
|
{props.match.team2.name}
|
||||||
|
|
|
||||||
|
|
@ -50,7 +50,7 @@ export class PlayoffStages extends Component {
|
||||||
return (<div>
|
return (<div>
|
||||||
{this.props.playoffStages.map(stage => <Stage isSignedIn={this.props.isSignedIn}
|
{this.props.playoffStages.map(stage => <Stage isSignedIn={this.props.isSignedIn}
|
||||||
isOwner={this.props.isOwner} updateNextStage={() => this.updateNextStage(stage.id)}
|
isOwner={this.props.isOwner} updateNextStage={() => this.updateNextStage(stage.id)}
|
||||||
level={getLevelName(stage.level)} matches={stage.matches}
|
level={getLevelName(stage.level)} matches={stage.matches} stageLevel={stage.level}
|
||||||
key={stage.level}/>)}
|
key={stage.level}/>)}
|
||||||
</div>);
|
</div>);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -3,15 +3,22 @@ import {Match} from './Match';
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
|
|
||||||
export function Stage(props) {
|
export function Stage(props) {
|
||||||
const {isSignedIn, isOwner, updateNextStage} = props;
|
const {isSignedIn, isOwner, updateNextStage, stageLevel} = props;
|
||||||
|
|
||||||
return (<div>
|
return (<div>
|
||||||
<Container className='py-5'>
|
<Container className='py-5'>
|
||||||
<h1 className='custom-font'>{props.level}</h1>
|
<h1 className='custom-font'>{props.level}</h1>
|
||||||
<Row>
|
<Row>
|
||||||
{props.matches.map((match => (
|
{props.matches.map((match => (
|
||||||
<Col className='minw-25' key={match.id}><Match match={match} isSignedIn={isSignedIn}
|
<Col className='minw-25' key={match.id}>
|
||||||
isOwner={isOwner} onFinish={updateNextStage}/></Col>)))}
|
<Match
|
||||||
|
match={match}
|
||||||
|
isSignedIn={isSignedIn}
|
||||||
|
isOwner={isOwner}
|
||||||
|
onFinish={updateNextStage}
|
||||||
|
stageLevel={stageLevel}
|
||||||
|
/>
|
||||||
|
</Col>)))}
|
||||||
</Row>
|
</Row>
|
||||||
</Container>
|
</Container>
|
||||||
</div>);
|
</div>);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue