Skip to content

Commit db18b46

Browse files
committed
[feat] #183 카테고리 상세 내 링크 추가기능 구현
1 parent ab12378 commit db18b46

File tree

4 files changed

+14
-2
lines changed

4 files changed

+14
-2
lines changed

Projects/App/Sources/MainTab/MainTabPath.swift

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,11 @@ public extension MainTabFeature {
171171
state.path.append(.링크추가및수정(ContentSettingFeature.State(urlText: state.link)))
172172
state.link = nil
173173
return .none
174+
175+
case let .path(.element(_, action: .카테고리상세(.delegate(.링크추가(categoryId))))):
176+
state.categoryId = categoryId
177+
state.path.append(.링크추가및수정(ContentSettingFeature.State()))
178+
return .none
174179

175180
/// - 링크추가 및 수정에서 저장하기 눌렀을 때
176181
case let .path(.element(stackElementId, action: .링크추가및수정(.delegate(.저장하기_완료(contentId))))):

Projects/Feature/FeatureCategoryDetail/Sources/CategoryDetailFeature.swift

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,7 @@ public struct CategoryDetailFeature {
9090
case 카테고리_선택했을때(BaseCategoryItem)
9191
case 필터_버튼_눌렀을때
9292
case 뷰가_나타났을때
93+
case 링크_추가_버튼_눌렀을때
9394
}
9495

9596
public enum InnerAction: Equatable {
@@ -121,6 +122,7 @@ public struct CategoryDetailFeature {
121122
case contentItemTapped(BaseContentItem)
122123
case linkCopyDetected(URL?)
123124
case 링크수정(contentId: Int)
125+
case 링크추가(categoryId: Int)
124126
case 포킷삭제
125127
case 포킷수정(BaseCategoryItem)
126128
case 포킷공유
@@ -186,6 +188,10 @@ private extension CategoryDetailFeature {
186188
)
187189
return .none
188190

191+
case .링크_추가_버튼_눌렀을때:
192+
let id = state.category.id
193+
return .send(.delegate(.링크추가(categoryId: id)))
194+
189195
case .카테고리_케밥_버튼_눌렀을때:
190196
return .run { send in await send(.inner(.카테고리_시트_활성화(true))) }
191197

Projects/Feature/FeatureCategoryDetail/Sources/CategoryDetailView.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ public extension CategoryDetailView {
3737
.padding(.horizontal, 20)
3838
.padding(.top, 12)
3939
.pokitNavigationBar { navigationBar }
40-
.pokitFloatButton(action: {})
40+
.pokitFloatButton(action: { send(.링크_추가_버튼_눌렀을때) })
4141
.ignoresSafeArea(edges: .bottom)
4242
.sheet(isPresented: $store.isCategorySheetPresented) {
4343
PokitBottomSheet(
@@ -147,7 +147,7 @@ private extension CategoryDetailView {
147147
.resizable()
148148
.frame(width: 16, height: 16)
149149
.foregroundStyle(iconColor)
150-
Text("\(store.category.contentCount)")
150+
Text("\(store.contents.count)")
151151
.foregroundStyle(textColor)
152152
.pokitFont(.b2(.m))
153153
}

Projects/Feature/FeatureContentSetting/Sources/ContentSetting/ContentSettingFeature.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -212,6 +212,7 @@ private extension ContentSettingFeature {
212212

213213
return .send(.delegate(.포킷추가하기))
214214
case .뒤로가기_버튼_눌렀을때:
215+
state.categoryId = nil
215216
return state.isShareExtension
216217
? .send(.delegate(.dismiss))
217218
: .run { _ in await dismiss() }

0 commit comments

Comments
 (0)