fix: use View-backed background for HomeStatsCard gradient

Co-authored-by: Rocky <hkgood@users.noreply.github.com>
This commit is contained in:
Cursor Agent
2026-07-03 10:02:24 +00:00
parent 8dc2cd0310
commit c750646e8d
@@ -57,7 +57,21 @@ struct HomeStatsCard: View {
)
}
}
.background(cardBackground, in: RoundedRectangle(cornerRadius: Radius.xl, style: .continuous))
.background {
ZStack(alignment: .top) {
palette.surface
LinearGradient(
colors: [
palette.accent.opacity(0.10),
palette.accent.opacity(0.02),
palette.surface.opacity(0)
],
startPoint: .topLeading,
endPoint: .bottomTrailing
)
}
}
.clipShape(RoundedRectangle(cornerRadius: Radius.xl, style: .continuous))
.overlay(
RoundedRectangle(cornerRadius: Radius.xl, style: .continuous)
.stroke(palette.divider, lineWidth: 0.5)
@@ -68,21 +82,6 @@ struct HomeStatsCard: View {
}
}
private var cardBackground: some View {
ZStack(alignment: .top) {
palette.surface
LinearGradient(
colors: [
palette.accent.opacity(0.10),
palette.accent.opacity(0.02),
palette.surface.opacity(0)
],
startPoint: .topLeading,
endPoint: .bottomTrailing
)
}
}
private func statCell(systemImage: String, value: String, label: LocalizedStringKey) -> some View {
VStack(alignment: .leading, spacing: Spacing.xs) {
HStack(spacing: 6) {