wip
This commit is contained in:
@ -27,7 +27,6 @@ struct ExercisePickerView: View {
|
||||
var body: some View {
|
||||
NavigationStack {
|
||||
Group {
|
||||
Text("Multi-Select: \(allowMultiSelect)")
|
||||
if selectedListName == nil {
|
||||
// Show list of exercise list files
|
||||
List {
|
||||
@ -51,6 +50,13 @@ struct ExercisePickerView: View {
|
||||
}
|
||||
}
|
||||
}
|
||||
.toolbar {
|
||||
ToolbarItem(placement: .navigationBarLeading) {
|
||||
Button("Cancel") {
|
||||
dismiss()
|
||||
}
|
||||
}
|
||||
}
|
||||
.navigationTitle("Exercise Lists")
|
||||
} else if let fileName = selectedListName, let list = exerciseLists[fileName] {
|
||||
// Show exercises in the selected list grouped by split
|
||||
@ -107,17 +113,13 @@ struct ExercisePickerView: View {
|
||||
}
|
||||
}
|
||||
}
|
||||
.navigationTitle(list.name)
|
||||
.toolbar {
|
||||
if let _ = selectedListName {
|
||||
ToolbarItem(placement: .navigationBarLeading) {
|
||||
Button("Back") {
|
||||
selectedListName = nil
|
||||
selectedExercises.removeAll()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if allowMultiSelect {
|
||||
ToolbarItem(placement: .navigationBarTrailing) {
|
||||
Button("Select") {
|
||||
@ -130,15 +132,7 @@ struct ExercisePickerView: View {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
.toolbar {
|
||||
if let _ = selectedListName {
|
||||
ToolbarItem(placement: .navigationBarLeading) {
|
||||
Button("Cancel") {
|
||||
dismiss()
|
||||
}
|
||||
}
|
||||
.navigationTitle(list.name)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user