WIP
This commit is contained in:
@@ -24,9 +24,16 @@ struct AddExerciseView: View {
|
||||
var selectedWorkout: ((ExerciseExercise) -> Void)
|
||||
@State var createWorkoutItemPickerViewModel: CreateWorkoutItemPickerViewModel?
|
||||
@State var createWorkoutItemPickerViewType: CreateWorkoutItemPickerViewType?
|
||||
@State var searchString: String = ""
|
||||
|
||||
var body: some View {
|
||||
VStack {
|
||||
exerciseView()
|
||||
.padding(.top)
|
||||
|
||||
TextField("Filter", text: $searchString)
|
||||
.padding()
|
||||
|
||||
HStack {
|
||||
muscleView()
|
||||
.frame(maxWidth: .infinity)
|
||||
@@ -38,9 +45,6 @@ struct AddExerciseView: View {
|
||||
}
|
||||
.padding(.top)
|
||||
.frame(height: 44)
|
||||
|
||||
exerciseView()
|
||||
.padding(.top)
|
||||
}
|
||||
.onAppear{
|
||||
if #function.hasPrefix("__preview") {
|
||||
@@ -190,25 +194,27 @@ struct AddExerciseView: View {
|
||||
List() {
|
||||
ForEach(filteredExercises.indices, id: \.self) { i in
|
||||
let obj = filteredExercises[i]
|
||||
VStack {
|
||||
Text(obj.name)
|
||||
.frame(maxWidth: .infinity, alignment: .leading)
|
||||
if obj.side.count > 0 {
|
||||
Text(obj.side)
|
||||
if searchString.isEmpty || obj.name.lowercased().contains(searchString.lowercased()) {
|
||||
VStack {
|
||||
Text(obj.name)
|
||||
.frame(maxWidth: .infinity, alignment: .leading)
|
||||
if obj.side.count > 0 {
|
||||
Text(obj.side)
|
||||
.font(.footnote)
|
||||
.frame(maxWidth: .infinity, alignment: .leading)
|
||||
}
|
||||
Text(obj.equipmentRequired)
|
||||
.font(.footnote)
|
||||
.frame(maxWidth: .infinity, alignment: .leading)
|
||||
Text(obj.muscleGroups)
|
||||
.font(.footnote)
|
||||
.frame(maxWidth: .infinity, alignment: .leading)
|
||||
}
|
||||
Text(obj.equipmentRequired)
|
||||
.font(.footnote)
|
||||
.frame(maxWidth: .infinity, alignment: .leading)
|
||||
Text(obj.muscleGroups)
|
||||
.font(.footnote)
|
||||
.frame(maxWidth: .infinity, alignment: .leading)
|
||||
}
|
||||
.contentShape(Rectangle())
|
||||
.onTapGesture {
|
||||
selectedWorkout(obj)
|
||||
dismiss()
|
||||
.contentShape(Rectangle())
|
||||
.onTapGesture {
|
||||
selectedWorkout(obj)
|
||||
dismiss()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user