|
|
|
@ -86,30 +86,35 @@ struct PlanningView: View { |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
ToolbarItem(placement: .topBarTrailing) { |
|
|
|
ToolbarItemGroup(placement: .topBarTrailing) { |
|
|
|
Menu { |
|
|
|
Menu { |
|
|
|
Picker(selection: $filterOption) { |
|
|
|
Picker(selection: $showFinishedMatches) { |
|
|
|
ForEach(PlanningFilterOption.allCases) { |
|
|
|
Text("Afficher tous les matchs").tag(true) |
|
|
|
Text($0.localizedPlanningLabel()).tag($0) |
|
|
|
Text("Masquer les matchs terminés").tag(false) |
|
|
|
} |
|
|
|
|
|
|
|
} label: { |
|
|
|
} label: { |
|
|
|
Text("Option de filtrage") |
|
|
|
Text("Option de filtrage") |
|
|
|
} |
|
|
|
} |
|
|
|
.labelsHidden() |
|
|
|
.labelsHidden() |
|
|
|
.pickerStyle(.inline) |
|
|
|
.pickerStyle(.inline) |
|
|
|
|
|
|
|
} label: { |
|
|
|
Picker(selection: $showFinishedMatches) { |
|
|
|
Label("Filtrer", systemImage: "clock.badge.checkmark") |
|
|
|
Text("Afficher tous les matchs").tag(true) |
|
|
|
.symbolVariant(showFinishedMatches ? .fill : .none) |
|
|
|
Text("Masquer les matchs terminés").tag(false) |
|
|
|
} |
|
|
|
|
|
|
|
Menu { |
|
|
|
|
|
|
|
Picker(selection: $filterOption) { |
|
|
|
|
|
|
|
ForEach(PlanningFilterOption.allCases) { |
|
|
|
|
|
|
|
Text($0.localizedPlanningLabel()).tag($0) |
|
|
|
|
|
|
|
} |
|
|
|
} label: { |
|
|
|
} label: { |
|
|
|
Text("Option de filtrage") |
|
|
|
Text("Option de triage") |
|
|
|
} |
|
|
|
} |
|
|
|
.labelsHidden() |
|
|
|
.labelsHidden() |
|
|
|
.pickerStyle(.inline) |
|
|
|
.pickerStyle(.inline) |
|
|
|
} label: { |
|
|
|
} label: { |
|
|
|
Label("Filtrer", systemImage: "line.3.horizontal.decrease.circle") |
|
|
|
Label("Trier", systemImage: "line.3.horizontal.decrease.circle") |
|
|
|
.symbolVariant(filterOption == .byCourt ? .fill : .none) |
|
|
|
.symbolVariant(filterOption == .byCourt ? .fill : .none) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
}) |
|
|
|
}) |
|
|
|
.overlay { |
|
|
|
.overlay { |
|
|
|
@ -163,7 +168,11 @@ struct PlanningView: View { |
|
|
|
Text(day.formatted(.dateTime.day().weekday().month())) |
|
|
|
Text(day.formatted(.dateTime.day().weekday().month())) |
|
|
|
Spacer() |
|
|
|
Spacer() |
|
|
|
let count = _matchesCount(inDayInt: day.dayInt) |
|
|
|
let count = _matchesCount(inDayInt: day.dayInt) |
|
|
|
Text(self._formattedMatchCount(count)) |
|
|
|
if showFinishedMatches { |
|
|
|
|
|
|
|
Text(self._formattedMatchCount(count)) |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
Text(self._formattedMatchCount(count) + " restant\(count.pluralSuffix)") |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
.headerProminence(.increased) |
|
|
|
.headerProminence(.increased) |
|
|
|
|