mirror of
https://codeberg.org/secana/Forji.git
synced 2026-06-16 05:13:55 -07:00
feat: add "mirror" badge for mirrored repos #8
This commit is contained in:
parent
79742e761d
commit
26bba7d7ee
4 changed files with 33 additions and 36 deletions
15
Forji/Forji/Views/RepoBadge.swift
Normal file
15
Forji/Forji/Views/RepoBadge.swift
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
import SwiftUI
|
||||
|
||||
struct RepoBadge: View {
|
||||
let title: String
|
||||
let systemImage: String
|
||||
|
||||
var body: some View {
|
||||
Label(title, systemImage: systemImage)
|
||||
.font(.caption2)
|
||||
.fontWeight(.medium)
|
||||
.padding(.horizontal, 8)
|
||||
.padding(.vertical, 3)
|
||||
.glassEffect(.regular)
|
||||
}
|
||||
}
|
||||
|
|
@ -61,21 +61,15 @@ struct RepositoryDetailView: View {
|
|||
Spacer()
|
||||
|
||||
if repository.private ?? false {
|
||||
Label("Private", systemImage: "lock.fill")
|
||||
.font(.caption2)
|
||||
.fontWeight(.medium)
|
||||
.padding(.horizontal, 8)
|
||||
.padding(.vertical, 3)
|
||||
.glassEffect(.regular)
|
||||
RepoBadge(title: "Private", systemImage: "lock.fill")
|
||||
}
|
||||
|
||||
if repository.archived ?? false {
|
||||
Label("Archived", systemImage: "archivebox.fill")
|
||||
.font(.caption2)
|
||||
.fontWeight(.medium)
|
||||
.padding(.horizontal, 8)
|
||||
.padding(.vertical, 3)
|
||||
.glassEffect(.regular)
|
||||
RepoBadge(title: "Archived", systemImage: "archivebox.fill")
|
||||
}
|
||||
|
||||
if repository.mirror ?? false {
|
||||
RepoBadge(title: "Mirror", systemImage: "arrow.triangle.2.circlepath")
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -279,21 +279,15 @@ struct RepositoryRow: View {
|
|||
Spacer()
|
||||
|
||||
if repository.private ?? false {
|
||||
Label("Private", systemImage: "lock.fill")
|
||||
.font(.caption2)
|
||||
.fontWeight(.medium)
|
||||
.padding(.horizontal, 8)
|
||||
.padding(.vertical, 3)
|
||||
.glassEffect(.regular)
|
||||
RepoBadge(title: "Private", systemImage: "lock.fill")
|
||||
}
|
||||
|
||||
if repository.archived ?? false {
|
||||
Label("Archived", systemImage: "archivebox.fill")
|
||||
.font(.caption2)
|
||||
.fontWeight(.medium)
|
||||
.padding(.horizontal, 8)
|
||||
.padding(.vertical, 3)
|
||||
.glassEffect(.regular)
|
||||
RepoBadge(title: "Archived", systemImage: "archivebox.fill")
|
||||
}
|
||||
|
||||
if repository.mirror ?? false {
|
||||
RepoBadge(title: "Mirror", systemImage: "arrow.triangle.2.circlepath")
|
||||
}
|
||||
|
||||
Button {
|
||||
|
|
|
|||
|
|
@ -164,21 +164,15 @@ private struct RepositoryPickerRow: View {
|
|||
Spacer()
|
||||
|
||||
if repository.private ?? false {
|
||||
Label("Private", systemImage: "lock.fill")
|
||||
.font(.caption2)
|
||||
.fontWeight(.medium)
|
||||
.padding(.horizontal, 8)
|
||||
.padding(.vertical, 3)
|
||||
.glassEffect(.regular)
|
||||
RepoBadge(title: "Private", systemImage: "lock.fill")
|
||||
}
|
||||
|
||||
if repository.archived ?? false {
|
||||
Label("Archived", systemImage: "archivebox.fill")
|
||||
.font(.caption2)
|
||||
.fontWeight(.medium)
|
||||
.padding(.horizontal, 8)
|
||||
.padding(.vertical, 3)
|
||||
.glassEffect(.regular)
|
||||
RepoBadge(title: "Archived", systemImage: "archivebox.fill")
|
||||
}
|
||||
|
||||
if repository.mirror ?? false {
|
||||
RepoBadge(title: "Mirror", systemImage: "arrow.triangle.2.circlepath")
|
||||
}
|
||||
}
|
||||
.padding(.vertical, 2)
|
||||
|
|
|
|||
Loading…
Reference in a new issue