complete then get health data on completion screen

This commit is contained in:
Trey t
2023-08-17 09:56:33 -05:00
parent 37cc5b055f
commit 7b8af124ec
4 changed files with 42 additions and 40 deletions

View File

@@ -15,6 +15,7 @@ struct ActionsView: View {
var workout: Workout
@Environment(\.dismiss) var dismiss
var showAddToCalendar: Bool
var startWorkoutAction: (() -> Void)
var body: some View {
HStack {
@@ -45,7 +46,7 @@ struct ActionsView: View {
}
Button(action: {
startWorkout()
startWorkoutAction()
}, label: {
Image(systemName: "arrowtriangle.forward.fill")
.font(.title)
@@ -94,15 +95,11 @@ struct ActionsView: View {
func nextExercise() {
bridgeModule.nextExercise()
}
func startWorkout() {
bridgeModule.start(workout: workout)
}
}
struct ActionsView_Previews: PreviewProvider {
static var previews: some View {
ActionsView(workout: PreviewData.workout(), showAddToCalendar: true)
ActionsView(workout: PreviewData.workout(), showAddToCalendar: true, startWorkoutAction: {})
}
}