Skip to content

Commit 4540a72

Browse files
committed
ui: 완료 시점과 생성 시점을 보여주도록 개선
1 parent a9d8480 commit 4540a72

4 files changed

Lines changed: 64 additions & 14 deletions

File tree

DevLog/Resource/Localizable.xcstrings

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -325,6 +325,9 @@
325325
},
326326
"새 계정 연동" : {
327327

328+
},
329+
"생성일" : {
330+
328331
},
329332
"설명(선택 사항)" : {
330333

@@ -355,6 +358,9 @@
355358
},
356359
"완료 상태" : {
357360

361+
},
362+
"완료 시점" : {
363+
358364
},
359365
"읽지 않음" : {
360366

DevLog/UI/Common/TodoInfoSheetView.swift

Lines changed: 46 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88
import SwiftUI
99

1010
struct TodoInfoSheetView: View {
11+
let createdAt: Date
12+
let completedAt: Date?
1113
let dueDate: Date?
1214
let tags: [String]
1315
let onClose: () -> Void
@@ -16,13 +18,28 @@ struct TodoInfoSheetView: View {
1618
NavigationStack {
1719
ScrollView {
1820
LazyVStack(spacing: 32) {
19-
VStack {
20-
HStack {
21-
Text("마감일")
22-
.font(.subheadline)
23-
.foregroundStyle(.secondary)
21+
VStack(alignment: .leading) {
22+
Text("생성일")
23+
.font(.subheadline)
24+
.foregroundStyle(.secondary)
25+
HStack(spacing: 8) {
26+
Image(systemName: "calendar")
27+
.foregroundStyle(.white)
28+
Text(createdAt.formatted(date: .abbreviated, time: .omitted))
2429
Spacer()
2530
}
31+
.padding(.vertical, 10)
32+
.padding(.horizontal, 12)
33+
.background(
34+
RoundedRectangle(cornerRadius: 12)
35+
.fill(.blue)
36+
)
37+
Divider()
38+
}
39+
VStack(alignment: .leading) {
40+
Text("마감일")
41+
.font(.subheadline)
42+
.foregroundStyle(.secondary)
2643
HStack(spacing: 8) {
2744
Image(systemName: "calendar")
2845
.foregroundStyle(.secondary)
@@ -42,13 +59,33 @@ struct TodoInfoSheetView: View {
4259
)
4360
Divider()
4461
}
45-
VStack {
46-
HStack {
47-
Text("태그")
48-
.font(.subheadline)
62+
VStack(alignment: .leading) {
63+
Text("완료 시점")
64+
.font(.subheadline)
65+
.foregroundStyle(.secondary)
66+
HStack(spacing: 8) {
67+
Image(systemName: "calendar")
4968
.foregroundStyle(.secondary)
69+
Text(
70+
completedAt?
71+
.formatted(date: .abbreviated, time: .omitted)
72+
?? "완료하지 않음"
73+
)
74+
.foregroundStyle(.white)
5075
Spacer()
5176
}
77+
.padding(.vertical, 10)
78+
.padding(.horizontal, 12)
79+
.background(
80+
RoundedRectangle(cornerRadius: 12)
81+
.fill(.green)
82+
)
83+
Divider()
84+
}
85+
VStack(alignment: .leading) {
86+
Text("태그")
87+
.font(.subheadline)
88+
.foregroundStyle(.secondary)
5289
Divider()
5390
if !tags.isEmpty {
5491
TagLayout {

DevLog/UI/Home/TodoDetailView.swift

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -64,12 +64,17 @@ struct TodoDetailView: View {
6464
}
6565
}
6666

67+
@ViewBuilder
6768
private var sheetContent: some View {
68-
TodoInfoSheetView(
69-
dueDate: viewModel.state.todo?.dueDate,
70-
tags: viewModel.state.todo?.tags ?? []
71-
) {
72-
viewModel.send(.setShowInfo(false))
69+
if let todo = viewModel.state.todo {
70+
TodoInfoSheetView(
71+
createdAt: todo.createdAt,
72+
completedAt: todo.completedAt,
73+
dueDate: todo.dueDate,
74+
tags: todo.tags
75+
) {
76+
viewModel.send(.setShowInfo(false))
77+
}
7378
}
7479
}
7580
}

DevLog/UI/Profile/ProfileView.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -294,6 +294,8 @@ private struct ProfileActivityTodoDetailView: View {
294294

295295
private var infoSheetContent: some View {
296296
TodoInfoSheetView(
297+
createdAt: activity.todo.createdAt,
298+
completedAt: activity.todo.completedAt,
297299
dueDate: activity.todo.dueDate,
298300
tags: activity.todo.tags
299301
) {

0 commit comments

Comments
 (0)