@@ -111,28 +111,31 @@ private extension PokitSearchView {
111111 . padding ( . horizontal, 20 )
112112 }
113113
114+ @ViewBuilder
114115 var recentSearch : some View {
115- VStack ( spacing: 20 ) {
116- recentSearchTitle
117-
118- if store. isSearching {
119- filterToolbar
120- } else if store. isAutoSaveSearch {
121- if store. recentSearchTexts. isEmpty {
122- Text ( " 검색 내역이 없습니다. " )
116+ if store. isSearching {
117+ filterToolbar
118+ } else {
119+ VStack ( spacing: 20 ) {
120+ recentSearchTitle
121+
122+ if store. isAutoSaveSearch {
123+ if store. recentSearchTexts. isEmpty {
124+ Text ( " 검색 내역이 없습니다. " )
125+ . pokitFont ( . b3( . r) )
126+ . foregroundStyle ( . pokit( . text( . tertiary) ) )
127+ . pokitBlurReplaceTransition ( . pokitDissolve)
128+ . padding ( . vertical, 5 )
129+ } else {
130+ recentSearchList
131+ }
132+ } else {
133+ Text ( " 최근 검색 저장 기능이 꺼져있습니다. " )
123134 . pokitFont ( . b3( . r) )
124135 . foregroundStyle ( . pokit( . text( . tertiary) ) )
125136 . pokitBlurReplaceTransition ( . pokitDissolve)
126137 . padding ( . vertical, 5 )
127- } else {
128- recentSearchList
129138 }
130- } else {
131- Text ( " 최근 검색 저장 기능이 꺼져있습니다. " )
132- . pokitFont ( . b3( . r) )
133- . foregroundStyle ( . pokit( . text( . tertiary) ) )
134- . pokitBlurReplaceTransition ( . pokitDissolve)
135- . padding ( . vertical, 5 )
136139 }
137140 }
138141 }
@@ -195,68 +198,64 @@ private extension PokitSearchView {
195198 )
196199 }
197200
201+ @ViewBuilder
198202 var categoryFilterButton : some View {
199- Group {
200- if store. categoryFilter. isEmpty {
201- PokitIconRChip (
202- " 포킷 " ,
203- icon: . icon( . arrowDown) ,
204- state: . default( . primary) ,
205- size: . small,
206- action: { send ( . 카테고리_버튼_눌렀을때) }
207- )
208- } else {
209- ForEach ( store. categoryFilter) { category in
210- PokitIconRChip (
211- category. categoryName,
212- state: . stroke( . primary) ,
213- size: . small,
214- action: { send ( . 카테고리_태그_눌렀을때( category: category) , animation: . pokitSpring) }
215- )
216- . pokitBlurReplaceTransition ( . pokitDissolve)
217- }
218- }
203+ if store. categoryFilter. isEmpty {
204+ PokitIconRChip (
205+ " 포킷 " ,
206+ icon: . icon( . arrowDown) ,
207+ state: . default( . primary) ,
208+ size: . small,
209+ action: { send ( . 카테고리_버튼_눌렀을때) }
210+ )
211+ } else {
212+ let firstName = store. categoryFilter. first? . categoryName ?? " "
213+ let text = store. categoryFilter. count == 1
214+ ? firstName
215+ : firstName + " 외 \( store. categoryFilter. count - 1 ) "
216+
217+ PokitIconRChip (
218+ text,
219+ icon: . icon( . arrowDown) ,
220+ state: . stroke( . primary) ,
221+ size: . small,
222+ action: { send ( . 카테고리_태그_눌렀을때, animation: . pokitSpring) }
223+ )
224+ . pokitBlurReplaceTransition ( . pokitDissolve)
219225 }
220226 }
221227
228+ @ViewBuilder
222229 var contentTypeFilterButton : some View {
223- Group {
224- if !store. favoriteFilter && !store. unreadFilter {
225- PokitIconRChip (
226- " 모아보기 " ,
227- icon: . icon( . arrowDown) ,
228- state: . default( . primary) ,
229- size: . small,
230- action: { send ( . 모아보기_버튼_눌렀을때) }
231- )
232- } else {
233- if store. favoriteFilter {
234- PokitIconRChip (
235- " 즐겨찾기 " ,
236- state: . stroke( . primary) ,
237- size: . small,
238- action: { send ( . 즐겨찾기_태그_눌렀을때, animation: . pokitSpring) }
239- )
240- . pokitBlurReplaceTransition ( . pokitDissolve)
241- }
242-
243- if store. unreadFilter {
244- PokitIconRChip (
245- " 안읽음 " ,
246- state: . stroke( . primary) ,
247- size: . small,
248- action: { send ( . 안읽음_태그_눌렀을때, animation: . pokitSpring) }
249- )
250- . pokitBlurReplaceTransition ( . pokitDissolve)
251- }
252- }
230+ if !store. favoriteFilter && !store. unreadFilter {
231+ PokitIconRChip (
232+ " 모아보기 " ,
233+ icon: . icon( . arrowDown) ,
234+ state: . default( . primary) ,
235+ size: . small,
236+ action: { send ( . 모아보기_버튼_눌렀을때) }
237+ )
238+ } else {
239+ let contentTypes = [
240+ store. favoriteFilter ? " 즐겨찾기 " : nil ,
241+ store. unreadFilter ? " 안읽음 " : nil
242+ ] . compactMap ( \. self) . joined ( separator: " , " )
243+
244+ PokitIconRChip (
245+ contentTypes,
246+ icon: . icon( . arrowDown) ,
247+ state: . stroke( . primary) ,
248+ size: . small,
249+ action: { send ( . 컨텐츠_타입_태그_눌렀을때, animation: . pokitSpring) }
250+ )
251+ . pokitBlurReplaceTransition ( . pokitDissolve)
253252 }
254253 }
255254
256255 var dateFilterButton : some View {
257256 PokitIconRChip (
258257 store. dateFilterText,
259- icon: store . dateFilterText == " 기간 " ? . icon( . arrowDown) : . icon ( . x ) ,
258+ icon: . icon( . arrowDown) ,
260259 state: store. dateFilterText == " 기간 " ? . default( . primary) : . stroke( . primary) ,
261260 size: . small,
262261 action: { send ( . 기간_버튼_눌렀을때, animation: . pokitSpring) }
0 commit comments