diff --git a/Climeet-iOS/Climeet-iOS/Presentation/ActivityRecord/ActivityRecordReducer.swift b/Climeet-iOS/Climeet-iOS/Presentation/ActivityRecord/ActivityRecordReducer.swift index 2c98441..414fba5 100644 --- a/Climeet-iOS/Climeet-iOS/Presentation/ActivityRecord/ActivityRecordReducer.swift +++ b/Climeet-iOS/Climeet-iOS/Presentation/ActivityRecord/ActivityRecordReducer.swift @@ -31,12 +31,14 @@ struct ActivityRecordReducer { case readViewSize(CGSize) case selectDateButtonTapped case selectTimeButtonTapped + case closeButtonTapped case destination(PresentationAction) case path(StackAction) } // MARK: Internal + @Dependency(\.dismiss) var dismiss var body: some ReducerOf { Reduce { state, action in switch action { @@ -75,6 +77,10 @@ struct ActivityRecordReducer { state.destination = .selectDateTime(reducer) return .none + + case .closeButtonTapped: + + return .run { _ in await dismiss() } case let .path(.element(_, action: .delegate(.selectGym(selectedGym)))): state.selectedGym = selectedGym diff --git a/Climeet-iOS/Climeet-iOS/Presentation/ActivityRecord/ActivityRecordView.swift b/Climeet-iOS/Climeet-iOS/Presentation/ActivityRecord/ActivityRecordView.swift index a1b8e7d..c56ca9e 100644 --- a/Climeet-iOS/Climeet-iOS/Presentation/ActivityRecord/ActivityRecordView.swift +++ b/Climeet-iOS/Climeet-iOS/Presentation/ActivityRecord/ActivityRecordView.swift @@ -86,8 +86,13 @@ struct ActivityRecordView: View { .background(.text09) .toolbar { ToolbarItem(placement: .topBarLeading) { - Image("activity_close") - .frame(width: 24, height: 24) + Button(action: { + store.send(.closeButtonTapped) + }, label: { + Image("activity_close") + .frame(width: 24, height: 24) + }) + } } .toolbarBackground(