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 {
|
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 {
|
ScrollView {
|
||||||
VStack(alignment: .leading, spacing: 22) {
|
VStack(alignment: .leading, spacing: 22) {
|
||||||
HStack(alignment: .top) {
|
HStack(alignment: .top) {
|
||||||
@@ -45,14 +48,14 @@ struct HomeView: View {
|
|||||||
Text(subtitle).font(.subheadline).foregroundStyle(.secondary)
|
Text(subtitle).font(.subheadline).foregroundStyle(.secondary)
|
||||||
}
|
}
|
||||||
Spacer()
|
Spacer()
|
||||||
if streak > 0 { StreakBadge(days: streak) }
|
if streak.streak > 0 { StreakBadge(days: streak.streak, freezes: streak.availableFreezes) }
|
||||||
}
|
}
|
||||||
|
|
||||||
statCards
|
statCards
|
||||||
|
|
||||||
VStack(alignment: .leading, spacing: 10) {
|
VStack(alignment: .leading, spacing: 10) {
|
||||||
Text("Activity").font(.headline)
|
Text("Activity").font(.headline)
|
||||||
ActivityGrid(activityByDay: activityByDay)
|
ActivityGrid(activityByDay: activityByDay, frozenDays: streak.frozenDays)
|
||||||
}
|
}
|
||||||
.frame(maxWidth: .infinity, alignment: .leading)
|
.frame(maxWidth: .infinity, alignment: .leading)
|
||||||
.card()
|
.card()
|
||||||
|
|||||||
Reference in New Issue
Block a user