From 5184d63738a12d53a747514a55d5ea8c7fed49dd Mon Sep 17 00:00:00 2001 From: Malaber Date: Fri, 14 Mar 2025 14:45:30 +0100 Subject: [PATCH 01/48] Mark advancing teams with success background --- js/components/GroupStage.js | 68 ++++++++++++++++++--------- js/redux/tournamentApi.js | 3 +- pages/tournament-fullscreen-groups.js | 12 ++--- pages/tournament.js | 9 +++- 4 files changed, 62 insertions(+), 30 deletions(-) diff --git a/js/components/GroupStage.js b/js/components/GroupStage.js index 17b45ed..0f25889 100644 --- a/js/components/GroupStage.js +++ b/js/components/GroupStage.js @@ -23,8 +23,16 @@ export default class GroupStage extends Component { - {this.props.groups.map(group => )} + {this.props.groups.map(group => ( + + ))} ); } @@ -64,11 +72,17 @@ export class Group extends Component {

Gruppe {this.state.number}

- {this.state.matches.sort(sortMatchesByPositionAscending()).map((match => ( - )))} + {this.state.matches.sort(sortMatchesByPositionAscending()).map(match => ( + + ))} - +
); @@ -76,8 +90,9 @@ export class Group extends Component { } function GroupScoresTable(props) { - return ( - + return ( +
+ @@ -85,20 +100,31 @@ function GroupScoresTable(props) { - - - {props.scores.map(groupScore => )} - -
# TeamDif. Gew.
); + + + {props.scores.map(groupScore => ( + + ))} + + + ); } - function GroupScoresTableRow(props) { - return ( - {props.score.position} - {props.score.team.name} - {props.score.group_points} - {props.score.difference_in_points} - {props.score.scored_points} - ); + const advancingTeam = props.teams?.find(team => team.id === props.score.team.id && team.advancing_from_group_stage); + const rowClass = advancingTeam ? 'table-success' : ''; + + return ( + + {props.score.position} + {props.score.team.name} + {props.score.group_points} + {props.score.difference_in_points} + {props.score.scored_points} + + ); } diff --git a/js/redux/tournamentApi.js b/js/redux/tournamentApi.js index 7d9576d..2bca5cb 100644 --- a/js/redux/tournamentApi.js +++ b/js/redux/tournamentApi.js @@ -67,7 +67,8 @@ function convertTournament(apiTournament) { isPublic: apiTournament.public, ownerUsername: apiTournament.owner_username, groupStage: groupStage, - playoffStages: playoffStages + playoffStages: playoffStages, + teams: apiTournament.teams }; } diff --git a/pages/tournament-fullscreen-groups.js b/pages/tournament-fullscreen-groups.js index 4799756..f747e02 100644 --- a/pages/tournament-fullscreen-groups.js +++ b/pages/tournament-fullscreen-groups.js @@ -14,17 +14,17 @@ function FullscreenPage(props) { let logo; if (props.showLogo) { logo = -
- -
- ; +
+ +
+ ; } else { logo =
; } return (
- {props.groups.map(group => )} + {props.groups.map(group => )}