From 32ad6cab8d58d99ebd8a28e8fa6e6f4e587cb1e5 Mon Sep 17 00:00:00 2001 From: Christian Cleberg Date: Tue, 17 Mar 2026 23:19:43 -0500 Subject: v1.0 --- .../Repositories/RepositorySummarySupport.swift | 51 +++++++--------------- 1 file changed, 15 insertions(+), 36 deletions(-) (limited to 'Hutch/Views/Repositories/RepositorySummarySupport.swift') diff --git a/Hutch/Views/Repositories/RepositorySummarySupport.swift b/Hutch/Views/Repositories/RepositorySummarySupport.swift index 8ad3659..a2cf699 100644 --- a/Hutch/Views/Repositories/RepositorySummarySupport.swift +++ b/Hutch/Views/Repositories/RepositorySummarySupport.swift @@ -39,31 +39,30 @@ func repositoryVisibilityLabel(_ visibility: Visibility) -> String { } } -struct RepositorySummaryCard: View { +struct SummaryMetadataRow: View { + let icon: String let title: String - @ViewBuilder let content: Content - - init(_ title: String, @ViewBuilder content: () -> Content) { - self.title = title - self.content = content() - } + var subtitle: String? = nil var body: some View { - VStack(alignment: .leading, spacing: 12) { - Text(title) - .font(.caption.weight(.semibold)) + HStack(alignment: .top, spacing: 10) { + Image(systemName: icon) .foregroundStyle(.secondary) - .textCase(.uppercase) + .frame(width: 18) - content + VStack(alignment: .leading, spacing: 2) { + Text(title) + if let subtitle, !subtitle.isEmpty { + Text(subtitle) + .font(.subheadline) + .foregroundStyle(.secondary) + } + } } - .frame(maxWidth: .infinity, alignment: .leading) - .padding() - .background(.thinMaterial, in: RoundedRectangle(cornerRadius: 16, style: .continuous)) } } -struct RepositorySummaryField: View { +struct SummaryDetailRow: View { let label: String let value: String var monospace: Bool = false @@ -79,23 +78,3 @@ struct RepositorySummaryField: View { } } } - -struct RepositorySummaryListRow: View { - let label: String - let values: [String] - - var body: some View { - VStack(alignment: .leading, spacing: 4) { - Text(label) - .font(.caption) - .foregroundStyle(.secondary) - - if values.isEmpty { - Text("None") - .foregroundStyle(.tertiary) - } else { - Text(values.joined(separator: ", ")) - } - } - } -} -- cgit v1.2.3