This commit is contained in:
Trey t
2023-06-21 08:28:55 -05:00
parent c0fd4f7d52
commit d4232d9504

View File

@@ -103,10 +103,37 @@ struct ExerciseListView: View {
List() { List() {
ForEach(workout.exercisesSortedByCreated_at.indices, id: \.self) { i in ForEach(workout.exercisesSortedByCreated_at.indices, id: \.self) { i in
let obj = workout.exercisesSortedByCreated_at[i] let obj = workout.exercisesSortedByCreated_at[i]
Text(obj.exercise.name) VStack {
.onTapGesture { HStack {
bridgeModule.start(workout: workout, atExerciseIndex: i) if i == bridgeModule.currentExerciseIdx {
Image(systemName: "checkmark")
.foregroundColor(.green)
}
Text(obj.exercise.name)
.onTapGesture {
bridgeModule.start(workout: workout, atExerciseIndex: i)
}
Spacer()
} }
if i == bridgeModule.currentExerciseIdx {
HStack {
if obj.exercise.isReps {
Text("is reps")
.frame(maxWidth: .infinity, maxHeight: .infinity)
}
if obj.exercise.isWeight {
Text("is weight")
.frame(maxWidth: .infinity, maxHeight: .infinity)
}
if obj.exercise.isDuration {
Text("is duration")
.frame(maxWidth: .infinity, maxHeight: .infinity)
}
}
}
}
} }
} }
} }