Add ExerciseView with navigation and progress tracking
- Copy ExerciseView from Workouts_old, adapt for CoreData - Add WeightProgressionChartView with historical weight data and chart - Refactor CheckboxListItem to use Button for checkbox tap handling - Update WorkoutLogListView to use NavigationLink for exercise details - Checkbox taps now only cycle status, row tap navigates to exercise
This commit is contained in:
@@ -14,32 +14,39 @@ struct CheckboxListItem: View {
|
||||
var title: String
|
||||
var subtitle: String?
|
||||
var count: Int?
|
||||
var onCheckboxTap: (() -> Void)? = nil
|
||||
|
||||
var body: some View {
|
||||
HStack(alignment: .top) {
|
||||
Image(systemName: status.systemName)
|
||||
.resizable()
|
||||
.scaledToFit()
|
||||
.frame(width: 30)
|
||||
.foregroundStyle(status.color)
|
||||
Button {
|
||||
onCheckboxTap?()
|
||||
} label: {
|
||||
Image(systemName: status.systemName)
|
||||
.resizable()
|
||||
.scaledToFit()
|
||||
.frame(width: 30, height: 30)
|
||||
.foregroundStyle(status.color)
|
||||
}
|
||||
.buttonStyle(.plain)
|
||||
VStack(alignment: .leading) {
|
||||
Text("\(title)")
|
||||
.font(.headline)
|
||||
.foregroundColor(.primary)
|
||||
HStack(alignment: .bottom) {
|
||||
if let subtitle = subtitle {
|
||||
Text("\(subtitle)")
|
||||
.font(.footnote)
|
||||
.foregroundColor(.secondary)
|
||||
}
|
||||
}
|
||||
}
|
||||
Spacer()
|
||||
if let count = count {
|
||||
Spacer()
|
||||
Text("\(count)")
|
||||
.font(.caption)
|
||||
.foregroundColor(.gray)
|
||||
}
|
||||
}
|
||||
.frame(maxWidth: .infinity, alignment: .leading)
|
||||
.contentShape(Rectangle())
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user