diff options
Diffstat (limited to 'Hutch/Views/Repositories/RepositorySummarySupport.swift')
| -rw-r--r-- | Hutch/Views/Repositories/RepositorySummarySupport.swift | 51 |
1 files changed, 15 insertions, 36 deletions
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<Content: View>: 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: ", ")) - } - } - } -} |
