diff --git a/app-ios/Sources/CommonComponents/SelectionChips.swift b/app-ios/Sources/CommonComponents/SelectionChips.swift index bacd9b965..af402de19 100644 --- a/app-ios/Sources/CommonComponents/SelectionChips.swift +++ b/app-ios/Sources/CommonComponents/SelectionChips.swift @@ -5,11 +5,17 @@ import Theme public struct SelectionChips: View where SelectableCase.AllCases: RandomAccessCollection { @Binding public var selected: SelectableCase? public var notSelectedTitle: String? + public let options: [SelectableCase] - public init(selected: Binding, notSelectedTitle: String? = nil) { - self._selected = selected - self.notSelectedTitle = notSelectedTitle - } + public init( + selected: Binding, + notSelectedTitle: String? = nil, + options: [SelectableCase] = SelectableCase.allCases as! [SelectableCase] + ) { + self._selected = selected + self.notSelectedTitle = notSelectedTitle + self.options = options + } public var body: some View { ScrollView(.horizontal) { @@ -24,7 +30,7 @@ public struct SelectionChips: View where SelectableC } } - ForEach(SelectableCase.allCases) { selection in + ForEach(options) { selection in SelectionChip( title: selection.caseTitle, isMultiSelect: false, diff --git a/app-ios/Sources/FavoriteFeature/FavoriteView.swift b/app-ios/Sources/FavoriteFeature/FavoriteView.swift index 6b478cf8e..86e765eca 100644 --- a/app-ios/Sources/FavoriteFeature/FavoriteView.swift +++ b/app-ios/Sources/FavoriteFeature/FavoriteView.swift @@ -77,7 +77,8 @@ public struct FavoriteView: View { private var daySelection: some View { SelectionChips( selected: $store.selectedDay.sending(\.view.selectedDayChanged), - notSelectedTitle: String(localized: "All", bundle: .module) + notSelectedTitle: String(localized: "All", bundle: .module), + options: DroidKaigi2024Day.options ) } } @@ -105,6 +106,10 @@ extension DroidKaigi2024Day { String(localized: "9/13", bundle: .module) } } + + public static var options: [DroidKaigi2024Day] { + [.conferenceDay1, .conferenceDay2] + } } #Preview {