Skip to content

Commit

Permalink
feat: ActivityRecordView의 dismiss 버튼액션 구현
Browse files Browse the repository at this point in the history
  • Loading branch information
iOS-Woong committed Jun 20, 2024
1 parent 0fe7017 commit 3fe01bf
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,14 @@ struct ActivityRecordReducer {
case readViewSize(CGSize)
case selectDateButtonTapped
case selectTimeButtonTapped
case closeButtonTapped
case destination(PresentationAction<Destination.Action>)
case path(StackAction<SearchReducer.State, SearchReducer.Action>)
}

// MARK: Internal

@Dependency(\.dismiss) var dismiss
var body: some ReducerOf<Self> {
Reduce { state, action in
switch action {
Expand Down Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down

0 comments on commit 3fe01bf

Please sign in to comment.