This commit is contained in:
Trey t
2023-06-25 22:00:59 -05:00
parent d055ed182d
commit f40c40c9bb
9 changed files with 220 additions and 87 deletions

View File

@@ -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