-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTodoItemRow.swift
More file actions
55 lines (51 loc) · 1.75 KB
/
Copy pathTodoItemRow.swift
File metadata and controls
55 lines (51 loc) · 1.75 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
//
// TodoItemRow.swift
// DevLog
//
// Created by 최윤진 on 2/21/26.
//
import SwiftUI
struct TodoItemRow: View {
@ScaledMetric(relativeTo: .largeTitle) private var labelWidth = CGFloat(34)
private let item: TodoListItem
init(_ item: TodoListItem) {
self.item = item
}
var body: some View {
HStack {
Image(systemName: "checkmark.circle")
.resizable()
.frame(width: labelWidth, height: labelWidth)
.foregroundStyle(item.isCompleted ? .green : .secondary)
VStack(alignment: .leading, spacing: 0) {
HStack {
Text(item.title)
.font(.headline)
.foregroundStyle(Color(.label))
.lineLimit(1)
Text("#\(item.number)")
.font(.subheadline.weight(.semibold))
.foregroundStyle(.gray)
.fixedSize(horizontal: true, vertical: false)
}
HStack(spacing: 4) {
if item.isPinned {
Image(systemName: "star.fill")
.font(.headline)
.foregroundStyle(.orange)
}
RelativeTimeText(date: item.updatedAt)
}
.frame(height: UIFont.preferredFont(forTextStyle: .headline).lineHeight)
if !item.tags.isEmpty {
TagList(item.tags, lineLimit: 1)
}
}
Spacer()
Image(systemName: "chevron.right")
.font(.caption2.bold())
.foregroundStyle(.gray)
}
.padding(.vertical, 12)
}
}