diff --git a/PadelClub/Views/Match/Components/PlayerBlockView.swift b/PadelClub/Views/Match/Components/PlayerBlockView.swift index 5e9d2b3..7db8925 100644 --- a/PadelClub/Views/Match/Components/PlayerBlockView.swift +++ b/PadelClub/Views/Match/Components/PlayerBlockView.swift @@ -85,20 +85,20 @@ struct PlayerBlockView: View { .opacity(0) if let team { - if let teamScore, teamScore.luckyLoser != nil, match.isLoserBracket == false { - Text("Repêchée").italic().font(.caption) - } + VStack(alignment: .leading) { + if let teamScore, teamScore.luckyLoser != nil, match.isLoserBracket == false { + Text("Repêchée").italic().font(.caption) + } - if let teamName = team.name { - Text(teamName).foregroundStyle(.secondary).font(.footnote) - } else if team.players().isEmpty { - if team.isWildCard() { - Text("Place réservée wildcard") - } else { - Text("Place réservée") + if let teamName = team.name { + Text(teamName).foregroundStyle(.secondary).font(.footnote) + } else if team.players().isEmpty { + if team.isWildCard() { + Text("Place réservée wildcard") + } else { + Text("Place réservée") + } } - } - VStack(alignment: .leading) { ForEach(team.players()) { player in Text(player.playerLabel()).lineLimit(1) .italic(player.isHere() == false) diff --git a/PadelClub/Views/Match/MatchDetailView.swift b/PadelClub/Views/Match/MatchDetailView.swift index 0b49a01..e172b21 100644 --- a/PadelClub/Views/Match/MatchDetailView.swift +++ b/PadelClub/Views/Match/MatchDetailView.swift @@ -555,6 +555,18 @@ struct MatchDetailView: View { _saveMatch() } + @Bindable var bindableMatch = match + Picker(selection: $bindableMatch.matchFormat) { + ForEach(MatchFormat.allCases) { format in + MatchFormatRowView(matchFormat: format, additionalEstimationDuration: match.currentTournament()?.additionalEstimationDuration).tag(format) + } + } label: { + Text("Format") + } + .onChange(of: match.matchFormat) { + _saveMatch() + } + RowButtonView("Valider") { match.validateMatch(fromStartDate: startDateSetup == .now ? Date().withoutSeconds() : startDate, toEndDate: endDate, fieldSetup: fieldSetup)