Merge branch 'mark_advancing_teams'

This commit is contained in:
Daniel Schädler 2025-03-19 15:57:09 +01:00
commit 39d0635afc
4 changed files with 24 additions and 8 deletions

View File

@ -42,4 +42,5 @@ The built container exposes port 80.
# Todo # Todo
Timer in topnav Timer in topnav
showMatches={playoffStages !== null} showmatches in GroupStage mittlerweile vmtl useless weil immer eingeklappt

View File

@ -29,6 +29,7 @@ export default class GroupStage extends Component {
isSignedIn={this.props.isSignedIn} isSignedIn={this.props.isSignedIn}
isOwner={this.props.isOwner} isOwner={this.props.isOwner}
groupRef={this.groupRefs[group.id]} groupRef={this.groupRefs[group.id]}
teams={this.props.teams}
/> />
))} ))}
</Row> </Row>
@ -112,7 +113,7 @@ export class Group extends Component {
/> />
))} ))}
</Collapse> </Collapse>
<GroupScoresTable scores={this.state.scores}/> <GroupScoresTable scores={this.state.scores} teams={this.props.teams}/>
</CardBody> </CardBody>
</Card> </Card>
</Col> </Col>
@ -133,16 +134,25 @@ function GroupScoresTable(props) {
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
{props.scores.map(groupScore => <GroupScoresTableRow score={groupScore} key={groupScore.id}/>)} {props.scores.map(groupScore => (
<GroupScoresTableRow
score={groupScore}
key={groupScore.id}
teams={props.teams}
/>
))}
</tbody> </tbody>
</Table> </Table>
); );
} }
function GroupScoresTableRow(props) { function GroupScoresTableRow(props) {
const advancingTeam = props.teams?.find(team => team.id === props.score.team.id && team.advancing_from_group_stage);
const rowClass = advancingTeam ? 'table-success' : '';
const teamId = `favorite-team-groupstage-${props.score.team.id}`; const teamId = `favorite-team-groupstage-${props.score.team.id}`;
return ( return (
<tr id={teamId}> <tr className={rowClass} id={teamId}>
<td>{props.score.position}</td> <td>{props.score.position}</td>
<td>{props.score.team.name}</td> <td>{props.score.team.name}</td>
<td>{props.score.group_points}</td> <td>{props.score.group_points}</td>

View File

@ -24,7 +24,7 @@ function FullscreenPage(props) {
return (<div> return (<div>
<Container className="fs-5" fluid> <Container className="fs-5" fluid>
<Row className="row-cols-4"> <Row className="row-cols-4">
{props.groups.map(group => <Col className="mb-2"><Group group={group} key={group.id}/></Col>)} {props.groups.map(group => <Col className="mb-2"><Group group={group} key={group.id} teams={props.teams}/></Col>)}
<Col> <Col>
<div className="d-flex justify-content-center align-items-center"> <div className="d-flex justify-content-center align-items-center">
<QRCodeSVG <QRCodeSVG
@ -128,7 +128,7 @@ class Main extends React.Component {
</Head> </Head>
<FullscreenPage <FullscreenPage
tournament={tournament} groups={groups} page={page} maxPage={this.pages} tournament={tournament} groups={groups} page={page} maxPage={this.pages}
showLogo={showLogo} showLogo={showLogo} teams={tournament.teams}
/> />
<style global jsx>{` <style global jsx>{`
body { body {

View File

@ -31,8 +31,13 @@ class PrivateTournamentPage extends React.Component {
<FavoriteBar teams={this.props.tournament.teams}/> <FavoriteBar teams={this.props.tournament.teams}/>
<div className='stages'> <div className='stages'>
{groupStage != null && {groupStage != null &&
<div><GroupStage groups={groupStage.groups} isSignedIn={isSignedIn} isOwner={isOwner} <div><GroupStage
showMatches={playoffStages !== null}/></div>} groups={groupStage.groups}
isSignedIn={isSignedIn}
isOwner={isOwner}
showMatches={playoffStages !== null}
teams={this.props.tournament.teams}
/></div>}
<PlayoffStages playoffStages={playoffStages} isSignedIn={isSignedIn} <PlayoffStages playoffStages={playoffStages} isSignedIn={isSignedIn}
isOwner={isOwner}/> isOwner={isOwner}/>
</div> </div>