|
|
|
@ -10,12 +10,11 @@ import LeStorage |
|
|
|
|
|
|
|
|
|
|
|
struct TournamentStatusView: View { |
|
|
|
struct TournamentStatusView: View { |
|
|
|
@Environment(\.dismiss) private var dismiss |
|
|
|
@Environment(\.dismiss) private var dismiss |
|
|
|
@Environment(Tournament.self) private var tournament: Tournament |
|
|
|
|
|
|
|
@Environment(NavigationViewModel.self) private var navigation: NavigationViewModel |
|
|
|
@Environment(NavigationViewModel.self) private var navigation: NavigationViewModel |
|
|
|
@EnvironmentObject var dataStore: DataStore |
|
|
|
@EnvironmentObject var dataStore: DataStore |
|
|
|
|
|
|
|
@Bindable var tournament: Tournament |
|
|
|
|
|
|
|
|
|
|
|
var body: some View { |
|
|
|
var body: some View { |
|
|
|
@Bindable var tournament = tournament |
|
|
|
|
|
|
|
Form { |
|
|
|
Form { |
|
|
|
#if DEBUG |
|
|
|
#if DEBUG |
|
|
|
RowButtonView("debug: Un-delete le tournoi") { |
|
|
|
RowButtonView("debug: Un-delete le tournoi") { |
|
|
|
@ -86,19 +85,20 @@ struct TournamentStatusView: View { |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
Section { |
|
|
|
// Section { |
|
|
|
Toggle(isOn: $tournament.isPrivate) { |
|
|
|
// Toggle(isOn: $tournament.isPrivate) { |
|
|
|
Text("Tournoi privé") |
|
|
|
// Text("Tournoi privé") |
|
|
|
} |
|
|
|
// } |
|
|
|
} footer: { |
|
|
|
// } footer: { |
|
|
|
Text(.init("Le tournoi sera masqué sur le site [Padel Club](\(URLs.main.rawValue))")) |
|
|
|
// Text(.init("Le tournoi sera masqué sur le site [Padel Club](\(URLs.main.rawValue))")) |
|
|
|
} |
|
|
|
// } |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
.navigationTitle("Gestion du tournoi") |
|
|
|
.toolbarBackground(.visible, for: .navigationBar) |
|
|
|
.toolbarBackground(.visible, for: .navigationBar) |
|
|
|
.onChange(of: tournament.endDate) { |
|
|
|
.onChange(of: tournament.endDate) { |
|
|
|
_save() |
|
|
|
_save() |
|
|
|
} |
|
|
|
} |
|
|
|
.onChange(of: [tournament.isDeleted, tournament.isPrivate]) { |
|
|
|
.onChange(of: tournament.isDeleted) { |
|
|
|
_save() |
|
|
|
_save() |
|
|
|
} |
|
|
|
} |
|
|
|
.onChange(of: tournament.isCanceled) { |
|
|
|
.onChange(of: tournament.isCanceled) { |
|
|
|
|