krz/hutch
an ios client for sourcehut
clone: git clone https://gitbay.org/krz/hutch.git
v3.4.0: Hutch/Views/Inbox/InboxView.swift · raw
1import SwiftUI
2
3// Legacy wrapper kept temporarily so stale references continue to compile while
4// the app transitions from Inbox to Work.
5struct InboxView: View {
6 var body: some View {
7 WorkView()
8 }
9}
10
11struct InboxThreadRow: View {
12 let thread: InboxThreadSummary
13
14 var body: some View {
15 HStack(alignment: .top, spacing: 12) {
16 Circle()
17 .fill(thread.isUnread ? .blue : .clear)
18 .frame(width: 8, height: 8)
19 .padding(.top, 6)
20
21 VStack(alignment: .leading, spacing: 4) {
22 Text(thread.displaySubject)
23 .font(.subheadline.weight(thread.isUnread ? .semibold : .medium))
24 .lineLimit(2)
25
26 HStack(spacing: 8) {
27 if thread.containsPatch {
28 Image(systemName: "arrow.triangle.branch")
29 .font(.caption)
30 .foregroundStyle(.secondary)
31 }
32
33 Text(thread.metadataLine)
34 .font(.caption)
35 .foregroundStyle(.secondary)
36 .lineLimit(1)
37 }
38 }
39
40 Spacer(minLength: 8)
41
42 Text(thread.lastActivityAt.relativeDescription)
43 .font(.caption)
44 .foregroundStyle(.tertiary.opacity(0.7))
45 .lineLimit(1)
46 }
47 .padding(.vertical, 2)
48 }
49}