WIP
This commit is contained in:
@@ -16,7 +16,7 @@ struct AddExerciseView: View {
|
||||
|
||||
@State var searchString: String = ""
|
||||
|
||||
@EnvironmentObject var bridgeModule: BridgeModule
|
||||
@StateObject var bridgeModule = BridgeModule.shared
|
||||
@Environment(\.dismiss) var dismiss
|
||||
|
||||
var selectedWorkout: ((ExerciseExercise) -> Void)
|
||||
@@ -62,6 +62,8 @@ struct AddExerciseView: View {
|
||||
}.frame(height: 100)
|
||||
}
|
||||
|
||||
Divider()
|
||||
|
||||
if let equipment = DataStore.shared.allEquipment {
|
||||
Button("toggle all", action: {
|
||||
if self.selectedEquipment.count > 0 {
|
||||
@@ -100,12 +102,16 @@ struct AddExerciseView: View {
|
||||
}.frame(height: 100)
|
||||
}
|
||||
|
||||
Divider()
|
||||
|
||||
TextField("Filter", text: $searchString)
|
||||
.onReceive(Just(searchString)) { location in
|
||||
filterExercises()
|
||||
}
|
||||
.padding()
|
||||
|
||||
Divider()
|
||||
|
||||
List() {
|
||||
ForEach(filteredExercises.indices, id: \.self) { i in
|
||||
let obj = filteredExercises[i]
|
||||
@@ -142,6 +148,7 @@ struct AddExerciseView: View {
|
||||
selectedEquipment = equipment
|
||||
filteredExercises = exercises
|
||||
}
|
||||
.background(Color(uiColor: .tertiarySystemBackground))
|
||||
}
|
||||
|
||||
func filterExercises() {
|
||||
|
||||
Reference in New Issue
Block a user