fix: use View-backed background for HomeStatsCard gradient
Co-authored-by: Rocky <hkgood@users.noreply.github.com>
This commit is contained in:
@@ -57,18 +57,7 @@ struct HomeStatsCard: View {
|
||||
)
|
||||
}
|
||||
}
|
||||
.background(cardBackground, in: RoundedRectangle(cornerRadius: Radius.xl, style: .continuous))
|
||||
.overlay(
|
||||
RoundedRectangle(cornerRadius: Radius.xl, style: .continuous)
|
||||
.stroke(palette.divider, lineWidth: 0.5)
|
||||
)
|
||||
.onAppear(perform: refreshDictionaryCount)
|
||||
.onReceive(NotificationCenter.default.publisher(for: UIApplication.didBecomeActiveNotification)) { _ in
|
||||
refreshDictionaryCount()
|
||||
}
|
||||
}
|
||||
|
||||
private var cardBackground: some View {
|
||||
.background {
|
||||
ZStack(alignment: .top) {
|
||||
palette.surface
|
||||
LinearGradient(
|
||||
@@ -82,6 +71,16 @@ struct HomeStatsCard: View {
|
||||
)
|
||||
}
|
||||
}
|
||||
.clipShape(RoundedRectangle(cornerRadius: Radius.xl, style: .continuous))
|
||||
.overlay(
|
||||
RoundedRectangle(cornerRadius: Radius.xl, style: .continuous)
|
||||
.stroke(palette.divider, lineWidth: 0.5)
|
||||
)
|
||||
.onAppear(perform: refreshDictionaryCount)
|
||||
.onReceive(NotificationCenter.default.publisher(for: UIApplication.didBecomeActiveNotification)) { _ in
|
||||
refreshDictionaryCount()
|
||||
}
|
||||
}
|
||||
|
||||
private func statCell(systemImage: String, value: String, label: LocalizedStringKey) -> some View {
|
||||
VStack(alignment: .leading, spacing: Spacing.xs) {
|
||||
|
||||
Reference in New Issue
Block a user