ios ui refactor
This commit is contained in:
51
iosApp/iosApp/Subviews/Residence/TaskStatChip.swift
Normal file
51
iosApp/iosApp/Subviews/Residence/TaskStatChip.swift
Normal file
@@ -0,0 +1,51 @@
|
||||
import SwiftUI
|
||||
|
||||
struct TaskStatChip: View {
|
||||
let icon: String
|
||||
let value: String
|
||||
let label: String
|
||||
let color: Color
|
||||
|
||||
var body: some View {
|
||||
HStack(spacing: 4) {
|
||||
Image(systemName: icon)
|
||||
.font(.caption)
|
||||
.foregroundColor(color)
|
||||
|
||||
Text(value)
|
||||
.font(.subheadline)
|
||||
.fontWeight(.bold)
|
||||
.foregroundColor(color)
|
||||
|
||||
Text(label)
|
||||
.font(.caption)
|
||||
.foregroundColor(.secondary)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#Preview {
|
||||
VStack(spacing: 16) {
|
||||
TaskStatChip(
|
||||
icon: "list.bullet",
|
||||
value: "10",
|
||||
label: "Tasks",
|
||||
color: .blue
|
||||
)
|
||||
|
||||
TaskStatChip(
|
||||
icon: "checkmark.circle.fill",
|
||||
value: "3",
|
||||
label: "Done",
|
||||
color: .green
|
||||
)
|
||||
|
||||
TaskStatChip(
|
||||
icon: "clock.fill",
|
||||
value: "5",
|
||||
label: "Pending",
|
||||
color: .orange
|
||||
)
|
||||
}
|
||||
.padding()
|
||||
}
|
||||
Reference in New Issue
Block a user