diff options
| author | Christian Cleberg <[email protected]> | 2026-03-17 23:19:43 -0500 |
|---|---|---|
| committer | Christian Cleberg <[email protected]> | 2026-03-17 23:19:43 -0500 |
| commit | 32ad6cab8d58d99ebd8a28e8fa6e6f4e587cb1e5 (patch) | |
| tree | ee36d421d704e508d5617d803b4c8cbdb4804fe1 /Hutch/Views/Repositories/RepositorySummarySupport.swift | |
| parent | 8f2057c53e9009c2529c9c4849c914666c0e4b40 (diff) | |
| download | hutch-32ad6cab8d58d99ebd8a28e8fa6e6f4e587cb1e5.tar.gz hutch-32ad6cab8d58d99ebd8a28e8fa6e6f4e587cb1e5.tar.bz2 hutch-32ad6cab8d58d99ebd8a28e8fa6e6f4e587cb1e5.zip | |
v1.0
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: ", ")) - } - } - } -} |
