WIP
This commit is contained in:
@@ -17,33 +17,6 @@ struct CreateWorkoutMainView: View {
|
||||
TextField("Title", text: $viewModel.title)
|
||||
.padding()
|
||||
|
||||
HStack {
|
||||
Button("Add Superset", action: {
|
||||
viewModel.addNewSuperset()
|
||||
})
|
||||
.frame(maxWidth: .infinity, alignment: .center)
|
||||
.frame(height: 44)
|
||||
.foregroundColor(.blue)
|
||||
.background(.yellow)
|
||||
.cornerRadius(8)
|
||||
.padding()
|
||||
.frame(maxWidth: .infinity)
|
||||
|
||||
Divider()
|
||||
|
||||
Button("Done", action: {
|
||||
viewModel.uploadWorkout()
|
||||
})
|
||||
.frame(maxWidth: .infinity, alignment: .center)
|
||||
.frame(height: 44)
|
||||
.foregroundColor(.white)
|
||||
.background(.blue)
|
||||
.cornerRadius(8)
|
||||
.padding()
|
||||
.frame(maxWidth: .infinity)
|
||||
}
|
||||
.frame(height: 44)
|
||||
|
||||
List() {
|
||||
ForEach($viewModel.superSets, id: \.id) { superset in
|
||||
Section {
|
||||
@@ -86,6 +59,35 @@ struct CreateWorkoutMainView: View {
|
||||
}
|
||||
.listRowSeparator(.hidden)
|
||||
}
|
||||
|
||||
HStack {
|
||||
Button("Add Superset", action: {
|
||||
viewModel.addNewSuperset()
|
||||
})
|
||||
.frame(maxWidth: .infinity, alignment: .center)
|
||||
.frame(height: 44)
|
||||
.foregroundColor(.blue)
|
||||
.background(.yellow)
|
||||
.cornerRadius(8)
|
||||
.padding()
|
||||
.frame(maxWidth: .infinity)
|
||||
|
||||
Divider()
|
||||
|
||||
Button("Done", action: {
|
||||
viewModel.uploadWorkout()
|
||||
})
|
||||
.frame(maxWidth: .infinity, alignment: .center)
|
||||
.frame(height: 44)
|
||||
.foregroundColor(.white)
|
||||
.background(.blue)
|
||||
.cornerRadius(8)
|
||||
.padding()
|
||||
.frame(maxWidth: .infinity)
|
||||
.disabled(viewModel.title.isEmpty)
|
||||
}
|
||||
.frame(height: 44)
|
||||
.padding(.bottom)
|
||||
}
|
||||
.sheet(isPresented: $showAddExercise) {
|
||||
AddExerciseView(selectedWorkout: { exercise in
|
||||
|
||||
@@ -22,26 +22,25 @@ struct CreateWorkoutSupersetActionsView: View {
|
||||
Text("Add exercise")
|
||||
.padding()
|
||||
}
|
||||
.frame(maxWidth: .infinity)
|
||||
.foregroundColor(.white)
|
||||
.background(.green)
|
||||
.cornerRadius(10)
|
||||
.frame(maxWidth: .infinity, alignment: .center)
|
||||
.buttonStyle(BorderlessButtonStyle())
|
||||
|
||||
// Button(action: {
|
||||
// if let selectedCreateWorkoutSuperSet = selectedCreateWorkoutSuperSet {
|
||||
// viewModel.delete(superset: selectedCreateWorkoutSuperSet)
|
||||
// viewModel.objectWillChange.send()
|
||||
// }
|
||||
// }) {
|
||||
// Text("Delete superset")
|
||||
// .padding()
|
||||
// }
|
||||
// .frame(maxWidth: .infinity)
|
||||
// .foregroundColor(.white)
|
||||
// .background(.red)
|
||||
// .cornerRadius(10)
|
||||
// .frame(maxWidth: .infinity, alignment: .center)
|
||||
Button(action: {
|
||||
viewModel.delete(superset: workoutSuperSet)
|
||||
viewModel.objectWillChange.send()
|
||||
|
||||
}) {
|
||||
Text("Delete superset")
|
||||
.padding()
|
||||
}
|
||||
.foregroundColor(.white)
|
||||
.background(.red)
|
||||
.cornerRadius(10)
|
||||
.frame(maxWidth: .infinity, alignment: .center)
|
||||
.buttonStyle(BorderlessButtonStyle())
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user