|
|
|
|
@ -16,7 +16,6 @@ enum TournamentSettings: Identifiable, Selectable, Equatable { |
|
|
|
|
case general |
|
|
|
|
case club(Tournament) |
|
|
|
|
case matchFormats |
|
|
|
|
case onlineRegistration(Tournament) |
|
|
|
|
|
|
|
|
|
var id: String { String(describing: self) } |
|
|
|
|
|
|
|
|
|
@ -30,8 +29,6 @@ enum TournamentSettings: Identifiable, Selectable, Equatable { |
|
|
|
|
return "Général" |
|
|
|
|
case .club: |
|
|
|
|
return "Terrains" |
|
|
|
|
case .onlineRegistration: |
|
|
|
|
return "Inscriptions" |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@ -49,15 +46,6 @@ enum TournamentSettings: Identifiable, Selectable, Equatable { |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
func badgeImage() -> Badge? { |
|
|
|
|
switch self { |
|
|
|
|
case .onlineRegistration(let tournament): |
|
|
|
|
if tournament.enableOnlineRegistration { |
|
|
|
|
return .checkmark |
|
|
|
|
} |
|
|
|
|
default: |
|
|
|
|
return nil |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
return nil |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
@ -67,7 +55,7 @@ struct TournamentSettingsView: View { |
|
|
|
|
@Environment(Tournament.self) var tournament: Tournament |
|
|
|
|
|
|
|
|
|
private func destinations() -> [TournamentSettings] { |
|
|
|
|
[.general, .club(tournament), .matchFormats, .onlineRegistration(tournament)] |
|
|
|
|
[.general, .club(tournament), .matchFormats] |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
var body: some View { |
|
|
|
|
@ -80,8 +68,6 @@ struct TournamentSettingsView: View { |
|
|
|
|
TournamentMatchFormatsSettingsView() |
|
|
|
|
case .general: |
|
|
|
|
TournamentGeneralSettingsView(tournament: tournament) |
|
|
|
|
case .onlineRegistration: |
|
|
|
|
RegisrationSetupView(tournament: tournament) |
|
|
|
|
case .club: |
|
|
|
|
TournamentClubSettingsView() |
|
|
|
|
} |
|
|
|
|
|