add format edit in matchdetail view

online_payment
Raz 7 months ago
parent 6b573e4505
commit dde95cae2c
  1. 2
      PadelClub/Views/Match/Components/PlayerBlockView.swift
  2. 12
      PadelClub/Views/Match/MatchDetailView.swift

@ -85,6 +85,7 @@ struct PlayerBlockView: View {
.opacity(0) .opacity(0)
if let team { if let team {
VStack(alignment: .leading) {
if let teamScore, teamScore.luckyLoser != nil, match.isLoserBracket == false { if let teamScore, teamScore.luckyLoser != nil, match.isLoserBracket == false {
Text("Repêchée").italic().font(.caption) Text("Repêchée").italic().font(.caption)
} }
@ -98,7 +99,6 @@ struct PlayerBlockView: View {
Text("Place réservée") Text("Place réservée")
} }
} }
VStack(alignment: .leading) {
ForEach(team.players()) { player in ForEach(team.players()) { player in
Text(player.playerLabel()).lineLimit(1) Text(player.playerLabel()).lineLimit(1)
.italic(player.isHere() == false) .italic(player.isHere() == false)

@ -555,6 +555,18 @@ struct MatchDetailView: View {
_saveMatch() _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") { RowButtonView("Valider") {
match.validateMatch(fromStartDate: startDateSetup == .now ? Date().withoutSeconds() : startDate, toEndDate: endDate, fieldSetup: fieldSetup) match.validateMatch(fromStartDate: startDateSetup == .now ? Date().withoutSeconds() : startDate, toEndDate: endDate, fieldSetup: fieldSetup)

Loading…
Cancel
Save