@@ -18,6 +18,7 @@ public struct PokitLinkEditFeature {
1818 var item : BaseContentListInquiry
1919 var list = IdentifiedArrayOf < BaseContentItem > ( )
2020 var selectedItems = IdentifiedArrayOf < BaseContentItem > ( )
21+ var isPresented : Bool = false
2122
2223 public init ( linkList: BaseContentListInquiry ) {
2324 self . item = linkList
@@ -36,10 +37,12 @@ public struct PokitLinkEditFeature {
3637 case delegate( DelegateAction )
3738
3839 @CasePathable
39- public enum View : Equatable {
40+ public enum View : BindableAction , Equatable {
41+ case binding( BindingAction < State > )
4042 case dismiss
4143
4244 case 체크박스_선택했을때( BaseContentItem )
45+ case 카테고리_선택했을때( BaseCategoryItem )
4346 }
4447
4548 public enum InnerAction : Equatable { case 없음 }
@@ -83,6 +86,7 @@ public struct PokitLinkEditFeature {
8386
8487 /// - Reducer body
8588 public var body : some ReducerOf < Self > {
89+ BindingReducer ( action: \. view)
8690 Reduce ( self . core)
8791 }
8892}
@@ -91,6 +95,9 @@ private extension PokitLinkEditFeature {
9195 /// - View Effect
9296 func handleViewAction( _ action: Action . View , state: inout State ) -> Effect < Action > {
9397 switch action {
98+ case . binding:
99+ return . none
100+
94101 case . dismiss:
95102 return . run { _ in await dismiss ( ) }
96103
@@ -102,6 +109,11 @@ private extension PokitLinkEditFeature {
102109 state. selectedItems. append ( item)
103110 }
104111 return . none
112+
113+ case let . 카테고리_선택했을때( pokit) :
114+ //TODO: 포킷이동 네트워크 구현
115+ state. isPresented = false
116+ return . none
105117 }
106118 }
107119
@@ -124,12 +136,15 @@ private extension PokitLinkEditFeature {
124136 return . none
125137
126138 case . 전체선택_버튼_눌렀을때:
139+ state. selectedItems = state. list
127140 return . none
128141
129142 case . 전체해제_버튼_눌렀을때:
143+ state. selectedItems. removeAll ( )
130144 return . none
131145
132146 case . 포킷이동_버튼_눌렀을때:
147+ state. isPresented = true
133148 return . none
134149 }
135150 }
0 commit comments