From 3140c75815cabe51b88e046ac878486b08cb32b8 Mon Sep 17 00:00:00 2001 From: Trey t Date: Sat, 13 Dec 2025 01:11:56 -0600 Subject: [PATCH] Fix CaseraIconView to use theme color instead of hardcoded orange MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 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 --- iosApp/Casera/CaseraIconView.swift | 49 ++++++++++++------- .../Subviews/Residence/ResidenceCard.swift | 4 +- 2 files changed, 34 insertions(+), 19 deletions(-) diff --git a/iosApp/Casera/CaseraIconView.swift b/iosApp/Casera/CaseraIconView.swift index af61eb8..5700b35 100644 --- a/iosApp/Casera/CaseraIconView.swift +++ b/iosApp/Casera/CaseraIconView.swift @@ -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)) { diff --git a/iosApp/iosApp/Subviews/Residence/ResidenceCard.swift b/iosApp/iosApp/Subviews/Residence/ResidenceCard.swift index 693325b..31cee35 100644 --- a/iosApp/iosApp/Subviews/Residence/ResidenceCard.swift +++ b/iosApp/iosApp/Subviews/Residence/ResidenceCard.swift @@ -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) }