Add pulsing icon for residences with overdue tasks
- Add overdueCount field to ResidenceResponse model - ResidenceCard shows PulsingIconView when residence has overdue tasks - SummaryCard uses static CaseraIconView (never pulses) - APILayer refreshes residence data after task completion to update overdue counts and animation state 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -17410,6 +17410,10 @@
|
||||
"comment" : "A button label that says \"Mark Task In Progress\".",
|
||||
"isCommentAutoGenerated" : true
|
||||
},
|
||||
"MyCrib Icon Animations" : {
|
||||
"comment" : "The title of the playground interface.",
|
||||
"isCommentAutoGenerated" : true
|
||||
},
|
||||
"Need inspiration?" : {
|
||||
|
||||
},
|
||||
@@ -21334,6 +21338,10 @@
|
||||
},
|
||||
"Remove User" : {
|
||||
|
||||
},
|
||||
"Replay" : {
|
||||
"comment" : "A button that replays the current animation.",
|
||||
"isCommentAutoGenerated" : true
|
||||
},
|
||||
"Reset Password" : {
|
||||
"comment" : "The title of the screen where users can reset their passwords.",
|
||||
|
||||
@@ -3,24 +3,27 @@ import ComposeApp
|
||||
|
||||
struct ResidenceCard: View {
|
||||
let residence: ResidenceResponse
|
||||
|
||||
|
||||
/// Check if this residence has any overdue tasks
|
||||
private var hasOverdueTasks: Bool {
|
||||
Int(residence.overdueCount) > 0
|
||||
}
|
||||
|
||||
var body: some View {
|
||||
VStack(alignment: .leading, spacing: AppSpacing.md) {
|
||||
// Header with property type icon
|
||||
// Header with property type icon (pulses when overdue tasks exist)
|
||||
HStack(spacing: AppSpacing.sm) {
|
||||
VStack {
|
||||
Image("house_outline")
|
||||
.resizable()
|
||||
.frame(width: 44, height: 44)
|
||||
.foregroundColor(Color.appTextOnPrimary)
|
||||
.background(content: {
|
||||
RoundedRectangle(cornerRadius: AppRadius.sm)
|
||||
.fill(LinearGradient(colors: [Color.appPrimary, Color.appPrimary.opacity(0.8)], startPoint: .topLeading, endPoint: .bottomTrailing))
|
||||
.frame(width: 44, height: 44)
|
||||
.shadow(color: Color.appPrimary.opacity(0.3), radius: 6, y: 3)
|
||||
})
|
||||
.padding([.trailing], AppSpacing.md)
|
||||
|
||||
if hasOverdueTasks {
|
||||
PulsingIconView()
|
||||
.frame(width: 44, height: 44)
|
||||
.padding([.trailing], AppSpacing.md)
|
||||
} else {
|
||||
CaseraIconView()
|
||||
.frame(width: 44, height: 44)
|
||||
.padding([.trailing], AppSpacing.md)
|
||||
}
|
||||
|
||||
Spacer()
|
||||
}
|
||||
|
||||
@@ -132,6 +135,7 @@ struct ResidenceCard: View {
|
||||
purchasePrice: nil,
|
||||
isPrimary: true,
|
||||
isActive: true,
|
||||
overdueCount: 1,
|
||||
createdAt: "2024-01-01T00:00:00Z",
|
||||
updatedAt: "2024-01-01T00:00:00Z"
|
||||
))
|
||||
|
||||
@@ -7,8 +7,9 @@ struct SummaryCard: View {
|
||||
var body: some View {
|
||||
VStack(spacing: 16) {
|
||||
HStack {
|
||||
Image(systemName: "chart.bar.doc.horizontal")
|
||||
.font(.title3)
|
||||
CaseraIconView()
|
||||
.frame(width: 32, height: 32)
|
||||
|
||||
Text("Overview")
|
||||
.font(.title3)
|
||||
.fontWeight(.bold)
|
||||
|
||||
Reference in New Issue
Block a user