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,6 +7,7 @@ struct CaseraIconView: View {
|
|||||||
var windowScale: CGFloat = 1.0
|
var windowScale: CGFloat = 1.0
|
||||||
var checkmarkScale: CGFloat = 1.0
|
var checkmarkScale: CGFloat = 1.0
|
||||||
var foregroundColor: Color = Color(red: 1.0, green: 0.96, blue: 0.92)
|
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 {
|
var body: some View {
|
||||||
GeometryReader { geo in
|
GeometryReader { geo in
|
||||||
@@ -14,20 +15,33 @@ struct CaseraIconView: View {
|
|||||||
let center = CGPoint(x: geo.size.width / 2, y: geo.size.height / 2)
|
let center = CGPoint(x: geo.size.width / 2, y: geo.size.height / 2)
|
||||||
|
|
||||||
ZStack {
|
ZStack {
|
||||||
// Background
|
// Background - use provided color or default gradient
|
||||||
RoundedRectangle(cornerRadius: size * 0.195)
|
if let bgColor = backgroundColor {
|
||||||
.fill(
|
RoundedRectangle(cornerRadius: size * 0.195)
|
||||||
LinearGradient(
|
.fill(
|
||||||
colors: [
|
LinearGradient(
|
||||||
Color(red: 1.0, green: 0.64, blue: 0.28),
|
colors: [bgColor, bgColor.opacity(0.85)],
|
||||||
Color(red: 0.96, green: 0.51, blue: 0.20)
|
startPoint: .top,
|
||||||
],
|
endPoint: .bottom
|
||||||
startPoint: .top,
|
)
|
||||||
endPoint: .bottom
|
|
||||||
)
|
)
|
||||||
)
|
.frame(width: size * 0.906, height: size * 0.906)
|
||||||
.frame(width: size * 0.906, height: size * 0.906)
|
.position(center)
|
||||||
.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
|
// House outline
|
||||||
HousePath(progress: houseProgress)
|
HousePath(progress: houseProgress)
|
||||||
@@ -185,9 +199,10 @@ struct PulsatingCheckmarkView: View {
|
|||||||
|
|
||||||
struct PulsingIconView: View {
|
struct PulsingIconView: View {
|
||||||
@State private var scale: CGFloat = 1.0
|
@State private var scale: CGFloat = 1.0
|
||||||
|
var backgroundColor: Color? = nil
|
||||||
|
|
||||||
var body: some View {
|
var body: some View {
|
||||||
CaseraIconView()
|
CaseraIconView(backgroundColor: backgroundColor)
|
||||||
.scaleEffect(scale)
|
.scaleEffect(scale)
|
||||||
.onAppear {
|
.onAppear {
|
||||||
withAnimation(.easeInOut(duration: 0.8).repeatForever(autoreverses: true)) {
|
withAnimation(.easeInOut(duration: 0.8).repeatForever(autoreverses: true)) {
|
||||||
|
|||||||
@@ -15,11 +15,11 @@ struct ResidenceCard: View {
|
|||||||
HStack(spacing: AppSpacing.sm) {
|
HStack(spacing: AppSpacing.sm) {
|
||||||
VStack {
|
VStack {
|
||||||
if hasOverdueTasks {
|
if hasOverdueTasks {
|
||||||
PulsingIconView()
|
PulsingIconView(backgroundColor: Color.appPrimary)
|
||||||
.frame(width: 44, height: 44)
|
.frame(width: 44, height: 44)
|
||||||
.padding([.trailing], AppSpacing.md)
|
.padding([.trailing], AppSpacing.md)
|
||||||
} else {
|
} else {
|
||||||
CaseraIconView()
|
CaseraIconView(backgroundColor: Color.appPrimary)
|
||||||
.frame(width: 44, height: 44)
|
.frame(width: 44, height: 44)
|
||||||
.padding([.trailing], AppSpacing.md)
|
.padding([.trailing], AppSpacing.md)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user