Skip to content

Commit a2a01fb

Browse files
committed
feat: 내비게이션 가능한 Todo 행에 상세 미리보기 적용
1 parent 9a64767 commit a2a01fb

4 files changed

Lines changed: 33 additions & 24 deletions

File tree

Application/Presentation/HomeTab/Sources/Home/Home/HomeView.swift

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -300,20 +300,23 @@ public struct HomeView: View {
300300

301301
@ViewBuilder
302302
private func recentTodoRow(_ item: RecentTodoItem) -> some View {
303-
if isCompactLayout {
304-
NavigationLink(value: HomeRoute.todo(TodoIdItem(id: item.id))) {
305-
RecentTodoRow(todo: item)
306-
}
307-
} else {
308-
Button {
309-
coordinator.router.replace(with: .todo(TodoIdItem(id: item.id)))
310-
} label: {
311-
RecentTodoRow(todo: item)
312-
.frame(maxWidth: .infinity, alignment: .leading)
313-
.contentShape(.rect)
303+
Group {
304+
if isCompactLayout {
305+
NavigationLink(value: HomeRoute.todo(TodoIdItem(id: item.id))) {
306+
RecentTodoRow(todo: item)
307+
}
308+
} else {
309+
Button {
310+
coordinator.router.replace(with: .todo(TodoIdItem(id: item.id)))
311+
} label: {
312+
RecentTodoRow(todo: item)
313+
.frame(maxWidth: .infinity, alignment: .leading)
314+
.contentShape(.rect)
315+
}
316+
.buttonStyle(.plain)
314317
}
315-
.buttonStyle(.plain)
316318
}
319+
.todoDetailPreview(todoId: item.id)
317320
}
318321

319322
@ViewBuilder

Application/Presentation/HomeTab/Sources/Home/Search/SearchView.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -205,6 +205,7 @@ struct SearchView: View {
205205
Divider()
206206
}
207207
}
208+
.todoDetailPreview(todoId: item.id)
208209
}
209210

210211
private func webResultRow(_ item: WebPageItem) -> some View {

Application/Presentation/PresentationShared/Sources/Todo/List/TodoListView.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,7 @@ public struct TodoListView: View {
112112
} label: {
113113
TodoItemRow(todo)
114114
}
115+
.todoDetailPreview(todoId: todo.id)
115116
.listRowInsets(EdgeInsets(top: 0, leading: 16, bottom: 0, trailing: 16))
116117
.alignmentGuide(.listRowSeparatorLeading) { _ in return 0 }
117118
.overlay(alignment: .top) {
@@ -279,6 +280,7 @@ public struct TodoListView: View {
279280
Divider()
280281
}
281282
}
283+
.todoDetailPreview(todoId: todo.id)
282284
}
283285
.padding(.horizontal, 16)
284286

Application/Presentation/TodayTab/Sources/Today/TodayView.swift

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -155,20 +155,23 @@ public struct TodayView: View {
155155

156156
@ViewBuilder
157157
private func todoRow(_ item: TodayTodoItem) -> some View {
158-
if isCompactLayout {
159-
NavigationLink(value: TodayRoute.todo(TodoIdItem(id: item.id))) {
160-
TodayTodoRow(item: item)
161-
}
162-
} else {
163-
Button {
164-
coordinator.router.replace(with: .todo(TodoIdItem(id: item.id)))
165-
} label: {
166-
TodayTodoRow(item: item)
167-
.frame(maxWidth: .infinity, alignment: .leading)
168-
.contentShape(.rect)
158+
Group {
159+
if isCompactLayout {
160+
NavigationLink(value: TodayRoute.todo(TodoIdItem(id: item.id))) {
161+
TodayTodoRow(item: item)
162+
}
163+
} else {
164+
Button {
165+
coordinator.router.replace(with: .todo(TodoIdItem(id: item.id)))
166+
} label: {
167+
TodayTodoRow(item: item)
168+
.frame(maxWidth: .infinity, alignment: .leading)
169+
.contentShape(.rect)
170+
}
171+
.buttonStyle(.plain)
169172
}
170-
.buttonStyle(.plain)
171173
}
174+
.todoDetailPreview(todoId: item.id)
172175
}
173176

174177
private var emptyStateContent: EmptyStateContent {

0 commit comments

Comments
 (0)