Skip to content

Commit 415b999

Browse files
committed
[feat] #183 상세 화면 내 링크가 없을 때 화면 구성
- 정렬 숨기기 - 링크 추가 float버튼 숨기기 - empty화면의 링크 추가 case 수정
1 parent 6e5c49b commit 415b999

File tree

2 files changed

+61
-34
lines changed

2 files changed

+61
-34
lines changed

Projects/DSKit/Sources/Components/PokitCaution.swift

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,19 +10,21 @@ import SwiftUI
1010
public enum CautionType {
1111
case 카테고리없음
1212
case 미분류_링크없음
13+
case 포킷상세_링크없음
1314
case 링크없음
1415
case 즐겨찾기_링크없음
1516
case 링크부족
1617
case 알림없음
1718

1819
var image: PokitImage.Character {
1920
switch self {
20-
case .카테고리없음, .링크없음, .즐겨찾기_링크없음, .미분류_링크없음:
21-
return .empty
2221
case .링크부족:
2322
return .sad
23+
2424
case .알림없음:
2525
return .pooki
26+
27+
default: return .empty
2628
}
2729
}
2830

@@ -32,7 +34,7 @@ public enum CautionType {
3234
return "저장된 포킷이 없어요!"
3335
case .미분류_링크없음:
3436
return "미분류 링크가 없어요!"
35-
case .링크없음:
37+
case .링크없음, .포킷상세_링크없음:
3638
return "저장된 링크가 없어요!"
3739
case .즐겨찾기_링크없음:
3840
return "즐겨찾기 링크가 없어요!"
@@ -49,6 +51,8 @@ public enum CautionType {
4951
return "포킷을 생성해 링크를 저장해보세요"
5052
case .미분류_링크없음:
5153
return "링크를 포킷에 깔끔하게 분류하셨어요"
54+
case .포킷상세_링크없음:
55+
return "포킷에 링크를 저장해보세요"
5256
case .링크없음:
5357
return "다양한 링크를 한 곳에 저장해보세요"
5458
case .즐겨찾기_링크없음:
@@ -64,7 +68,7 @@ public enum CautionType {
6468
switch self {
6569
case .카테고리없음:
6670
return "포킷 추가하기"
67-
case .미분류_링크없음:
71+
case .미분류_링크없음, .포킷상세_링크없음:
6872
return "링크 추가하기"
6973
default: return nil
7074
}

Projects/Feature/FeatureCategoryDetail/Sources/CategoryDetailView.swift

Lines changed: 53 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,25 @@ public extension CategoryDetailView {
3737
.padding(.horizontal, 20)
3838
.padding(.top, 12)
3939
.pokitNavigationBar { navigationBar }
40-
.pokitFloatButton(action: { send(.링크_추가_버튼_눌렀을때) })
40+
//TODO: overlay(condition) merge 시 수정
41+
.overlay(alignment: .bottomTrailing) {
42+
if !store.contents.isEmpty {
43+
Button(action: { send(.링크_추가_버튼_눌렀을때) }) {
44+
Image(.icon(.plus))
45+
.resizable()
46+
.frame(width: 36, height: 36)
47+
.padding(12)
48+
.foregroundStyle(.pokit(.icon(.inverseWh)))
49+
.background {
50+
RoundedRectangle(cornerRadius: 9999, style: .continuous)
51+
.fill(.pokit(.bg(.brand)))
52+
}
53+
.frame(width: 60, height: 60)
54+
}
55+
.padding(.trailing, 20)
56+
.padding(.bottom, 39)
57+
}
58+
}
4159
.ignoresSafeArea(edges: .bottom)
4260
.sheet(isPresented: $store.isCategorySheetPresented) {
4361
PokitBottomSheet(
@@ -160,34 +178,37 @@ private extension CategoryDetailView {
160178
}
161179
}
162180

181+
@ViewBuilder
163182
var filterHeader: some View {
164-
HStack(spacing: 8) {
165-
PokitTextButton(
166-
"즐겨찾기",
167-
state: store.isFavoriteFiltered
168-
? .filled(.primary)
169-
: .default(.secondary),
170-
size: .small,
171-
shape: .round,
172-
action: { send(.분류_버튼_눌렀을때(.즐겨찾기)) }
173-
)
174-
PokitTextButton(
175-
"안읽음",
176-
state: store.isUnreadFiltered
177-
? .filled(.primary)
178-
: .default(.secondary),
179-
size: .small,
180-
shape: .round,
181-
action: { send(.분류_버튼_눌렀을때(.안읽음)) }
182-
)
183-
184-
Spacer()
185-
PokitIconLTextLink(
186-
store.sortType.title,
187-
icon: .icon(.align),
188-
action: { send(.정렬_버튼_눌렀을때) }
189-
)
190-
.contentTransition(.numericText())
183+
if !store.contents.isEmpty {
184+
HStack(spacing: 8) {
185+
PokitTextButton(
186+
"즐겨찾기",
187+
state: store.isFavoriteFiltered
188+
? .filled(.primary)
189+
: .default(.secondary),
190+
size: .small,
191+
shape: .round,
192+
action: { send(.분류_버튼_눌렀을때(.즐겨찾기)) }
193+
)
194+
PokitTextButton(
195+
"안읽음",
196+
state: store.isUnreadFiltered
197+
? .filled(.primary)
198+
: .default(.secondary),
199+
size: .small,
200+
shape: .round,
201+
action: { send(.분류_버튼_눌렀을때(.안읽음)) }
202+
)
203+
204+
Spacer()
205+
PokitIconLTextLink(
206+
store.sortType.title,
207+
icon: .icon(.align),
208+
action: { send(.정렬_버튼_눌렀을때) }
209+
)
210+
.contentTransition(.numericText())
211+
}
191212
}
192213
}
193214

@@ -196,8 +217,10 @@ private extension CategoryDetailView {
196217
if !store.isLoading {
197218
if store.contents.isEmpty {
198219
VStack {
199-
PokitCaution(type: .링크없음)
200-
.padding(.top, 20)
220+
PokitCaution(
221+
type: .포킷상세_링크없음,
222+
action: { send(.링크_추가_버튼_눌렀을때) }
223+
)
201224

202225
Spacer()
203226
}

0 commit comments

Comments
 (0)