|
|
|
|
@ -27,7 +27,8 @@ struct EditingTeamView: View { |
|
|
|
|
@FocusState private var focusedField: TeamRegistration.CodingKeys? |
|
|
|
|
@State private var isProcessingRefund = false |
|
|
|
|
@State private var refundMessage: String? |
|
|
|
|
|
|
|
|
|
@State private var registrationDateModified: Date |
|
|
|
|
|
|
|
|
|
var messageSentFailed: Binding<Bool> { |
|
|
|
|
Binding { |
|
|
|
|
sentError != nil |
|
|
|
|
@ -61,7 +62,9 @@ struct EditingTeamView: View { |
|
|
|
|
init(team: TeamRegistration) { |
|
|
|
|
self.team = team |
|
|
|
|
_name = .init(wrappedValue: team.name ?? "") |
|
|
|
|
_registrationDate = State(wrappedValue: team.registrationDate ?? Date()) |
|
|
|
|
let date = Date() |
|
|
|
|
_registrationDate = State(wrappedValue: team.registrationDate ?? date) |
|
|
|
|
_registrationDateModified = .init(wrappedValue: team.registrationDate ?? date) |
|
|
|
|
_walkOut = State(wrappedValue: team.walkOut) |
|
|
|
|
_wildCardBracket = State(wrappedValue: team.wildCardBracket) |
|
|
|
|
_wildCardGroupStage = State(wrappedValue: team.wildCardGroupStage) |
|
|
|
|
@ -158,11 +161,28 @@ struct EditingTeamView: View { |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
Section { |
|
|
|
|
DatePicker(selection: $registrationDate) { |
|
|
|
|
Text("Inscription") |
|
|
|
|
Text(registrationDate.localizedWeekDay().capitalized) |
|
|
|
|
DatePicker(selection: $registrationDateModified) { |
|
|
|
|
if registrationDate != registrationDateModified { |
|
|
|
|
HStack { |
|
|
|
|
FooterButtonView("Valider") { |
|
|
|
|
registrationDate = registrationDateModified |
|
|
|
|
} |
|
|
|
|
Divider() |
|
|
|
|
FooterButtonView("Annuler", role: .cancel) { |
|
|
|
|
registrationDateModified = registrationDate |
|
|
|
|
} |
|
|
|
|
.foregroundStyle(.blue) |
|
|
|
|
} |
|
|
|
|
} else { |
|
|
|
|
Text("Inscription") |
|
|
|
|
Text(registrationDateModified.localizedWeekDay().capitalized) |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
#if DEBUG |
|
|
|
|
#else |
|
|
|
|
.disabled(team.hasPaidOnline() || team.hasRegisteredOnline()) |
|
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
Toggle(isOn: $wildCardBracket) { |
|
|
|
|
Text("Wildcard Tableau") |
|
|
|
|
} |
|
|
|
|
|