-
Notifications
You must be signed in to change notification settings - Fork 0
[#162] TodoInfoSheetView에 생성일, 완료일을 보여주도록 추가한다 #167
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -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) | ||||||
| ?? "완료하지 않음" | ||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 뷰 내부에 또한,
Suggested change
|
||||||
| ) | ||||||
| .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 { | ||||||
|
|
||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
생성일(
createdAt)을 표시하는 부분의 스타일링에 몇 가지 개선점이 있습니다.Image에는.foregroundStyle(.white)가 적용되었지만, 날짜를 표시하는Text에는 적용되지 않았습니다. 파란색 배경 위에 기본 텍스트 색상이 표시되면 가독성이 떨어질 수 있으므로,Text에도.foregroundStyle(.white)를 추가하여 일관성을 맞추는 것이 좋습니다..fill(.blue)가 하드코딩되어 있습니다. '마감일' 섹션에서Color(.tertiarySystemFill)을 사용한 것처럼, 다크 모드 등 다양한 환경에 더 잘 대응할 수 있는 시맨틱 컬러(Semantic Color)를 사용하거나 Asset에 색상을 정의하여 사용하는 것을 권장합니다..fill(.green)(81행)도 마찬가지입니다.