Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions DevLog/Resource/Localizable.xcstrings
Original file line number Diff line number Diff line change
Expand Up @@ -325,6 +325,9 @@
},
"새 계정 연동" : {

},
"생성일" : {

},
"설명(선택 사항)" : {

Expand Down Expand Up @@ -355,6 +358,9 @@
},
"완료 상태" : {

},
"완료 시점" : {

},
"읽지 않음" : {

Expand Down
55 changes: 46 additions & 9 deletions DevLog/UI/Common/TodoInfoSheetView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
import SwiftUI

struct TodoInfoSheetView: View {
let createdAt: Date
let completedAt: Date?
let dueDate: Date?
let tags: [String]
let onClose: () -> Void
Expand All @@ -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)
)
Comment on lines +25 to +36

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

생성일(createdAt)을 표시하는 부분의 스타일링에 몇 가지 개선점이 있습니다.

  1. 텍스트 색상: Image에는 .foregroundStyle(.white)가 적용되었지만, 날짜를 표시하는 Text에는 적용되지 않았습니다. 파란색 배경 위에 기본 텍스트 색상이 표시되면 가독성이 떨어질 수 있으므로, Text에도 .foregroundStyle(.white)를 추가하여 일관성을 맞추는 것이 좋습니다.
  2. 하드코딩된 색상: 배경색으로 .fill(.blue)가 하드코딩되어 있습니다. '마감일' 섹션에서 Color(.tertiarySystemFill)을 사용한 것처럼, 다크 모드 등 다양한 환경에 더 잘 대응할 수 있는 시맨틱 컬러(Semantic Color)를 사용하거나 Asset에 색상을 정의하여 사용하는 것을 권장합니다. .fill(.green)(81행)도 마찬가지입니다.
Suggested change
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)
)
HStack(spacing: 8) {
Image(systemName: "calendar")
.foregroundStyle(.white)
Text(createdAt.formatted(date: .abbreviated, time: .omitted))
.foregroundStyle(.white)
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)
Expand All @@ -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)
?? "완료하지 않음"

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

뷰 내부에 "완료하지 않음"과 같은 문자열이 하드코딩되어 있습니다. 이러한 문자열은 Localizable.xcstrings 파일에 추가하여 지역화(Localization)를 지원하도록 하는 것이 좋습니다.

또한, Localizable.xcstrings에는 "완료 시점"으로 추가되었지만, 뷰에서는 "완료일"(63행)을 사용하고 있어 불일치가 발생합니다. 일관성을 위해 Localizable.xcstrings에 정의된 키를 사용해주세요. "마감일 없음"(49행) 문자열도 마찬가지로 지역화가 필요합니다.

Suggested change
?? "완료하지 않음"
?? String(localized: "완료하지 않음")

)
.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 {
Expand Down
15 changes: 10 additions & 5 deletions DevLog/UI/Home/TodoDetailView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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))
}
}
}
}
2 changes: 2 additions & 0 deletions DevLog/UI/Profile/ProfileView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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
) {
Expand Down