Streak Freeze Feature Implementation
Nucleic-Session: 89DB7BC1-F74C-4768-BC7B-25F898265E0E
This commit is contained in:
@@ -36,7 +36,10 @@ struct HomeView: View {
|
||||
}
|
||||
|
||||
var body: some View {
|
||||
NavigationStack {
|
||||
// Computed once and threaded down so the badge and grid agree on the streak and which
|
||||
// days a freeze bridged.
|
||||
let streak = streakState
|
||||
return NavigationStack {
|
||||
ScrollView {
|
||||
VStack(alignment: .leading, spacing: 22) {
|
||||
HStack(alignment: .top) {
|
||||
@@ -45,14 +48,14 @@ struct HomeView: View {
|
||||
Text(subtitle).font(.subheadline).foregroundStyle(.secondary)
|
||||
}
|
||||
Spacer()
|
||||
if streak > 0 { StreakBadge(days: streak) }
|
||||
if streak.streak > 0 { StreakBadge(days: streak.streak, freezes: streak.availableFreezes) }
|
||||
}
|
||||
|
||||
statCards
|
||||
|
||||
VStack(alignment: .leading, spacing: 10) {
|
||||
Text("Activity").font(.headline)
|
||||
ActivityGrid(activityByDay: activityByDay)
|
||||
ActivityGrid(activityByDay: activityByDay, frozenDays: streak.frozenDays)
|
||||
}
|
||||
.frame(maxWidth: .infinity, alignment: .leading)
|
||||
.card()
|
||||
|
||||
Reference in New Issue
Block a user