WIP
This commit is contained in:
@@ -81,4 +81,12 @@ struct Exercise: Identifiable, Codable, Equatable {
|
|||||||
}
|
}
|
||||||
return name
|
return name
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var spacedMuscleGroups: String {
|
||||||
|
return muscleGroups.replacingOccurrences(of: ",", with: ", ")
|
||||||
|
}
|
||||||
|
|
||||||
|
var spacedEquipmentRequired: String {
|
||||||
|
return equipmentRequired.replacingOccurrences(of: ",", with: ", ")
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -215,7 +215,7 @@ struct AddExerciseView: View {
|
|||||||
List() {
|
List() {
|
||||||
ForEach(filteredExercises.indices, id: \.self) { i in
|
ForEach(filteredExercises.indices, id: \.self) { i in
|
||||||
let exercise = filteredExercises[i]
|
let exercise = filteredExercises[i]
|
||||||
if searchString.isEmpty || exercise.name.lowercased().contains(searchString.lowercased()) {
|
if searchString.isEmpty || (exercise.name.lowercased().contains(searchString.lowercased()) || exercise.muscleGroups.lowercased().contains(searchString.lowercased())) {
|
||||||
HStack {
|
HStack {
|
||||||
VStack {
|
VStack {
|
||||||
Text(exercise.name)
|
Text(exercise.name)
|
||||||
@@ -228,13 +228,13 @@ struct AddExerciseView: View {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if !exercise.equipmentRequired.isEmpty {
|
if !exercise.equipmentRequired.isEmpty {
|
||||||
Text(exercise.equipmentRequired)
|
Text(exercise.spacedEquipmentRequired)
|
||||||
.font(.footnote)
|
.font(.footnote)
|
||||||
.frame(maxWidth: .infinity, alignment: .leading)
|
.frame(maxWidth: .infinity, alignment: .leading)
|
||||||
}
|
}
|
||||||
|
|
||||||
if !exercise.muscleGroups.isEmpty {
|
if !exercise.muscleGroups.isEmpty {
|
||||||
Text(exercise.muscleGroups)
|
Text(exercise.spacedMuscleGroups)
|
||||||
.font(.footnote)
|
.font(.footnote)
|
||||||
.frame(maxWidth: .infinity, alignment: .leading)
|
.frame(maxWidth: .infinity, alignment: .leading)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user