Skip to content

Commit c918e56

Browse files
committed
[fix] #196 즐겨찾기, 안읽음 중 둘 중 하나만 선택 가능, x 버튼 노출
1 parent 71abba6 commit c918e56

File tree

2 files changed

+49
-18
lines changed

2 files changed

+49
-18
lines changed

Projects/Feature/FeatureCategoryDetail/Sources/CategoryDetailFeature.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -198,8 +198,10 @@ private extension CategoryDetailFeature {
198198
case let .분류_버튼_눌렀을때(type):
199199
if type == .즐겨찾기 {
200200
state.domain.condition.isFavoriteFlitered.toggle()
201+
state.domain.condition.isUnreadFlitered = !state.domain.condition.isFavoriteFlitered
201202
} else {
202203
state.domain.condition.isUnreadFlitered.toggle()
204+
state.domain.condition.isFavoriteFlitered = !state.domain.condition.isUnreadFlitered
203205
}
204206
return .concatenate(
205207
.send(.inner(.pagenation_초기화), animation: .pokitDissolve),

Projects/Feature/FeatureCategoryDetail/Sources/CategoryDetailView.swift

Lines changed: 47 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -224,24 +224,9 @@ private extension CategoryDetailView {
224224
.foregroundStyle(.pokit(.text(.tertiary)))
225225
.pokitFont(.b2(.m))
226226
} else {
227-
PokitTextButton(
228-
"즐겨찾기",
229-
state: store.isFavoriteFiltered
230-
? .filled(.primary)
231-
: .default(.secondary),
232-
size: .small,
233-
shape: .round,
234-
action: { send(.분류_버튼_눌렀을때(.즐겨찾기)) }
235-
)
236-
PokitTextButton(
237-
"안읽음",
238-
state: store.isUnreadFiltered
239-
? .filled(.primary)
240-
: .default(.secondary),
241-
size: .small,
242-
shape: .round,
243-
action: { send(.분류_버튼_눌렀을때(.안읽음)) }
244-
)
227+
favoriteButton
228+
229+
unreadButton
245230
}
246231

247232
Spacer()
@@ -255,6 +240,50 @@ private extension CategoryDetailView {
255240
}
256241
}
257242

243+
@ViewBuilder
244+
var favoriteButton: some View {
245+
if store.isFavoriteFiltered {
246+
PokitIconRButton(
247+
"즐겨찾기",
248+
.icon(.x),
249+
state: .filled(.primary),
250+
size: .small,
251+
shape: .round,
252+
action: { send(.분류_버튼_눌렀을때(.즐겨찾기)) }
253+
)
254+
} else {
255+
PokitTextButton(
256+
"즐겨찾기",
257+
state: .default(.secondary),
258+
size: .small,
259+
shape: .round,
260+
action: { send(.분류_버튼_눌렀을때(.즐겨찾기)) }
261+
)
262+
}
263+
}
264+
265+
@ViewBuilder
266+
var unreadButton: some View {
267+
if store.isUnreadFiltered {
268+
PokitIconRButton(
269+
"안읽음",
270+
.icon(.x),
271+
state: .filled(.primary),
272+
size: .small,
273+
shape: .round,
274+
action: { send(.분류_버튼_눌렀을때(.안읽음)) }
275+
)
276+
} else {
277+
PokitTextButton(
278+
"안읽음",
279+
state: .default(.secondary),
280+
size: .small,
281+
shape: .round,
282+
action: { send(.분류_버튼_눌렀을때(.안읽음)) }
283+
)
284+
}
285+
}
286+
258287
var contentScrollView: some View {
259288
Group {
260289
if !store.isLoading {

0 commit comments

Comments
 (0)