This commit is contained in:
Trey t
2023-06-20 20:49:32 -05:00
parent 55f0926a08
commit 695459ac06
15 changed files with 287 additions and 111 deletions

View File

@@ -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() {