From 07a383b9b9cc4f36e7f3b20593e66339558ccc04 Mon Sep 17 00:00:00 2001 From: minhokim Date: Fri, 22 Nov 2024 00:52:44 +0900 Subject: [PATCH 1/5] =?UTF-8?q?[feat]=20#156=20PokitCaution=20Type=20?= =?UTF-8?q?=EA=B5=AC=EC=84=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Sources/Components/PokitCaution.swift | 64 +++++++++++++++++++ 1 file changed, 64 insertions(+) diff --git a/Projects/DSKit/Sources/Components/PokitCaution.swift b/Projects/DSKit/Sources/Components/PokitCaution.swift index 93dfe80e..a72388a8 100644 --- a/Projects/DSKit/Sources/Components/PokitCaution.swift +++ b/Projects/DSKit/Sources/Components/PokitCaution.swift @@ -7,6 +7,70 @@ import SwiftUI +public enum CautionType { + case 카테고리없음 + case 미분류_링크없음 + case 링크없음 + case 즐겨찾기_링크없음 + case 링크부족 + case 알림없음 + + var image: PokitImage.Character { + switch self { + case .카테고리없음, .링크없음, .즐겨찾기_링크없음, .미분류_링크없음: + return .empty + case .링크부족: + return .sad + case .알림없음: + return .pooki + } + } + + var title: String { + switch self { + case .카테고리없음: + return "저장된 포킷이 없어요!" + case .미분류_링크없음: + return "미분류 링크가 없어요!" + case .링크없음: + return "저장된 링크가 없어요!" + case .즐겨찾기_링크없음: + return "즐겨찾기 링크가 없어요!" + case .링크부족: + return "링크가 부족해요!" + case .알림없음: + return "알림이 없어요" + } + } + + var message: String { + switch self { + case .카테고리없음: + return "포킷을 생성해 링크를 저장해보세요" + case .미분류_링크없음: + return "링크를 포킷에 깔끔하게 분류하셨어요" + case .링크없음: + return "다양한 링크를 한 곳에 저장해보세요" + case .즐겨찾기_링크없음: + return "링크를 즐겨찾기로 관리해보세요" + case .링크부족: + return "링크를 5개 이상 저장하고 추천을 받아보세요" + case .알림없음: + return "리마인드 알림을 설정하세요" + } + } + + var actionTitle: String? { + switch self { + case .카테고리없음: + return "포킷 추가하기" + case .미분류_링크없음: + return "링크 추가하기" + default: return nil + } + } +} + public struct PokitCaution: View { private let image: PokitImage.Character private let titleKey: String From 3b56c3030648b8d7b955969f71a0461f8c1bf722 Mon Sep 17 00:00:00 2001 From: minhokim Date: Fri, 22 Nov 2024 00:54:22 +0900 Subject: [PATCH 2/5] =?UTF-8?q?[fix]=20#156=20CautionType=20=EC=A0=81?= =?UTF-8?q?=EC=9A=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Sources/Components/PokitCaution.swift | 31 +++++++------------ .../DSKit/Sources/Components/PokitList.swift | 6 +--- .../Sources/CategoryDetailView.swift | 6 +--- .../CategorySharing/CategorySharingView.swift | 6 +--- .../Sources/ContentList/ContentListView.swift | 6 +--- .../FeaturePokit/Sources/PokitRootView.swift | 8 ++--- .../Sources/Remind/RemindView.swift | 18 ++--------- .../Sources/Alert/PokitAlertBoxView.swift | 6 +--- 8 files changed, 22 insertions(+), 65 deletions(-) diff --git a/Projects/DSKit/Sources/Components/PokitCaution.swift b/Projects/DSKit/Sources/Components/PokitCaution.swift index a72388a8..fea55d24 100644 --- a/Projects/DSKit/Sources/Components/PokitCaution.swift +++ b/Projects/DSKit/Sources/Components/PokitCaution.swift @@ -72,20 +72,14 @@ public enum CautionType { } public struct PokitCaution: View { - private let image: PokitImage.Character - private let titleKey: String - private let message: String + private let type: CautionType private let action: (() -> Void)? public init( - image: PokitImage.Character, - titleKey: String, - message: String, + type: CautionType, action: (() -> Void)? = nil ) { - self.image = image - self.titleKey = titleKey - self.message = message + self.type = type self.action = action } @@ -94,27 +88,28 @@ public struct PokitCaution: View { Spacer() VStack(spacing: 0) { - Image(.character(image)) + Image(.character(type.image)) .resizable() .aspectRatio(contentMode: .fill) .frame(width: 180, height: 180) .padding(.bottom, 16) - Text(titleKey) + Text(type.title) .pokitFont(.title2) .foregroundStyle(.pokit(.text(.secondary))) .padding(.bottom, 8) - Text(message) + Text(type.message) .pokitFont(.b2(.m)) .foregroundStyle(.pokit(.text(.secondary))) .padding(.bottom, 16) - if let action { + if let action, + let actionTitle = type.actionTitle { PokitTextButton( - "다시시도", - state: .default(.secondary), - size: .small, + actionTitle, + state: .stroke(.secondary), + size: .medium, shape: .rectangle, action: action ) @@ -128,9 +123,7 @@ public struct PokitCaution: View { #Preview { PokitCaution( - image: .empty, - titleKey: "저장된 포킷이 없어요!", - message: "포킷을 생성해 링크를 저장해보세요", + type: .미분류_링크없음, action: {} ) } diff --git a/Projects/DSKit/Sources/Components/PokitList.swift b/Projects/DSKit/Sources/Components/PokitList.swift index 872ea86e..c3ca1b6d 100644 --- a/Projects/DSKit/Sources/Components/PokitList.swift +++ b/Projects/DSKit/Sources/Components/PokitList.swift @@ -30,11 +30,7 @@ public struct PokitList: View { public var body: some View { if list.isEmpty { VStack { - PokitCaution( - image: .empty, - titleKey: "저장된 포킷이 없어요!", - message: "포킷을 생성해 링크를 저장해보세요" - ) + PokitCaution(type: .카테고리없음) Spacer() } diff --git a/Projects/Feature/FeatureCategoryDetail/Sources/CategoryDetailView.swift b/Projects/Feature/FeatureCategoryDetail/Sources/CategoryDetailView.swift index 5a066f7e..50eb73e7 100644 --- a/Projects/Feature/FeatureCategoryDetail/Sources/CategoryDetailView.swift +++ b/Projects/Feature/FeatureCategoryDetail/Sources/CategoryDetailView.swift @@ -140,11 +140,7 @@ private extension CategoryDetailView { if !store.isLoading { if store.contents.isEmpty { VStack { - PokitCaution( - image: .empty, - titleKey: "저장된 링크가 없어요!", - message: "다양한 링크를 한 곳에 저장해보세요" - ) + PokitCaution(type: .링크없음) .padding(.top, 20) Spacer() diff --git a/Projects/Feature/FeatureCategorySharing/Sources/CategorySharing/CategorySharingView.swift b/Projects/Feature/FeatureCategorySharing/Sources/CategorySharing/CategorySharingView.swift index 53e2844f..25b8502c 100644 --- a/Projects/Feature/FeatureCategorySharing/Sources/CategorySharing/CategorySharingView.swift +++ b/Projects/Feature/FeatureCategorySharing/Sources/CategorySharing/CategorySharingView.swift @@ -91,11 +91,7 @@ private extension CategorySharingView { if !store.isLoading { if store.contents.isEmpty { VStack { - PokitCaution( - image: .empty, - titleKey: "저장된 링크가 없어요!", - message: "다양한 링크를 한 곳에 저장해보세요" - ) + PokitCaution(type: .링크없음) .padding(.top, 20) Spacer() diff --git a/Projects/Feature/FeatureContentList/Sources/ContentList/ContentListView.swift b/Projects/Feature/FeatureContentList/Sources/ContentList/ContentListView.swift index e38a4713..b626fad1 100644 --- a/Projects/Feature/FeatureContentList/Sources/ContentList/ContentListView.swift +++ b/Projects/Feature/FeatureContentList/Sources/ContentList/ContentListView.swift @@ -89,11 +89,7 @@ private extension ContentListView { Group { if !store.isLoading { if store.contents.isEmpty { - PokitCaution( - image: .empty, - titleKey: "즐겨찾기 링크가 없어요!", - message: "링크를 즐겨찾기로 관리해보세요" - ) + PokitCaution(type: .즐겨찾기_링크없음) .padding(.top, 100) Spacer() diff --git a/Projects/Feature/FeaturePokit/Sources/PokitRootView.swift b/Projects/Feature/FeaturePokit/Sources/PokitRootView.swift index 912b10fb..482b8afc 100644 --- a/Projects/Feature/FeaturePokit/Sources/PokitRootView.swift +++ b/Projects/Feature/FeaturePokit/Sources/PokitRootView.swift @@ -125,9 +125,7 @@ private extension PokitRootView { if categories.isEmpty { VStack { PokitCaution( - image: .empty, - titleKey: "저장된 포킷이 없어요!", - message: "포킷을 생성해 링크를 저장해보세요" + type: .카테고리없음, ) .padding(.top, 36) @@ -171,9 +169,7 @@ private extension PokitRootView { if store.contents.isEmpty { VStack { PokitCaution( - image: .empty, - titleKey: "저장된 링크가 없어요!", - message: "다양한 링크를 한 곳에 저장해보세요" + type: .미분류_링크없음, ) .padding(.top, 36) diff --git a/Projects/Feature/FeatureRemind/Sources/Remind/RemindView.swift b/Projects/Feature/FeatureRemind/Sources/Remind/RemindView.swift index f4630aa5..98cdf65e 100644 --- a/Projects/Feature/FeatureRemind/Sources/Remind/RemindView.swift +++ b/Projects/Feature/FeatureRemind/Sources/Remind/RemindView.swift @@ -68,11 +68,7 @@ extension RemindView { unreadContents.isEmpty && favoriteContents.isEmpty { VStack { - PokitCaution( - image: .sad, - titleKey: "링크가 부족해요!", - message: "링크를 5개 이상 저장하고 추천을 받아보세요" - ) + PokitCaution(type: .링크부족) .padding(.top, 100) Spacer() @@ -111,11 +107,7 @@ extension RemindView { .padding(.horizontal, 20) if recommendedContents.isEmpty { - PokitCaution( - image: .sad, - titleKey: "링크가 부족해요!", - message: "링크를 5개 이상 저장하고 추천을 받아보세요" - ) + PokitCaution(type: .링크부족) .padding(.top, 24) .padding(.bottom, 32) } else { @@ -293,11 +285,7 @@ extension RemindView { .padding(.bottom, 16) if favoriteContents.isEmpty { - PokitCaution( - image: .empty, - titleKey: "즐겨찾기 링크가 없어요!", - message: "링크를 즐겨찾기로 관리해보세요" - ) + PokitCaution(type: .즐겨찾기_링크없음) .padding(.top, 16) } else { ForEach(favoriteContents, id: \.id) { content in diff --git a/Projects/Feature/FeatureSetting/Sources/Alert/PokitAlertBoxView.swift b/Projects/Feature/FeatureSetting/Sources/Alert/PokitAlertBoxView.swift index c7fff957..f0e1e0ce 100644 --- a/Projects/Feature/FeatureSetting/Sources/Alert/PokitAlertBoxView.swift +++ b/Projects/Feature/FeatureSetting/Sources/Alert/PokitAlertBoxView.swift @@ -29,11 +29,7 @@ public extension PokitAlertBoxView { if let alertContents = store.alertContents { if alertContents.isEmpty { VStack { - PokitCaution( - image: .pooki, - titleKey: "알림이 없어요", - message: "리마인드 알림을 설정하세요" - ) + PokitCaution(type: .알림없음) .padding(.top, 84) Spacer() } From 59f960fa09d10c31e41db18b4089852c0e3f6067 Mon Sep 17 00:00:00 2001 From: minhokim Date: Fri, 22 Nov 2024 00:55:00 +0900 Subject: [PATCH 3/5] =?UTF-8?q?[feat]=20#156=20empty=20=ED=99=94=EB=A9=B4?= =?UTF-8?q?=EC=97=90=EC=84=9C=20=EC=B9=B4=ED=85=8C=EA=B3=A0=EB=A6=AC=20?= =?UTF-8?q?=EC=B6=94=EA=B0=80,=20=EB=A7=81=ED=81=AC=EC=B6=94=EA=B0=80=20?= =?UTF-8?q?=EC=95=A1=EC=85=98=20=EC=A0=81=EC=9A=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Projects/App/Sources/MainTab/MainTabPath.swift | 6 ++++-- .../FeaturePokit/Sources/PokitRootFeature.swift | 11 +++++++++++ .../Feature/FeaturePokit/Sources/PokitRootView.swift | 2 ++ 3 files changed, 17 insertions(+), 2 deletions(-) diff --git a/Projects/App/Sources/MainTab/MainTabPath.swift b/Projects/App/Sources/MainTab/MainTabPath.swift index d61bc262..09714197 100644 --- a/Projects/App/Sources/MainTab/MainTabPath.swift +++ b/Projects/App/Sources/MainTab/MainTabPath.swift @@ -90,7 +90,8 @@ public extension MainTabFeature { /// - 포킷 `추가` 버튼 눌렀을 때 case .delegate(.포킷추가하기), - .path(.element(_, action: .링크추가및수정(.delegate(.포킷추가하기)))): + .path(.element(_, action: .링크추가및수정(.delegate(.포킷추가하기)))), + .pokit(.delegate(.포킷추가_버튼_눌렀을때)): state.path.append(.포킷추가및수정(PokitCategorySettingFeature.State(type: .추가))) return .none @@ -164,7 +165,8 @@ public extension MainTabFeature { state.path.append(.링크추가및수정(ContentSettingFeature.State(contentId: id))) return .none /// - 링크 추가하기 - case .delegate(.링크추가하기): + case .delegate(.링크추가하기), + .pokit(.delegate(.링크추가_버튼_눌렀을때)): state.categoryId = nil state.path.append(.링크추가및수정(ContentSettingFeature.State(urlText: state.link))) state.link = nil diff --git a/Projects/Feature/FeaturePokit/Sources/PokitRootFeature.swift b/Projects/Feature/FeaturePokit/Sources/PokitRootFeature.swift index 87ec21cf..30b93937 100644 --- a/Projects/Feature/FeaturePokit/Sources/PokitRootFeature.swift +++ b/Projects/Feature/FeaturePokit/Sources/PokitRootFeature.swift @@ -72,6 +72,8 @@ public struct PokitRootFeature { case 분류_버튼_눌렀을때 case 케밥_버튼_눌렀을때(BaseCategoryItem) case 미분류_케밥_버튼_눌렀을때(BaseContentItem) + case 포킷추가_버튼_눌렀을때 + case 링크추가_버튼_눌렀을때 case 카테고리_눌렀을때(BaseCategoryItem) case 컨텐츠_항목_눌렀을때(BaseContentItem) case 링크_공유_완료되었을때 @@ -123,6 +125,9 @@ public struct PokitRootFeature { /// 링크상세로 이동 case contentDetailTapped(BaseContentItem) case 미분류_카테고리_컨텐츠_조회 + + case 포킷추가_버튼_눌렀을때 + case 링크추가_버튼_눌렀을때 } } @@ -209,6 +214,12 @@ private extension PokitRootFeature { case .미분류_케밥_버튼_눌렀을때(let selectedItem): state.selectedUnclassifiedItem = selectedItem return .run { send in await send(.inner(.카테고리_시트_활성화(true))) } + + case .포킷추가_버튼_눌렀을때: + return .run { send in await send(.delegate(.포킷추가_버튼_눌렀을때)) } + + case .링크추가_버튼_눌렀을때: + return .run { send in await send(.delegate(.링크추가_버튼_눌렀을때)) } case .카테고리_눌렀을때(let category): return .run { send in await send(.delegate(.categoryTapped(category))) } diff --git a/Projects/Feature/FeaturePokit/Sources/PokitRootView.swift b/Projects/Feature/FeaturePokit/Sources/PokitRootView.swift index 482b8afc..741c383e 100644 --- a/Projects/Feature/FeaturePokit/Sources/PokitRootView.swift +++ b/Projects/Feature/FeaturePokit/Sources/PokitRootView.swift @@ -126,6 +126,7 @@ private extension PokitRootView { VStack { PokitCaution( type: .카테고리없음, + action: { send(.포킷추가_버튼_눌렀을때) } ) .padding(.top, 36) @@ -170,6 +171,7 @@ private extension PokitRootView { VStack { PokitCaution( type: .미분류_링크없음, + action: { send(.링크추가_버튼_눌렀을때) } ) .padding(.top, 36) From 6262281296d2283bc4086d51aeadd8ccead8fd80 Mon Sep 17 00:00:00 2001 From: minhokim Date: Fri, 22 Nov 2024 00:55:22 +0900 Subject: [PATCH 4/5] =?UTF-8?q?[fix]=20#156=20=EA=B2=80=EC=83=89=EB=B0=94?= =?UTF-8?q?=20placeholder=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Feature/FeatureSetting/Sources/Search/PokitSearchView.swift | 1 + 1 file changed, 1 insertion(+) diff --git a/Projects/Feature/FeatureSetting/Sources/Search/PokitSearchView.swift b/Projects/Feature/FeatureSetting/Sources/Search/PokitSearchView.swift index e0938d6e..016dd7fb 100644 --- a/Projects/Feature/FeatureSetting/Sources/Search/PokitSearchView.swift +++ b/Projects/Feature/FeatureSetting/Sources/Search/PokitSearchView.swift @@ -89,6 +89,7 @@ private extension PokitSearchView { PokitIconRInput( text: $store.searchText, icon: store.isSearching ? .icon(.x) : .icon(.search), + placeholder: "제목, 메모를 검색해보세요.", shape: .round, focusState: $focused, equals: true, From b04f89bb5cb928da3cabd18efe6cbf1138f01030 Mon Sep 17 00:00:00 2001 From: minhokim Date: Fri, 22 Nov 2024 00:55:34 +0900 Subject: [PATCH 5/5] =?UTF-8?q?[fix]=20#156=201.0.5=20=EB=B2=84=EC=A0=84?= =?UTF-8?q?=EC=97=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Projects/App/Resources/Pokit-info.plist | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Projects/App/Resources/Pokit-info.plist b/Projects/App/Resources/Pokit-info.plist index af5f75f4..ab1b69d0 100644 --- a/Projects/App/Resources/Pokit-info.plist +++ b/Projects/App/Resources/Pokit-info.plist @@ -21,7 +21,7 @@ CFBundlePackageType APPL CFBundleShortVersionString - 1.0.4 + 1.0.5 CFBundleURLTypes