Skip to content

Commit ebabff5

Browse files
authored
Merge branch 'develop' into fix/#196-qa2-shapekim98
2 parents 4aa7953 + b5f2ab9 commit ebabff5

File tree

3 files changed

+45
-29
lines changed

3 files changed

+45
-29
lines changed

β€ŽProjects/Feature/FeatureCategoryDetail/Sources/CategoryDetailFeature.swiftβ€Ž

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,9 @@ public struct CategoryDetailFeature {
6565
domain.contentList.hasNext
6666
}
6767
var isLoading: Bool = true
68+
var isContentsNotEmpty: Bool {
69+
(isFavoriteCategory && contents.contains { $0.content.isFavorite == true }) || (!isFavoriteCategory && !contents.isEmpty)
70+
}
6871

6972
public init(category: BaseCategoryItem) {
7073
self.domain = .init(categpry: category)

β€ŽProjects/Feature/FeatureCategoryDetail/Sources/CategoryDetailView.swiftβ€Ž

Lines changed: 41 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -30,17 +30,19 @@ public struct CategoryDetailView: View {
3030
public extension CategoryDetailView {
3131
var body: some View {
3232
WithPerceptionTracking {
33-
ScrollView {
33+
ScrollView(showsIndicators: false) {
3434
VStack(spacing: 24) {
3535
header
3636
scrollObservableView
3737
LazyVStack(spacing: 0, pinnedViews: [.sectionHeaders]) {
3838
Section {
3939
contentScrollView
40+
.padding(.horizontal, 20)
4041
} header: {
4142
VStack(spacing: 24) {
42-
PokitDivider().padding(.horizontal, -20)
43+
PokitDivider()
4344
filterHeader
45+
.padding(.horizontal, 20)
4446
}
4547
.padding(.bottom, 16)
4648
.background(.white)
@@ -60,27 +62,26 @@ public extension CategoryDetailView {
6062
isSticky = false
6163
}
6264
})
63-
.padding(.horizontal, 20)
6465
.padding(.top, 12)
6566
.pokitNavigationBar { navigationBar }
66-
//TODO: overlay(condition) merge μ‹œ μˆ˜μ •
67-
.overlay(alignment: .bottomTrailing) {
68-
if !store.contents.isEmpty {
69-
Button(action: { send(.링크_μΆ”κ°€_λ²„νŠΌ_λˆŒλ €μ„λ•Œ) }) {
70-
Image(.icon(.plus))
71-
.resizable()
72-
.frame(width: 36, height: 36)
73-
.padding(12)
74-
.foregroundStyle(.pokit(.icon(.inverseWh)))
75-
.background {
76-
RoundedRectangle(cornerRadius: 9999, style: .continuous)
77-
.fill(.pokit(.bg(.brand)))
78-
}
79-
.frame(width: 60, height: 60)
80-
}
81-
.padding(.trailing, 20)
82-
.padding(.bottom, 39)
67+
.overlay(
68+
if: store.isContentsNotEmpty,
69+
alignment: .bottomTrailing
70+
) {
71+
Button(action: { send(.링크_μΆ”κ°€_λ²„νŠΌ_λˆŒλ €μ„λ•Œ) }) {
72+
Image(.icon(.plus))
73+
.resizable()
74+
.frame(width: 36, height: 36)
75+
.padding(12)
76+
.foregroundStyle(.pokit(.icon(.inverseWh)))
77+
.background {
78+
RoundedRectangle(cornerRadius: 9999, style: .continuous)
79+
.fill(.pokit(.bg(.brand)))
80+
}
81+
.frame(width: 60, height: 60)
8382
}
83+
.padding(.trailing, 20)
84+
.padding(.bottom, 39)
8485
}
8586
.ignoresSafeArea(edges: .bottom)
8687
.sheet(isPresented: $store.isCategorySheetPresented) {
@@ -213,14 +214,15 @@ private extension CategoryDetailView {
213214
@ViewBuilder
214215
var filterHeader: some View {
215216
let isFavoriteCategory = store.isFavoriteCategory
216-
if !store.contents.isEmpty {
217+
let favoriteContentsCount = store.contents.filter { $0.content.isFavorite ?? false }.count
218+
if store.isContentsNotEmpty {
217219
HStack(spacing: isFavoriteCategory ? 2 : 8) {
218220
if isFavoriteCategory {
219221
Image(.icon(.link))
220222
.resizable()
221223
.frame(width: 16, height: 16)
222224
.foregroundStyle(.pokit(.icon(.secondary)))
223-
Text("\(store.contents.count)개")
225+
Text("\(favoriteContentsCount)개")
224226
.foregroundStyle(.pokit(.text(.tertiary)))
225227
.pokitFont(.b2(.m))
226228
} else {
@@ -300,12 +302,23 @@ private extension CategoryDetailView {
300302
let isFirst = store.state.id == self.store.contents.first?.id
301303
let isLast = store.state.id == self.store.contents.last?.id
302304

303-
ContentCardView(
304-
store: store,
305-
type: .linkList,
306-
isFirst: isFirst,
307-
isLast: isLast
308-
)
305+
if !self.store.isFavoriteCategory {
306+
ContentCardView(
307+
store: store,
308+
type: .linkList,
309+
isFirst: isFirst,
310+
isLast: isLast
311+
)
312+
} else {
313+
if store.content.isFavorite == true {
314+
ContentCardView(
315+
store: store,
316+
type: .linkList,
317+
isFirst: isFirst,
318+
isLast: isLast
319+
)
320+
}
321+
}
309322
}
310323

311324
if store.hasNext {

β€ŽProjects/Feature/FeatureRecommend/Sources/Recommend/RecommendKeywordBottomSheet.swiftβ€Ž

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ struct RecommendKeywordBottomSheet: View {
5151
.padding(.bottom, 40)
5252

5353
PokitBottomButton(
54-
"ν‚€μ›Œλ“œ 선택",
54+
"ν‚€μ›Œλ“œ μ €μž₯",
5555
state: selectedInterests.count == 0 ? .disable : .filled(.primary),
5656
action: { onSave?(selectedInterests) }
5757
)

0 commit comments

Comments
Β (0)