-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathIssueRow.swift
More file actions
55 lines (46 loc) · 1.6 KB
/
IssueRow.swift
File metadata and controls
55 lines (46 loc) · 1.6 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
//
// IssueRow.swift
// Portfolio Exhibit
//
// Created by Jason on 5/16/23.
//
import SwiftUI
struct IssueRow: View {
@EnvironmentObject var dataController: DataController
@ObservedObject var issue: Issue
var body: some View {
if #available(iOS 16.0, *) {
NavigationLink(value: issue) {
HStack {
Image(systemName: "exclamationmark.circle")
.imageScale(.large)
.opacity(issue.priority == 2 ? 1 : 0)
VStack(alignment: .leading) {
Text(issue.issueTitle)
.font(.headline)
.lineLimit(1)
Text("No tags")
.foregroundStyle(.secondary)
.lineLimit(1)
}
Spacer()
VStack(alignment: .trailing) {
Text(issue.issueCreationDate.formatted(date: .numeric, time: .omitted))
.font(.subheadline)
if issue.completed {
Text("CLOSED")
.font(.body.smallCaps())
}
}
}
}
} else {
// Fallback on earlier versions
}
}
}
struct IssueRow_Previews: PreviewProvider {
static var previews: some View {
IssueRow(issue: .example)
}
}