update matches

paca_championship
Raz 1 year ago
parent 87e4adf270
commit 41b62a73ae
  1. 11
      PadelClub/Views/Tournament/TournamentRunningView.swift

@ -22,17 +22,22 @@ struct TournamentRunningView: View {
let runningMatches = Tournament.runningMatches(allMatches)
let matchesLeft = Tournament.matchesLeft(allMatches)
let readyMatches = Tournament.readyMatches(allMatches)
let availableToStart = Tournament.availableToStart(allMatches, in: runningMatches, checkCanPlay: true)
Section {
MatchListView(section: "prêt à démarrer", matches: readyMatches, hideWhenEmpty: tournament.hasEnded(), isExpanded: true)
MatchListView(section: "prêt à démarrer", matches: availableToStart, hideWhenEmpty: tournament.hasEnded(), isExpanded: true)
}
Section {
MatchListView(section: "à venir", matches: matchesLeft, hideWhenEmpty: true, isExpanded: false)
MatchListView(section: "à lancer", matches: readyMatches, hideWhenEmpty: tournament.hasEnded(), isExpanded: availableToStart.isEmpty)
}
Section {
MatchListView(section: "à venir", matches: matchesLeft, hideWhenEmpty: true, isExpanded: readyMatches.isEmpty)
}
Section {
MatchListView(section: "en cours", matches: runningMatches, hideWhenEmpty: tournament.hasEnded(), isExpanded: false)
MatchListView(section: "en cours", matches: runningMatches, hideWhenEmpty: tournament.hasEnded(), isExpanded: matchesLeft.isEmpty)
}
Section {

Loading…
Cancel
Save