diff --git a/js/components/GroupStage.js b/js/components/GroupStage.js index ae2d73c..c6cd13a 100644 --- a/js/components/GroupStage.js +++ b/js/components/GroupStage.js @@ -79,10 +79,11 @@ function GroupScoresTable(props) { return ( + + - @@ -94,9 +95,10 @@ function GroupScoresTable(props) { function GroupScoresTableRow(props) { return ( + + - ); } diff --git a/js/redux/tournamentApi.js b/js/redux/tournamentApi.js index a216d1d..7d9576d 100644 --- a/js/redux/tournamentApi.js +++ b/js/redux/tournamentApi.js @@ -34,7 +34,7 @@ export function getTournamentMeta(tournamentId, successCallback, errorCallback) .catch(errorCallback); } -export function getTournamentMatches(tournamentId, successCallback, errorCallback, matchState=null) { +export function getTournamentMatches(tournamentId, successCallback, errorCallback, matchState = null) { let matchFilter = ''; if (matchState) { matchFilter = '?state=' + matchState; @@ -88,16 +88,12 @@ function convertGroup(apiGroup) { id: apiGroup.id, number: apiGroup.number, scores: apiGroup.group_scores.sort((a, b) => { - if (a.group_points > b.group_points) { return -1 } - else if(a.group_points < b.group_points) { return 1 } - else { - if (a.difference_in_points > b.difference_in_points) { return -1 } - else if (a.difference_in_points < b.difference_in_points) { return 1 } - else { - if (a.scored_points > b.scored_points) { return -1 } - else if (a.scored_points < b.scored_points) { return 1 } - else { return 0 } - } + if (a.position > b.position) { + return 1; + } else if (a.position < b.position) { + return -1; + } else { + return 0; } }), matches: apiGroup.matches.sort((a, b) => a.position > b.position).map(match => convertMatch(match, true))
Position Team Pkt.Dif. Gew.Kas.
{props.score.position} {props.score.team.name} {props.score.group_points}{props.score.difference_in_points} {props.score.scored_points}{props.score.received_points}