- Add OrganicDesign.swift with reusable components: - WarmGradientBackground, OrganicBlobShape, GrainTexture - OrganicDivider, OrganicCardBackground, NaturalShadow modifier - OrganicSpacing constants (cozy, comfortable, spacious, airy) - Update high-priority screens with organic styling: - LoginView: hero glow, organic card background, rounded fonts - ResidenceDetailView, ResidencesListView: warm backgrounds - ResidenceCard, SummaryCard, PropertyHeaderCard: organic cards - TaskCard: metadata pills, secondary buttons, card background - TaskFormView: organic loading overlay, templates button - CompletionHistorySheet: organic loading/error/empty states - ProfileView, NotificationPreferencesView, ThemeSelectionView - Update task badges with icons and capsule styling: - PriorityBadge: priority-specific icons - StatusBadge: status-specific icons - Fix TaskCard isOverdue error using DateUtils.isOverdue() 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
55 lines
1.5 KiB
Swift
55 lines
1.5 KiB
Swift
import SwiftUI
|
|
|
|
struct PriorityBadge: View {
|
|
let priority: String
|
|
|
|
var body: some View {
|
|
HStack(spacing: 5) {
|
|
Image(systemName: priorityIcon)
|
|
.font(.system(size: 10, weight: .bold))
|
|
|
|
Text(priority.capitalized)
|
|
.font(.system(size: 11, weight: .semibold, design: .rounded))
|
|
}
|
|
.padding(.horizontal, 10)
|
|
.padding(.vertical, 5)
|
|
.foregroundColor(priorityColor)
|
|
.background(
|
|
Capsule()
|
|
.fill(priorityColor.opacity(0.12))
|
|
.overlay(
|
|
Capsule()
|
|
.stroke(priorityColor.opacity(0.2), lineWidth: 1)
|
|
)
|
|
)
|
|
}
|
|
|
|
private var priorityIcon: String {
|
|
switch priority.lowercased() {
|
|
case "high": return "exclamationmark.triangle.fill"
|
|
case "medium": return "exclamationmark.circle.fill"
|
|
case "low": return "minus.circle.fill"
|
|
default: return "circle.fill"
|
|
}
|
|
}
|
|
|
|
private var priorityColor: Color {
|
|
switch priority.lowercased() {
|
|
case "high": return Color.appError
|
|
case "medium": return Color.appAccent
|
|
case "low": return Color.appPrimary
|
|
default: return Color.appTextSecondary
|
|
}
|
|
}
|
|
}
|
|
|
|
#Preview {
|
|
VStack(spacing: 12) {
|
|
PriorityBadge(priority: "high")
|
|
PriorityBadge(priority: "medium")
|
|
PriorityBadge(priority: "low")
|
|
}
|
|
.padding()
|
|
.background(WarmGradientBackground())
|
|
}
|