diff --git a/DevLog/Resource/Localizable.xcstrings b/DevLog/Resource/Localizable.xcstrings index 613f465..d93cdcf 100644 --- a/DevLog/Resource/Localizable.xcstrings +++ b/DevLog/Resource/Localizable.xcstrings @@ -325,6 +325,9 @@ }, "새 계정 연동" : { + }, + "생성일" : { + }, "설명(선택 사항)" : { @@ -355,6 +358,9 @@ }, "완료 상태" : { + }, + "완료 시점" : { + }, "읽지 않음" : { diff --git a/DevLog/UI/Common/TodoInfoSheetView.swift b/DevLog/UI/Common/TodoInfoSheetView.swift index 1cecba8..05e430c 100644 --- a/DevLog/UI/Common/TodoInfoSheetView.swift +++ b/DevLog/UI/Common/TodoInfoSheetView.swift @@ -8,6 +8,8 @@ import SwiftUI struct TodoInfoSheetView: View { + let createdAt: Date + let completedAt: Date? let dueDate: Date? let tags: [String] let onClose: () -> Void @@ -16,13 +18,28 @@ struct TodoInfoSheetView: View { NavigationStack { ScrollView { LazyVStack(spacing: 32) { - VStack { - HStack { - Text("마감일") - .font(.subheadline) - .foregroundStyle(.secondary) + VStack(alignment: .leading) { + Text("생성일") + .font(.subheadline) + .foregroundStyle(.white) + HStack(spacing: 8) { + Image(systemName: "calendar") + .foregroundStyle(.white) + Text(createdAt.formatted(date: .abbreviated, time: .omitted)) Spacer() } + .padding(.vertical, 10) + .padding(.horizontal, 12) + .background( + RoundedRectangle(cornerRadius: 12) + .fill(.blue) + ) + Divider() + } + VStack(alignment: .leading) { + Text("마감일") + .font(.subheadline) + .foregroundStyle(.secondary) HStack(spacing: 8) { Image(systemName: "calendar") .foregroundStyle(.secondary) @@ -42,13 +59,33 @@ struct TodoInfoSheetView: View { ) Divider() } - VStack { - HStack { - Text("태그") - .font(.subheadline) + VStack(alignment: .leading) { + Text("완료일") + .font(.subheadline) + .foregroundStyle(.secondary) + HStack(spacing: 8) { + Image(systemName: "calendar") .foregroundStyle(.secondary) + Text( + completedAt? + .formatted(date: .abbreviated, time: .omitted) + ?? "완료하지 않음" + ) + .foregroundStyle(.white) Spacer() } + .padding(.vertical, 10) + .padding(.horizontal, 12) + .background( + RoundedRectangle(cornerRadius: 12) + .fill(.green) + ) + Divider() + } + VStack(alignment: .leading) { + Text("태그") + .font(.subheadline) + .foregroundStyle(.secondary) Divider() if !tags.isEmpty { TagLayout { diff --git a/DevLog/UI/Home/TodoDetailView.swift b/DevLog/UI/Home/TodoDetailView.swift index 12e5af9..4fb81c0 100644 --- a/DevLog/UI/Home/TodoDetailView.swift +++ b/DevLog/UI/Home/TodoDetailView.swift @@ -64,12 +64,17 @@ struct TodoDetailView: View { } } + @ViewBuilder private var sheetContent: some View { - TodoInfoSheetView( - dueDate: viewModel.state.todo?.dueDate, - tags: viewModel.state.todo?.tags ?? [] - ) { - viewModel.send(.setShowInfo(false)) + if let todo = viewModel.state.todo { + TodoInfoSheetView( + createdAt: todo.createdAt, + completedAt: todo.completedAt, + dueDate: todo.dueDate, + tags: todo.tags + ) { + viewModel.send(.setShowInfo(false)) + } } } } diff --git a/DevLog/UI/Profile/ProfileView.swift b/DevLog/UI/Profile/ProfileView.swift index d758801..0a43668 100644 --- a/DevLog/UI/Profile/ProfileView.swift +++ b/DevLog/UI/Profile/ProfileView.swift @@ -294,6 +294,8 @@ private struct ProfileActivityTodoDetailView: View { private var infoSheetContent: some View { TodoInfoSheetView( + createdAt: activity.todo.createdAt, + completedAt: activity.todo.completedAt, dueDate: activity.todo.dueDate, tags: activity.todo.tags ) {