diff --git a/PadelClub/Views/Tournament/Screen/Components/HeadManagerView.swift b/PadelClub/Views/Tournament/Screen/Components/HeadManagerView.swift index 926340a..690340c 100644 --- a/PadelClub/Views/Tournament/Screen/Components/HeadManagerView.swift +++ b/PadelClub/Views/Tournament/Screen/Components/HeadManagerView.swift @@ -25,7 +25,7 @@ struct HeadManagerView: View { Text(RoundRule.roundName(fromRoundIndex: $0)).tag($0) } } label: { - Text("Premier tour") + Text("Tour contenant la meilleure tête de série") } .onChange(of: initialSeedRound) { initialSeedCount = RoundRule.numberOfMatches(forRoundIndex: initialSeedRound) @@ -34,7 +34,7 @@ struct HeadManagerView: View { LabeledContent { StepperView(count: $initialSeedCount, minimum: 0, maximum: RoundRule.numberOfMatches(forRoundIndex: initialSeedRound)) } label: { - Text("Têtes de série") + Text("Nombre de tête de série") } } } diff --git a/PadelClub/Views/Tournament/Screen/Components/TournamentFormatSelectionView.swift b/PadelClub/Views/Tournament/Screen/Components/TournamentFormatSelectionView.swift index 3cc37ea..188e61e 100644 --- a/PadelClub/Views/Tournament/Screen/Components/TournamentFormatSelectionView.swift +++ b/PadelClub/Views/Tournament/Screen/Components/TournamentFormatSelectionView.swift @@ -9,12 +9,25 @@ import SwiftUI import PadelClubData struct TournamentFormatSelectionView: View { + @EnvironmentObject var dataStore: DataStore @Environment(Tournament.self) private var tournament: Tournament - + @State private var globalFormat: MatchFormat = DataStore.shared.user.bracketMatchFormatPreference ?? .nineGamesDecisivePoint + @ViewBuilder var body: some View { @Bindable var tournament = tournament + Section { + MatchTypeSelectionView(selectedFormat: $globalFormat, format: "Tout") + .onChange(of: globalFormat) { oldValue, newValue in + tournament.matchFormat = newValue + tournament.loserBracketMatchFormat = newValue + tournament.groupStageMatchFormat = newValue + } + } footer: { + Text("Modifier le format de tous les types de matchs") + } + Section { MatchTypeSelectionView(selectedFormat: $tournament.groupStageMatchFormat, format: "Poule", additionalEstimationDuration: tournament.additionalEstimationDuration) MatchTypeSelectionView(selectedFormat: $tournament.matchFormat, format: "Tableau", additionalEstimationDuration: tournament.additionalEstimationDuration)