|
|
|
|
@ -27,6 +27,11 @@ struct ActivityView: View { |
|
|
|
|
.filter({ federalDataViewModel.isTournamentValidForFilters($0) }) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
func getRunningTournaments() -> [Tournament] { |
|
|
|
|
dataStore.tournaments.filter({ $0.endDate == nil }) |
|
|
|
|
.filter({ federalDataViewModel.isTournamentValidForFilters($0) }) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
var endedTournaments: [Tournament] { |
|
|
|
|
dataStore.tournaments.filter({ $0.endDate != nil }) |
|
|
|
|
.filter({ federalDataViewModel.isTournamentValidForFilters($0) }) |
|
|
|
|
@ -53,6 +58,29 @@ struct ActivityView: View { |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@ViewBuilder |
|
|
|
|
private func _pasteView() -> some View { |
|
|
|
|
if UIPasteboard.general.hasStrings { |
|
|
|
|
// Enable string-related control... |
|
|
|
|
if let string = UIPasteboard.general.string { |
|
|
|
|
// use the string here |
|
|
|
|
Section { |
|
|
|
|
Menu("Utiliser le contenu du presse-papier") { |
|
|
|
|
Section { |
|
|
|
|
ForEach(getRunningTournaments()) { tournament in |
|
|
|
|
Button(tournament.tournamentTitle()) { |
|
|
|
|
navigation.path.append(tournament) |
|
|
|
|
tournament.navigationPath = [Screen.inscription] |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} header: { |
|
|
|
|
Text("coller dans") |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
var body: some View { |
|
|
|
|
@Bindable var navigation = navigation |
|
|
|
|
NavigationStack(path: $navigation.path) { |
|
|
|
|
@ -62,6 +90,7 @@ struct ActivityView: View { |
|
|
|
|
List { |
|
|
|
|
switch navigation.agendaDestination! { |
|
|
|
|
case .activity: |
|
|
|
|
_pasteView() |
|
|
|
|
EventListView(tournaments: runningTournaments, viewStyle: viewStyle, sortAscending: true) |
|
|
|
|
case .history: |
|
|
|
|
EventListView(tournaments: endedTournaments, viewStyle: viewStyle, sortAscending: false) |
|
|
|
|
|