Fix CaseraIconView to use theme color instead of hardcoded orange
- Add backgroundColor parameter to CaseraIconView and PulsingIconView - Update ResidenceCard to pass Color.appPrimary for themed icon background - Icon now matches the app's current theme like PropertyHeaderCard 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -7,27 +7,41 @@ struct CaseraIconView: View {
|
||||
var windowScale: CGFloat = 1.0
|
||||
var checkmarkScale: CGFloat = 1.0
|
||||
var foregroundColor: Color = Color(red: 1.0, green: 0.96, blue: 0.92)
|
||||
|
||||
var backgroundColor: Color? = nil // nil uses default gradient, otherwise uses theme color
|
||||
|
||||
var body: some View {
|
||||
GeometryReader { geo in
|
||||
let size = min(geo.size.width, geo.size.height)
|
||||
let center = CGPoint(x: geo.size.width / 2, y: geo.size.height / 2)
|
||||
|
||||
|
||||
ZStack {
|
||||
// Background
|
||||
RoundedRectangle(cornerRadius: size * 0.195)
|
||||
.fill(
|
||||
LinearGradient(
|
||||
colors: [
|
||||
Color(red: 1.0, green: 0.64, blue: 0.28),
|
||||
Color(red: 0.96, green: 0.51, blue: 0.20)
|
||||
],
|
||||
startPoint: .top,
|
||||
endPoint: .bottom
|
||||
// Background - use provided color or default gradient
|
||||
if let bgColor = backgroundColor {
|
||||
RoundedRectangle(cornerRadius: size * 0.195)
|
||||
.fill(
|
||||
LinearGradient(
|
||||
colors: [bgColor, bgColor.opacity(0.85)],
|
||||
startPoint: .top,
|
||||
endPoint: .bottom
|
||||
)
|
||||
)
|
||||
)
|
||||
.frame(width: size * 0.906, height: size * 0.906)
|
||||
.position(center)
|
||||
.frame(width: size * 0.906, height: size * 0.906)
|
||||
.position(center)
|
||||
} else {
|
||||
RoundedRectangle(cornerRadius: size * 0.195)
|
||||
.fill(
|
||||
LinearGradient(
|
||||
colors: [
|
||||
Color(red: 1.0, green: 0.64, blue: 0.28),
|
||||
Color(red: 0.96, green: 0.51, blue: 0.20)
|
||||
],
|
||||
startPoint: .top,
|
||||
endPoint: .bottom
|
||||
)
|
||||
)
|
||||
.frame(width: size * 0.906, height: size * 0.906)
|
||||
.position(center)
|
||||
}
|
||||
|
||||
// House outline
|
||||
HousePath(progress: houseProgress)
|
||||
@@ -185,9 +199,10 @@ struct PulsatingCheckmarkView: View {
|
||||
|
||||
struct PulsingIconView: View {
|
||||
@State private var scale: CGFloat = 1.0
|
||||
|
||||
var backgroundColor: Color? = nil
|
||||
|
||||
var body: some View {
|
||||
CaseraIconView()
|
||||
CaseraIconView(backgroundColor: backgroundColor)
|
||||
.scaleEffect(scale)
|
||||
.onAppear {
|
||||
withAnimation(.easeInOut(duration: 0.8).repeatForever(autoreverses: true)) {
|
||||
|
||||
@@ -15,11 +15,11 @@ struct ResidenceCard: View {
|
||||
HStack(spacing: AppSpacing.sm) {
|
||||
VStack {
|
||||
if hasOverdueTasks {
|
||||
PulsingIconView()
|
||||
PulsingIconView(backgroundColor: Color.appPrimary)
|
||||
.frame(width: 44, height: 44)
|
||||
.padding([.trailing], AppSpacing.md)
|
||||
} else {
|
||||
CaseraIconView()
|
||||
CaseraIconView(backgroundColor: Color.appPrimary)
|
||||
.frame(width: 44, height: 44)
|
||||
.padding([.trailing], AppSpacing.md)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user