@@ -63,24 +63,24 @@ public extension CategoryDetailView {
6363 . padding ( . horizontal, 20 )
6464 . padding ( . top, 12 )
6565 . 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 )
66+ . overlay (
67+ if: store. isContentsNotEmpty,
68+ alignment: . bottomTrailing
69+ ) {
70+ Button ( action: { send ( . 링크_추가_버튼_눌렀을때) } ) {
71+ Image ( . icon( . plus) )
72+ . resizable ( )
73+ . frame ( width: 36 , height: 36 )
74+ . padding ( 12 )
75+ . foregroundStyle ( . pokit( . icon( . inverseWh) ) )
76+ . background {
77+ RoundedRectangle ( cornerRadius: 9999 , style: . continuous)
78+ . fill ( . pokit( . bg( . brand) ) )
79+ }
80+ . frame ( width: 60 , height: 60 )
8381 }
82+ . padding ( . trailing, 20 )
83+ . padding ( . bottom, 39 )
8484 }
8585 . ignoresSafeArea ( edges: . bottom)
8686 . sheet ( isPresented: $store. isCategorySheetPresented) {
@@ -213,14 +213,15 @@ private extension CategoryDetailView {
213213 @ViewBuilder
214214 var filterHeader : some View {
215215 let isFavoriteCategory = store. isFavoriteCategory
216- if !store. contents. isEmpty {
216+ let favoriteContentsCount = store. contents. filter { $0. content. isFavorite ?? false } . count
217+ if store. isContentsNotEmpty {
217218 HStack ( spacing: isFavoriteCategory ? 2 : 8 ) {
218219 if isFavoriteCategory {
219220 Image ( . icon( . link) )
220221 . resizable ( )
221222 . frame ( width: 16 , height: 16 )
222223 . foregroundStyle ( . pokit( . icon( . secondary) ) )
223- Text ( " \( store . contents . count ) 개 " )
224+ Text ( " \( favoriteContentsCount ) 개 " )
224225 . foregroundStyle ( . pokit( . text( . tertiary) ) )
225226 . pokitFont ( . b2( . m) )
226227 } else {
@@ -258,7 +259,7 @@ private extension CategoryDetailView {
258259 var contentScrollView : some View {
259260 Group {
260261 if !store. isLoading {
261- if store. contents . isEmpty {
262+ if ! store. isContentsNotEmpty {
262263 VStack {
263264 PokitCaution (
264265 type: . 포킷상세_링크없음,
@@ -275,12 +276,23 @@ private extension CategoryDetailView {
275276 let isFirst = store. state. id == self . store. contents. first? . id
276277 let isLast = store. state. id == self . store. contents. last? . id
277278
278- ContentCardView (
279- store: store,
280- type: . linkList,
281- isFirst: isFirst,
282- isLast: isLast
283- )
279+ if !self . store. isFavoriteCategory {
280+ ContentCardView (
281+ store: store,
282+ type: . linkList,
283+ isFirst: isFirst,
284+ isLast: isLast
285+ )
286+ } else {
287+ if store. content. isFavorite == true {
288+ ContentCardView (
289+ store: store,
290+ type: . linkList,
291+ isFirst: isFirst,
292+ isLast: isLast
293+ )
294+ }
295+ }
284296 }
285297
286298 if store. hasNext {
0 commit comments