Skip to content

Commit

Permalink
Remove workshop day from search filter options
Browse files Browse the repository at this point in the history
  • Loading branch information
hicka04 committed Aug 17, 2024
1 parent a6f1fbf commit c012472
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
7 changes: 7 additions & 0 deletions app-ios/Sources/Model/Selectable.swift
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
public protocol Selectable: CaseIterable, Equatable, Identifiable, Hashable {
associatedtype Options: RandomAccessCollection = [Self] where Self == Self.Options.Element
static var options: Options { get }
var caseTitle: String { get }

}

public extension Selectable {
static var options: Options { allCases as! Options }
}
8 changes: 6 additions & 2 deletions app-ios/Sources/SearchFeature/SearchView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -123,9 +123,9 @@ public struct SearchView: View {
selection: T?,
defaultTitle: String,
onSelect: @escaping (T) -> Void
) -> some View where T.AllCases: RandomAccessCollection {
) -> some View {
Menu {
ForEach(T.allCases, id: \.id) { menuSelection in
ForEach(T.options, id: \.id) { menuSelection in
Button {
onSelect(menuSelection)
} label: {
Expand Down Expand Up @@ -171,6 +171,10 @@ extension DroidKaigi2024Day {
String(localized: "9/13", bundle: .module)
}
}

public static var options: [DroidKaigi2024Day] {
[.conferenceDay1, .conferenceDay2]
}
}

#if hasFeature(RetroactiveAttribute)
Expand Down

0 comments on commit c012472

Please sign in to comment.