Skip to content

Commit c42cd62

Browse files
committed
[design] #183 포킷 상세 화면 디자인 적용
- 필터외부로 이동 (즐겨찾기 / 안읽음 / 정렬) - 링크추가 float button - 카테고리 케밥 버튼의 공유하기 외부로 이동
1 parent 33d4971 commit c42cd62

File tree

1 file changed

+89
-19
lines changed

1 file changed

+89
-19
lines changed

Projects/Feature/FeatureCategoryDetail/Sources/CategoryDetailView.swift

Lines changed: 89 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import FeatureContentCard
1111
import Domain
1212
import DSKit
1313
import Util
14+
import NukeUI
1415

1516
@ViewAction(for: CategoryDetailFeature.self)
1617
public struct CategoryDetailView: View {
@@ -27,13 +28,16 @@ public struct CategoryDetailView: View {
2728
public extension CategoryDetailView {
2829
var body: some View {
2930
WithPerceptionTracking {
30-
VStack(spacing: 16) {
31+
VStack(spacing: 24) {
3132
header
33+
PokitDivider().padding(.horizontal, -20)
34+
filterHeader
3235
contentScrollView
3336
}
3437
.padding(.horizontal, 20)
3538
.padding(.top, 12)
3639
.pokitNavigationBar { navigationBar }
40+
.pokitFloatButton(action: {})
3741
.ignoresSafeArea(edges: .bottom)
3842
.sheet(isPresented: $store.isCategorySheetPresented) {
3943
PokitBottomSheet(
@@ -93,8 +97,23 @@ private extension CategoryDetailView {
9397
.padding(.top, 8)
9498
}
9599

100+
@MainActor
96101
var header: some View {
97-
VStack(spacing: 4) {
102+
VStack(spacing: 0) {
103+
LazyImage(url: URL(string: store.category.categoryImage.imageURL)) { state in
104+
Group {
105+
if let image = state.image {
106+
image
107+
.resizable()
108+
} else {
109+
PokitSpinner()
110+
.foregroundStyle(.pokit(.icon(.brand)))
111+
}
112+
}
113+
.frame(width: 100, height: 100)
114+
.animation(.pokitDissolve, value: state.image)
115+
}
116+
.padding(.bottom, 2)
98117
HStack(spacing: 8) {
99118
/// cateogry title
100119
Button(action: { send(.카테고리_선택_버튼_눌렀을때) }) {
@@ -105,24 +124,75 @@ private extension CategoryDetailView {
105124
.resizable()
106125
.frame(width: 24, height: 24)
107126
.foregroundStyle(.pokit(.icon(.primary)))
108-
Spacer()
109127
}
110128
.buttonStyle(.plain)
111129
}
112-
HStack {
113-
Text("링크 \(store.category.contentCount)")
114-
.foregroundStyle(.pokit(.text(.secondary)))
115-
.pokitFont(.detail1)
116-
Spacer()
117-
PokitIconLButton(
118-
"필터",
119-
.icon(.filter),
120-
state: .filled(.primary),
121-
size: .small,
122-
shape: .round,
123-
action: { send(.필터_버튼_눌렀을때) }
124-
)
130+
.padding(.bottom, 8)
131+
HStack(spacing: 3.5) {
132+
let iconColor: Color = .pokit(.icon(.secondary))
133+
let textColor: Color = .pokit(.text(.tertiary))
134+
135+
if store.category.openType == .비공개 {
136+
HStack(spacing: 2) {
137+
Image(.icon(.lock))
138+
.resizable()
139+
.frame(width: 16, height: 16)
140+
.foregroundStyle(iconColor)
141+
Text("비밀")
142+
.foregroundStyle(textColor)
143+
.pokitFont(.b2(.m))
144+
}
145+
}
146+
HStack(spacing: 2) {
147+
Image(.icon(.link))
148+
.resizable()
149+
.frame(width: 16, height: 16)
150+
.foregroundStyle(iconColor)
151+
Text("\(store.category.contentCount)")
152+
.foregroundStyle(textColor)
153+
.pokitFont(.b2(.m))
154+
}
155+
Text("#\(store.category.keywordType.title)")
156+
.foregroundStyle(textColor)
157+
.pokitFont(.b2(.m))
158+
.padding(.leading, 4.5)
125159
}
160+
.padding(.bottom, 16)
161+
PokitIconLButton(
162+
"공유",
163+
.icon(.share),
164+
state: .filled(.primary),
165+
size: .medium,
166+
shape: .round,
167+
action: {}
168+
)
169+
}
170+
}
171+
172+
var filterHeader: some View {
173+
HStack(spacing: 8) {
174+
PokitTextButton(
175+
"즐겨찾기",
176+
state: .filled(.primary),
177+
size: .small,
178+
shape: .round,
179+
action: {}
180+
)
181+
PokitTextButton(
182+
"안읽음",
183+
state: .filled(.primary),
184+
size: .small,
185+
shape: .round,
186+
action: {}
187+
)
188+
189+
Spacer()
190+
PokitIconLTextLink(
191+
"최신순",
192+
icon: .icon(.align),
193+
action: {}
194+
)
195+
.contentTransition(.numericText())
126196
}
127197
}
128198

@@ -132,7 +202,7 @@ private extension CategoryDetailView {
132202
if store.contents.isEmpty {
133203
VStack {
134204
PokitCaution(type: .링크없음)
135-
.padding(.top, 20)
205+
.padding(.top, 20)
136206

137207
Spacer()
138208
}
@@ -204,8 +274,8 @@ private extension CategoryDetailView {
204274
id: 0,
205275
userId: 0,
206276
categoryName: "포킷",
207-
categoryImage: .init(imageId: 0, imageURL: ""),
208-
contentCount: 16,
277+
categoryImage: .init(imageId: 0, imageURL: Constants.mockImageUrl),
278+
contentCount: 16,
209279
createdAt: "",
210280
//TODO: v2 property 수정
211281
openType: .비공개,

0 commit comments

Comments
 (0)