@@ -14,7 +14,6 @@ import FeatureCategorySetting
1414import FeatureContentDetail
1515import FeatureContentSetting
1616import FeatureContentList
17- import FeatureCategorySharing
1817import Domain
1918import Util
2019
@@ -29,7 +28,6 @@ public struct MainTabPath {
2928 case ๋งํฌ์ถ๊ฐ๋ฐ์์ ( ContentSettingFeature . State )
3029 case ์นดํ
๊ณ ๋ฆฌ์์ธ( CategoryDetailFeature . State )
3130 case ๋งํฌ๋ชฉ๋ก( ContentListFeature . State )
32- case ๋งํฌ๊ณต์ ( CategorySharingFeature . State )
3331 }
3432
3533 public enum Action {
@@ -40,7 +38,6 @@ public struct MainTabPath {
4038 case ๋งํฌ์ถ๊ฐ๋ฐ์์ ( ContentSettingFeature . Action )
4139 case ์นดํ
๊ณ ๋ฆฌ์์ธ( CategoryDetailFeature . Action )
4240 case ๋งํฌ๋ชฉ๋ก( ContentListFeature . Action )
43- case ๋งํฌ๊ณต์ ( CategorySharingFeature . Action )
4441 }
4542
4643 public var body : some Reducer < State , Action > {
@@ -51,7 +48,6 @@ public struct MainTabPath {
5148 Scope ( state: \. ๋งํฌ์ถ๊ฐ๋ฐ์์ , action: \. ๋งํฌ์ถ๊ฐ๋ฐ์์ ) { ContentSettingFeature ( ) }
5249 Scope ( state: \. ์นดํ
๊ณ ๋ฆฌ์์ธ, action: \. ์นดํ
๊ณ ๋ฆฌ์์ธ) { CategoryDetailFeature ( ) }
5350 Scope ( state: \. ๋งํฌ๋ชฉ๋ก, action: \. ๋งํฌ๋ชฉ๋ก) { ContentListFeature ( ) }
54- Scope ( state: \. ๋งํฌ๊ณต์ , action: \. ๋งํฌ๊ณต์ ) { CategorySharingFeature ( ) }
5551 }
5652}
5753
@@ -101,18 +97,10 @@ public extension MainTabFeature {
10197 /// - ํฌํท `์ถ๊ฐ` or `์์ `์ด ์ฑ๊ณต์ ์ผ๋ก `์๋ฃ`๋์์ ๋
10298 case . path( . element( _, action: . ํฌํท์ถ๊ฐ๋ฐ์์ ( . delegate( . settingSuccess) ) ) ) :
10399 state. path. removeLast ( )
104- guard let lastPath = state. path. last else {
105- switch state. selectedTab {
106- case . pokit: return . none
107- case . recommend:
108- return . send( . recommend( . delegate( . ํฌํท_์ถ๊ฐํ๊ธฐ_์๋ฃ) ) )
109- }
110- }
111- switch lastPath {
112- case . ๋งํฌ๊ณต์ :
113- state. path. removeLast ( )
114- return . none
115- default : return . none
100+ switch state. selectedTab {
101+ case . pokit: return . none
102+ case . recommend:
103+ return . send( . recommend( . delegate( . ํฌํท_์ถ๊ฐํ๊ธฐ_์๋ฃ) ) )
116104 }
117105
118106 /// - ํฌํท ์นดํ
๊ณ ๋ฆฌ ์์ดํ
๋๋ ์ ๋
@@ -218,51 +206,26 @@ public extension MainTabFeature {
218206 return . send( . delegate( . ๋ก๊ทธ์์) )
219207 case . path( . element( _, action: . ์ค์ ( . delegate( . ํ์ํํด) ) ) ) :
220208 return . send( . delegate( . ํ์ํํด) )
221- case let . inner( . ๊ณต์ ํฌํท_์ด๋( sharedCategory: sharedCategory) ) :
222- state. path. append ( . ๋งํฌ๊ณต์ ( CategorySharingFeature . State ( sharedCategory: sharedCategory) ) )
223- return . none
224-
225- /// ๋งํฌ ๊ณต์ ์์ ์ปจํ
์ธ ์์ธ๋ณด๊ธฐ
226- case let . path( . element( _, action: . ๋งํฌ๊ณต์ ( . delegate( . ์ปจํ
์ธ _์์ดํ
_ํด๋ฆญ( categoryId: categoryId, content: content) ) ) ) ) :
227- state. contentDetail = ContentDetailFeature . State ( content: BaseContentDetail (
228- id: content. id,
229- category: BaseCategoryInfo (
230- categoryId: categoryId,
231- categoryName: content. categoryName
232- ) ,
233- title: content. title,
234- data: content. data,
235- memo: content. memo ?? " " ,
236- createdAt: content. createdAt,
237- favorites: nil ,
238- alertYn: . no
239- ) )
240- return . none
241-
242- case let . path( . element( _, action: . ๋งํฌ๊ณต์ ( . delegate( . ๊ณต์ ๋ฐ์_์นดํ
๊ณ ๋ฆฌ_์ถ๊ฐ( sharedCategory) ) ) ) ) :
243- let category = BaseCategoryItem (
244- id: sharedCategory. categoryId,
245- userId: 0 ,
246- categoryName: sharedCategory. categoryName,
247- categoryImage: BaseCategoryImage (
248- imageId: sharedCategory. categoryImageId,
249- imageURL: sharedCategory. categoryImageUrl
250- ) ,
251- contentCount: sharedCategory. contentCount,
252- createdAt: " " ,
253- openType: . ๊ณต๊ฐ,
254- keywordType: . default,
255- userCount: 0 ,
256- isFavorite: false
257- )
258- state. path. append ( . ํฌํท์ถ๊ฐ๋ฐ์์ ( PokitCategorySettingFeature . State (
259- type: . ๊ณต์ ์ถ๊ฐ,
260- category: category
261- ) ) )
262- return . none
209+
263210 case . path( . element( _, action: . ์๋ฆผํจ( . delegate( . alertBoxDismiss) ) ) ) :
264- state. path. popLast ( )
211+ let _ = state. path. popLast ( )
265212 return . none
213+
214+ /// - ์ด๋ ์๋ฝ ์๋ฃ
215+ case . path( . element( _, action: . ์นดํ
๊ณ ๋ฆฌ์์ธ( . delegate( . ์ด๋_์๋ฝ_์๋ฃ) ) ) ) :
216+ state. path. removeLast ( )
217+ return . send( . inner( . ๋งํฌํ์
_ํ์ฑํ( . success( title: " ์ด๋๋ฅผ ์๋ฝํ์ต๋๋ค " , until: 2 ) ) ) , animation: . pokitSpring)
218+
219+ /// - ๊ณต์ ํฌํท ์ ์ฅ ์๋ฃ
220+ case . path( . element( _, action: . ์นดํ
๊ณ ๋ฆฌ์์ธ( . delegate( . ์ ์ฅ_์๋ฃ) ) ) ) :
221+ state. path. removeLast ( )
222+ return . send( . inner( . ๋งํฌํ์
_ํ์ฑํ( . success( title: " ํฌํท์ ์ ์ฅํ์ต๋๋ค " , until: 2 ) ) ) , animation: . pokitSpring)
223+
224+ /// - ํฌํท ๋๊ฐ๊ธฐ ์๋ฃ
225+ case . path( . element( _, action: . ์นดํ
๊ณ ๋ฆฌ์์ธ( . delegate( . ํฌํท๋๊ฐ๊ธฐ) ) ) ) :
226+ state. path. removeLast ( )
227+ return . send( . inner( . ๋งํฌํ์
_ํ์ฑํ( . success( title: " ํฌํท์์ ๋๊ฐ์ต๋๋ค " , until: 2 ) ) ) , animation: . pokitSpring)
228+
266229 default : return . none
267230 }
268231 }
0 commit comments