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
5 changes: 4 additions & 1 deletion DevLog/Presentation/ViewModel/TodoDetailViewModel.swift
Original file line number Diff line number Diff line change
Expand Up @@ -35,18 +35,21 @@ final class TodoDetailViewModel: Store {
}

private(set) var state: State = .init()
let showEditButton: Bool
private let fetchUseCase: FetchTodoByIDUseCase
private let upsertUseCase: UpsertTodoUseCase
private let todoID: String

init(
fetchUseCase: FetchTodoByIDUseCase,
upsertUseCase: UpsertTodoUseCase,
todoID: String
todoID: String,
showEditButton: Bool = true
) {
self.fetchUseCase = fetchUseCase
self.upsertUseCase = upsertUseCase
self.todoID = todoID
self.showEditButton = showEditButton
}

func reduce(with action: Action) -> [SideEffect] {
Expand Down
18 changes: 10 additions & 8 deletions DevLog/UI/Home/TodoDetailView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -52,14 +52,16 @@ struct TodoDetailView: View {
Image(systemName: "info.circle")
}
}
if #available(iOS 26.0, *) {
ToolbarSpacer(.fixed, placement: .topBarTrailing)
}
ToolbarItem(placement: .topBarTrailing) {
Button {
viewModel.send(.setShowEditor(true))
} label: {
Text("수정")
if viewModel.showEditButton {
if #available(iOS 26.0, *) {
ToolbarSpacer(.fixed, placement: .topBarTrailing)
}
Comment thread
opficdev marked this conversation as resolved.
ToolbarItem(placement: .topBarTrailing) {
Button {
viewModel.send(.setShowEditor(true))
} label: {
Text("수정")
}
}
}
}
Expand Down
11 changes: 8 additions & 3 deletions DevLog/UI/PushNotification/PushNotificationListView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -79,13 +79,18 @@ struct PushNotificationListView: View {
get: { viewModel.state.selectedTodoID },
set: { viewModel.send(.setSelectedTodoID($0)) }
)) { item in
VStack(spacing: 0) {
Spacer(minLength: 16)
NavigationStack {
TodoDetailView(viewModel: TodoDetailViewModel(
fetchUseCase: container.resolve(FetchTodoByIDUseCase.self),
upsertUseCase: container.resolve(UpsertTodoUseCase.self),
todoID: item.id
todoID: item.id,
showEditButton: false
))
.toolbar {
ToolbarLeadingButton {
viewModel.send(.setSelectedTodoID(nil))
}
}
}
.background(Color(.secondarySystemBackground))
.presentationDragIndicator(.visible)
Expand Down