feat(watch): add rest duration display in workout views
This commit is contained in:
@@ -165,18 +165,31 @@ struct WorkoutOverviewPage: View {
|
||||
|
||||
if let workout = workoutManager.selectedWorkout {
|
||||
ForEach(Array(workout.sets.enumerated()), id: \.offset) { i, set in
|
||||
HStack {
|
||||
Circle()
|
||||
.fill(i < workoutManager.currentSetIndex ? .green :
|
||||
i == workoutManager.currentSetIndex ? .cyan : .gray.opacity(0.4))
|
||||
.frame(width: 8, height: 8)
|
||||
Text("\(i + 1). \(set.stroke)")
|
||||
.font(.caption)
|
||||
.foregroundColor(i <= workoutManager.currentSetIndex ? .primary : .secondary)
|
||||
Spacer()
|
||||
Text("\(set.repCount)x\(set.distancePerRep)m")
|
||||
.font(.caption2)
|
||||
.foregroundColor(.secondary)
|
||||
VStack(alignment: .leading, spacing: 2) {
|
||||
HStack {
|
||||
Circle()
|
||||
.fill(i < workoutManager.currentSetIndex ? .green :
|
||||
i == workoutManager.currentSetIndex ? .cyan : .gray.opacity(0.4))
|
||||
.frame(width: 8, height: 8)
|
||||
Text("\(i + 1). \(set.stroke)")
|
||||
.font(.caption)
|
||||
.foregroundColor(i <= workoutManager.currentSetIndex ? .primary : .secondary)
|
||||
Spacer()
|
||||
Text("\(set.repCount)x\(set.distancePerRep)m")
|
||||
.font(.caption2)
|
||||
.foregroundColor(.secondary)
|
||||
}
|
||||
if set.restType != "none", set.restDuration > 0 {
|
||||
HStack(spacing: 2) {
|
||||
Spacer().frame(width: 14)
|
||||
Image(systemName: "clock")
|
||||
.font(.caption2)
|
||||
.foregroundColor(.orange)
|
||||
Text(String(format: "%ds rest", Int(set.restDuration)))
|
||||
.font(.caption2)
|
||||
.foregroundColor(.orange)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user