Streak Freeze Feature Implementation
Nucleic-Session: 89DB7BC1-F74C-4768-BC7B-25F898265E0E
This commit is contained in:
@@ -196,8 +196,12 @@ struct ActivityGrid: View {
|
|||||||
VStack(spacing: gap) {
|
VStack(spacing: gap) {
|
||||||
ForEach(0..<7, id: \.self) { row in
|
ForEach(0..<7, id: \.self) { row in
|
||||||
let date = cal.date(byAdding: .day, value: col * 7 + row, to: gridStart)!
|
let date = cal.date(byAdding: .day, value: col * 7 + row, to: gridStart)!
|
||||||
|
let isFuture = date > today
|
||||||
|
let isFrozen = !isFuture && frozenDays.contains(date)
|
||||||
RoundedRectangle(cornerRadius: 2)
|
RoundedRectangle(cornerRadius: 2)
|
||||||
.fill(date > today ? Color.clear : Palette.activity(level: Self.level(activityByDay[date] ?? 0)))
|
.fill(isFuture ? Color.clear
|
||||||
|
: isFrozen ? Palette.frozen
|
||||||
|
: Palette.activity(level: Self.level(activityByDay[date] ?? 0)))
|
||||||
.frame(width: cell, height: cell)
|
.frame(width: cell, height: cell)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user