refactor(design): replace workout emoji icon with segmented section bar

Replace the emoji tile on CalendarWorkoutBlock and WorkoutSessionSheet
header with WorkoutSectionBar — a stack of N horizontal segments, one
per workout section. No emojis, no custom per-program images.
This commit is contained in:
kutesir
2026-05-28 00:00:46 +03:00
parent e105af147d
commit b3f21769ec
2 changed files with 20 additions and 6 deletions

View File

@@ -963,10 +963,8 @@ struct CalendarWorkoutBlock: View {
VStack(alignment: .leading, spacing: 0) { VStack(alignment: .leading, spacing: 0) {
// Header row taps open session // Header row taps open session
HStack(spacing: 8) { HStack(spacing: 8) {
Text(program.emoji).font(.system(size: 16)) WorkoutSectionBar(count: program.sections.count)
.frame(width: 30, height: 30) .frame(width: 30, height: 30)
.background(AppColors.blueSoft)
.clipShape(RoundedRectangle(cornerRadius: 8))
VStack(alignment: .leading, spacing: 1) { VStack(alignment: .leading, spacing: 1) {
Text(program.name) Text(program.name)
@@ -1035,3 +1033,21 @@ struct CalendarWorkoutBlock: View {
.overlay(RoundedRectangle(cornerRadius: AppRadius.small).stroke(AppColors.blue.opacity(0.2), lineWidth: 1)) .overlay(RoundedRectangle(cornerRadius: AppRadius.small).stroke(AppColors.blue.opacity(0.2), lineWidth: 1))
} }
} }
// MARK: - Workout Section Bar
struct WorkoutSectionBar: View {
let count: Int
var body: some View {
let n = max(1, min(6, count))
VStack(spacing: 2.5) {
ForEach(0..<n, id: \.self) { _ in
RoundedRectangle(cornerRadius: 1.5)
.fill(AppColors.blue)
.frame(maxWidth: .infinity, maxHeight: .infinity)
}
}
.padding(7)
.background(AppColors.blueSoft)
.clipShape(RoundedRectangle(cornerRadius: 8))
}
}

View File

@@ -424,10 +424,8 @@ struct WorkoutSessionSheet: View {
VStack(spacing: 0) { VStack(spacing: 0) {
// Header // Header
HStack(spacing: 12) { HStack(spacing: 12) {
Text(vm.workoutEmoji).font(.system(size: 22)) WorkoutSectionBar(count: vm.activeSections.count)
.frame(width: 44, height: 44) .frame(width: 44, height: 44)
.background(AppColors.accentSoft)
.clipShape(RoundedRectangle(cornerRadius: 12))
VStack(alignment: .leading, spacing: 2) { VStack(alignment: .leading, spacing: 2) {
Text(vm.workoutTitle) Text(vm.workoutTitle)