Skip to content

Commit b5f2ab9

Browse files
authored
Merge pull request #197 from YAPP-Github/fix/#196-qa2
fix: 2.0.0 QA2์ฐจ [1]
2 parents c8a0d5d + 210cd96 commit b5f2ab9

File tree

3 files changed

+46
-30
lines changed

3 files changed

+46
-30
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: 42 additions & 29 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 {
@@ -258,7 +260,7 @@ private extension CategoryDetailView {
258260
var contentScrollView: some View {
259261
Group {
260262
if !store.isLoading {
261-
if store.contents.isEmpty {
263+
if !store.isContentsNotEmpty {
262264
VStack {
263265
PokitCaution(
264266
type: .ํฌํ‚ท์ƒ์„ธ_๋งํฌ์—†์Œ,
@@ -275,12 +277,23 @@ private extension CategoryDetailView {
275277
let isFirst = store.state.id == self.store.contents.first?.id
276278
let isLast = store.state.id == self.store.contents.last?.id
277279

278-
ContentCardView(
279-
store: store,
280-
type: .linkList,
281-
isFirst: isFirst,
282-
isLast: isLast
283-
)
280+
if !self.store.isFavoriteCategory {
281+
ContentCardView(
282+
store: store,
283+
type: .linkList,
284+
isFirst: isFirst,
285+
isLast: isLast
286+
)
287+
} else {
288+
if store.content.isFavorite == true {
289+
ContentCardView(
290+
store: store,
291+
type: .linkList,
292+
isFirst: isFirst,
293+
isLast: isLast
294+
)
295+
}
296+
}
284297
}
285298

286299
if store.hasNext {

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

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

4444
PokitBottomButton(
45-
"ํ‚ค์›Œ๋“œ ์„ ํƒ",
45+
"ํ‚ค์›Œ๋“œ ์ €์žฅ",
4646
state: selectedInterests.count == 0 ? .disable : .filled(.primary),
4747
action: action
4848
)

0 commit comments

Comments
ย (0)