update project + confirm complete workout early
This commit is contained in:
@@ -16,6 +16,7 @@ struct ActionsView: View {
|
||||
@Environment(\.dismiss) var dismiss
|
||||
var showAddToCalendar: Bool
|
||||
var startWorkoutAction: (() -> Void)
|
||||
@State var showCompleteSheet: Bool = false
|
||||
|
||||
var body: some View {
|
||||
HStack {
|
||||
@@ -57,8 +58,7 @@ struct ActionsView: View {
|
||||
.foregroundColor(.white)
|
||||
} else {
|
||||
Button(action: {
|
||||
AudioEngine.shared.playFinished()
|
||||
completedWorkout?()
|
||||
showCompleteSheet.toggle()
|
||||
}, label: {
|
||||
Image(systemName: "checkmark")
|
||||
.font(.title)
|
||||
@@ -98,6 +98,13 @@ struct ActionsView: View {
|
||||
.foregroundColor(.white)
|
||||
}
|
||||
}
|
||||
.alert("Complete Workout", isPresented: $showCompleteSheet) {
|
||||
Button("Complete Workout", role: .destructive) {
|
||||
AudioEngine.shared.playFinished()
|
||||
completedWorkout?()
|
||||
}
|
||||
Button("Back to workout", role: .cancel) { }
|
||||
}
|
||||
}
|
||||
|
||||
func nextExercise() {
|
||||
|
||||
Reference in New Issue
Block a user