This commit is contained in:
Trey t
2023-06-20 23:40:49 -05:00
parent 69c33f3c34
commit 025810f699
3 changed files with 42 additions and 28 deletions

View File

@@ -49,7 +49,9 @@ class DataStore {
AllMusclesFetchable().fetch(completion: { result in
switch result {
case .success(let model):
self.allMuscles = model
self.allMuscles = model.sorted(by: {
$0.name < $1.name
})
case .failure(let error):
print(error)
}
@@ -59,7 +61,9 @@ class DataStore {
AllEquipmentFetchable().fetch(completion: { result in
switch result {
case .success(let model):
self.allEquipment = model
self.allEquipment = model.sorted(by: {
$0.name ?? "a" < $1.name ?? "a"
})
case .failure(let error):
print(error)
}
@@ -69,7 +73,9 @@ class DataStore {
AllExerciseFetchable().fetch(completion: { result in
switch result {
case .success(let model):
self.allExercise = model
self.allExercise = model.sorted(by: {
$0.name < $1.name
})
case .failure(let error):
print(error)
}

View File

@@ -15,7 +15,6 @@ struct CreateExerciseActionsView: View {
var body: some View {
VStack {
if workoutExercise.exercise.isReps {
VStack {
HStack {
VStack {
HStack {
@@ -27,7 +26,9 @@ struct CreateExerciseActionsView: View {
}, onDecrement: {
workoutExercise.decreaseReps()
})
.labelsHidden()
}
.frame(maxWidth: .infinity)
Divider()
VStack{
HStack {
@@ -39,8 +40,9 @@ struct CreateExerciseActionsView: View {
}, onDecrement: {
workoutExercise.decreaseWeight()
})
.labelsHidden()
}
}
.frame(maxWidth: .infinity)
}
} else if workoutExercise.exercise.isDuration {
VStack{

View File

@@ -22,6 +22,12 @@ struct WorkoutDetailView: View {
TopButtonsView(workout: workout)
.frame(height: 88)
Text(workout.name)
.font(.title3)
if let desc = workout.description {
Text(desc)
.font(.body)
}
CurrentWorkoutElapsedTimeView()
ExerciseListView(workout: workout)
CountdownView()