Apply consistent branding colors (BlueGreen, Cerulean, BrightAmber, PrimaryScarlet, cream backgrounds) to all screens, components, buttons, icons, and text throughout the app. Update all Form/List views with proper list row backgrounds to ensure visual consistency with card-based layouts. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
100 lines
3.3 KiB
Swift
100 lines
3.3 KiB
Swift
import SwiftUI
|
|
import ComposeApp
|
|
|
|
struct PropertyHeaderCard: View {
|
|
let residence: Residence
|
|
|
|
var body: some View {
|
|
VStack(alignment: .leading, spacing: 16) {
|
|
HStack {
|
|
Image(systemName: "house.fill")
|
|
.font(.title2)
|
|
.foregroundColor(Color.appPrimary)
|
|
|
|
VStack(alignment: .leading, spacing: 4) {
|
|
Text(residence.name)
|
|
.font(.title2)
|
|
.fontWeight(.bold)
|
|
.foregroundColor(Color.appTextPrimary)
|
|
|
|
if let propertyType = residence.propertyType {
|
|
Text(propertyType)
|
|
.font(.caption)
|
|
.foregroundColor(Color.appTextSecondary)
|
|
}
|
|
}
|
|
|
|
Spacer()
|
|
}
|
|
|
|
Divider()
|
|
|
|
VStack(alignment: .leading, spacing: 4) {
|
|
if let streetAddress = residence.streetAddress {
|
|
Label(streetAddress, systemImage: "mappin.circle.fill")
|
|
.font(.subheadline)
|
|
.foregroundColor(Color.appTextPrimary)
|
|
}
|
|
|
|
if residence.city != nil || residence.stateProvince != nil || residence.postalCode != nil {
|
|
Text("\(residence.city ?? ""), \(residence.stateProvince ?? "") \(residence.postalCode ?? "")")
|
|
.font(.subheadline)
|
|
.foregroundColor(Color.appTextSecondary)
|
|
}
|
|
|
|
if let country = residence.country, !country.isEmpty {
|
|
Text(country)
|
|
.font(.caption)
|
|
.foregroundColor(Color.appTextSecondary)
|
|
}
|
|
}
|
|
|
|
if let bedrooms = residence.bedrooms,
|
|
let bathrooms = residence.bathrooms {
|
|
Divider()
|
|
|
|
HStack(spacing: 24) {
|
|
PropertyDetailItem(icon: "bed.double.fill", value: "\(bedrooms)", label: "Beds")
|
|
PropertyDetailItem(icon: "shower.fill", value: String(format: "%.1f", bathrooms), label: "Baths")
|
|
|
|
if let sqft = residence.squareFootage {
|
|
PropertyDetailItem(icon: "square.fill", value: "\(sqft)", label: "Sq Ft")
|
|
}
|
|
}
|
|
}
|
|
}
|
|
.padding(20)
|
|
.background(Color.appBackgroundSecondary)
|
|
.cornerRadius(16)
|
|
.shadow(color: AppShadow.md.color, radius: AppShadow.md.radius, x: AppShadow.md.x, y: AppShadow.md.y)
|
|
}
|
|
}
|
|
|
|
//#Preview {
|
|
// PropertyHeaderCard(residence: Residence(
|
|
// id: 1,
|
|
// owner: "My Beautiful Home",
|
|
// ownerUsername: "House",
|
|
// name: "123 Main Street",
|
|
// propertyType: nil,
|
|
// streetAddress: "San Francisco",
|
|
// apartmentUnit: "CA",
|
|
// city: "94102",
|
|
// stateProvince: "USA",
|
|
// postalCode: 3,
|
|
// country: 2.5,
|
|
// bedrooms: 1800,
|
|
// bathrooms: 0.25,
|
|
// squareFootage: 2010,
|
|
// lotSize: nil,
|
|
// yearBuilt: nil,
|
|
// description: nil,
|
|
// purchaseDate: true,
|
|
// purchasePrice: "testuser",
|
|
// isPrimary: 1,
|
|
// createdAt: "2024-01-01T00:00:00Z",
|
|
// updatedAt: "2024-01-01T00:00:00Z"
|
|
// ))
|
|
// .padding()
|
|
//}
|