Commit 40a46c10ab
Verified · cmc
gitbay/Views/Discovery/ExploreView.swift +11 −4
| @@ -14,16 +14,23 @@ struct ExploreView: View { | ||
| 14 | 14 | )) |
| 15 | 15 | } |
| 16 | 16 | |
| 17 | /// One Text, not two: the HStack spaces its children, and a gap | |
| 18 | /// between the owner and the name would read as part of the path. | |
| 19 | private func path(of repo: PublicRepo) -> AttributedString { | |
| 20 | var owner = AttributedString(repo.owner + "/") | |
| 21 | owner.foregroundColor = .secondary | |
| 22 | var name = AttributedString(repo.name) | |
| 23 | name.font = .gbSans(.subheadline).weight(.medium) | |
| 24 | return owner + name | |
| 25 | } | |
| 26 | ||
| 17 | 27 | var body: some View { |
| 18 | 28 | List { |
| 19 | 29 | ForEach(list.state.value ?? []) { repo in |
| 20 | 30 | NavigationLink(value: RepoRoute.repo(repo.path)) { |
| 21 | 31 | VStack(alignment: .leading, spacing: 4) { |
| 22 | 32 | HStack(spacing: 6) { |
| 23 | Text(repo.owner + "/") | |
| 24 | .foregroundStyle(.secondary) | |
| 25 | + Text(repo.name) | |
| 26 | .fontWeight(.medium) | |
| 33 | Text(path(of: repo)) | |
| 27 | 34 | if repo.isArchived { |
| 28 | 35 | GBChip("archived", .secondary) |
| 29 | 36 | } |