This commit is contained in:
Trey t
2023-07-02 16:42:17 -05:00
parent fbc1ada8c9
commit 9d38a33b80
2 changed files with 26 additions and 12 deletions

View File

@@ -19,6 +19,7 @@ struct WorkoutDetailView: View {
@State var presentedSheet: Sheet?
@State var workoutToPlan: Workout?
var showAddToCalendar = true
var body: some View {
ZStack {
@@ -38,7 +39,7 @@ struct WorkoutDetailView: View {
bridgeModule.sendWorkoutCompleteToWatch()
}, planWorkout: { workout in
workoutToPlan = workout
}, workout: workout)
}, workout: workout, showAddToCalendar: showAddToCalendar)
.frame(height: 44)
}
@@ -119,6 +120,7 @@ struct ActionsView: View {
var workout: Workout
@Environment(\.dismiss) var dismiss
var showAddToCalendar: Bool
var body: some View {
HStack {
@@ -135,16 +137,18 @@ struct ActionsView: View {
.background(.red)
.foregroundColor(.white)
Button(action: {
planWorkout?(workout)
}, label: {
Image(systemName: "calendar.badge.plus")
.font(.title)
.frame(maxWidth: .infinity, maxHeight: .infinity)
})
.frame(maxWidth: .infinity, maxHeight: .infinity)
.background(.blue)
.foregroundColor(.white)
if showAddToCalendar {
Button(action: {
planWorkout?(workout)
}, label: {
Image(systemName: "calendar.badge.plus")
.font(.title)
.frame(maxWidth: .infinity, maxHeight: .infinity)
})
.frame(maxWidth: .infinity, maxHeight: .infinity)
.background(.blue)
.foregroundColor(.white)
}
Button(action: {
startWorkout()