Skip to content

Commit c3e2814

Browse files
authored
Merge pull request #200 from YAPP-Github/fix/#199-qa-final
Fix/#199 qa final
2 parents b08f9af + 5d25d84 commit c3e2814

File tree

9 files changed

+44
-41
lines changed

9 files changed

+44
-41
lines changed

โ€ŽProjects/App/Sources/MainTab/MainTabPath.swiftโ€Ž

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,13 @@ public extension MainTabFeature {
101101
/// - ํฌํ‚ท `์ถ”๊ฐ€` or `์ˆ˜์ •`์ด ์„ฑ๊ณต์ ์œผ๋กœ `์™„๋ฃŒ`๋˜์—ˆ์„ ๋•Œ
102102
case .path(.element(_, action: .ํฌํ‚ท์ถ”๊ฐ€๋ฐ์ˆ˜์ •(.delegate(.settingSuccess)))):
103103
state.path.removeLast()
104-
guard let lastPath = state.path.last else { return .none }
104+
guard let lastPath = state.path.last else {
105+
switch state.selectedTab {
106+
case .pokit: return .none
107+
case .recommend:
108+
return .send(.recommend(.delegate(.ํฌํ‚ท_์ถ”๊ฐ€ํ•˜๊ธฐ_์™„๋ฃŒ)))
109+
}
110+
}
105111
switch lastPath {
106112
case .๋งํฌ๊ณต์œ :
107113
state.path.removeLast()

โ€ŽProjects/DSKit/Sources/Components/PokitLinkCard.swiftโ€Ž

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -175,9 +175,6 @@ public struct PokitLinkCard<Item: PokitLinkCardItem>: View {
175175
image
176176
.resizable()
177177
.aspectRatio(contentMode: .fill)
178-
} else if phase.error != nil {
179-
placeholder
180-
.onAppear { fetchMetaData?() }
181178
} else {
182179
placeholder
183180
}
@@ -186,6 +183,10 @@ public struct PokitLinkCard<Item: PokitLinkCardItem>: View {
186183
.frame(width: 124, height: 94)
187184
.clipShape(RoundedRectangle(cornerRadius: 8, style: .continuous))
188185
}
186+
.onCompletion { result in
187+
guard case .failure(_) = result else { return }
188+
fetchMetaData?()
189+
}
189190
}
190191

191192
private var divider: some View {

โ€ŽProjects/Domain/Sources/Base/BaseInterest.swiftโ€Ž

Lines changed: 1 addition & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import Foundation
99

1010
public struct BaseInterest: Equatable, Identifiable, Hashable {
1111
public let id = UUID()
12-
public let code: Code
12+
public let code: String
1313
public let description: String
1414

1515
public func hash(into hasher: inout Hasher) {
@@ -19,29 +19,4 @@ public struct BaseInterest: Equatable, Identifiable, Hashable {
1919
public static func ==(lhs: BaseInterest, rhs: BaseInterest) -> Bool {
2020
lhs.code == rhs.code
2121
}
22-
23-
public init(code: Code, description: String) {
24-
self.code = code
25-
self.description = description
26-
}
27-
}
28-
29-
extension BaseInterest {
30-
public enum Code: String {
31-
case `default` = "DEFAULT"
32-
case ์Šคํฌ์ธ _๋ ˆ์ € = "SPORTS"
33-
case ๋ฌธ๊ตฌ_์˜คํ”ผ์Šค = "OFFICE"
34-
case ํŒจ์…˜ = "FASHION"
35-
case ์—ฌํ–‰ = "TRAVEL"
36-
case ๊ฒฝ์ œ_์‹œ์‚ฌ = "ECONOMY"
37-
case ์˜ํ™”_๋“œ๋ผ๋งˆ = "MOVIE_DRAMA"
38-
case ๋ง›์ง‘ = "RESTAURANT"
39-
case ์ธํ…Œ๋ฆฌ์–ด = "INTERIOR"
40-
case IT = "IT"
41-
case ๋””์ž์ธ = "DESIGN"
42-
case ์ž๊ธฐ๊ณ„๋ฐœ = "SELF_IMPROVEMENT"
43-
case ์œ ๋จธ = "HUMOR"
44-
case ์Œ์•… = "MUSIC"
45-
case ์ทจ์—…์ •๋ณด = "JOB_INFO"
46-
}
4722
}

โ€ŽProjects/Domain/Sources/DTO/Base/BaseInterest+Extension.swiftโ€Ž

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import CoreKit
1212
public extension InterestResponse {
1313
func toDomian() -> BaseInterest {
1414
return BaseInterest(
15-
code: BaseInterest.Code(rawValue: self.code) ?? .default,
15+
code: self.code,
1616
description: self.description
1717
)
1818
}

โ€ŽProjects/Feature/FeatureContentCard/Sources/ContentCard/ContentCardFeature.swiftโ€Ž

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -148,9 +148,8 @@ private extension ContentCardFeature {
148148
return .none
149149
}
150150
return .run { send in
151-
let imageURL = try await swiftSoupClient.parseOGImageURL(url)
152-
guard let imageURL else { return }
153-
await send(.inner(.๋ฉ”ํƒ€๋ฐ์ดํ„ฐ_์กฐํšŒ_์ˆ˜ํ–‰_๋ฐ˜์˜(imageURL)))
151+
let imageURL = try? await swiftSoupClient.parseOGImageURL(url)
152+
await send(.inner(.๋ฉ”ํƒ€๋ฐ์ดํ„ฐ_์กฐํšŒ_์ˆ˜ํ–‰_๋ฐ˜์˜(imageURL ?? Constants.๊ธฐ๋ณธ_์ธ๋„ค์ผ_์ฃผ์†Œ.absoluteString)))
154153
}
155154
case .์ฆ๊ฒจ์ฐพ๊ธฐ_API:
156155
return .run { [id = state.content.id] send in

โ€ŽProjects/Feature/FeatureContentSetting/Sources/ContentSetting/ContentSettingFeature.swiftโ€Ž

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -253,9 +253,9 @@ private extension ContentSettingFeature {
253253
return .none
254254
case .๋ฉ”ํƒ€๋ฐ์ดํ„ฐ_์กฐํšŒ_์ˆ˜ํ–‰(url: let url):
255255
return .run { send in
256-
async let title = swiftSoup.parseOGTitle(url)
257-
async let imageURL = swiftSoup.parseOGImageURL(url)
258-
try await send(
256+
async let title = try? swiftSoup.parseOGTitle(url)
257+
async let imageURL = try? swiftSoup.parseOGImageURL(url)
258+
await send(
259259
.inner(.๋ฉ”ํƒ€๋ฐ์ดํ…จ_์กฐํšŒ_๋ฐ˜์˜(title: title, imageURL: imageURL)),
260260
animation: .pokitDissolve
261261
)

โ€ŽProjects/Feature/FeatureRecommend/Sources/Recommend/RecommendFeature.swiftโ€Ž

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,7 @@ public struct RecommendFeature {
120120
case ์•Œ๋ฆผ_๋ฒ„ํŠผ_๋ˆŒ๋ €์„๋•Œ
121121
case ์ปจํ…์ธ _์‹ ๊ณ _API_๋ฐ˜์˜
122122
case ํฌํ‚ท_์ถ”๊ฐ€ํ•˜๊ธฐ_๋ฒ„ํŠผ_๋ˆŒ๋ €์„๋•Œ
123+
case ํฌํ‚ท_์ถ”๊ฐ€ํ•˜๊ธฐ_์™„๋ฃŒ
123124
}
124125
}
125126

@@ -259,7 +260,7 @@ private extension RecommendFeature {
259260
return .none
260261
case let .๊ด€์‹ฌ์‚ฌ_์กฐํšŒ_API_๋ฐ˜์˜(interests):
261262
state.domain.interests = interests.filter({ interest in
262-
interest.code != .default
263+
interest.code != "default"
263264
})
264265
state.showKeywordSheet = true
265266
return .none
@@ -371,7 +372,16 @@ private extension RecommendFeature {
371372

372373
/// - Delegate Effect
373374
func handleDelegateAction(_ action: Action.DelegateAction, state: inout State) -> Effect<Action> {
374-
return .none
375+
switch action {
376+
case .ํฌํ‚ท_์ถ”๊ฐ€ํ•˜๊ธฐ_์™„๋ฃŒ:
377+
guard state.addContent != nil else { return .none }
378+
state.showSelectSheet = true
379+
return shared(.async(.์นดํ…Œ๊ณ ๋ฆฌ_๋ชฉ๋ก_์กฐํšŒ_API), state: &state)
380+
case .์ €์žฅํ•˜๊ธฐ_์™„๋ฃŒ:
381+
state.addContent = nil
382+
return .none
383+
default: return .none
384+
}
375385
}
376386

377387
/// - Shared Effect

โ€ŽProjects/Feature/FeatureRecommend/Sources/Recommend/RecommendKeywordBottomSheet.swiftโ€Ž

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ struct RecommendKeywordBottomSheet: View {
1616
private var selectedInterests: Set<BaseInterest>
1717
@State
1818
private var height: CGFloat = 0
19+
@State
20+
private var isTouchActive: Bool = false
1921

2022
private let interests: [BaseInterest]
2123
private let onSave: ((Set<BaseInterest>) -> Void)?
@@ -70,6 +72,7 @@ struct RecommendKeywordBottomSheet: View {
7072
}
7173
.presentationDetents([.height(height)])
7274
.ignoresSafeArea(edges: [.bottom, .top])
75+
.onDisappear { onSave?(selectedInterests) }
7376
}
7477

7578
func onSave(_ perform: @escaping (Set<BaseInterest>) -> Void) -> Self {
@@ -112,15 +115,24 @@ extension RecommendKeywordBottomSheet {
112115
: isMaxCount ? .disable : .default(.primary),
113116
size: .medium
114117
) {
118+
guard !isTouchActive else { return }
119+
115120
if isSelected {
116121
selectedInterests.remove(field)
117122
} else {
118-
selectedInterests.insert(field)
123+
if selectedInterests.count < 3 {
124+
selectedInterests.insert(field)
125+
}
119126
}
120127
}
121128
}
122129
.animation(.pokitDissolve, value: selectedInterests)
123130
}
131+
.simultaneousGesture(
132+
DragGesture(minimumDistance: 0)
133+
.onChanged { _ in isTouchActive = true }
134+
.onEnded { _ in isTouchActive = false }
135+
)
124136
}
125137
}
126138

โ€ŽProjects/Util/Sources/Constants.swiftโ€Ž

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ public enum Constants {
2323
public static let ๊ฐœ์ธ์ •๋ณด_์ฒ˜๋ฆฌ๋ฐฉ์นจ_์ฃผ์†Œ: URL = URL(string: "https://www.notion.so/de3468b3be1744538c22a333ae1d0ec8")!
2424
public static let ๋งˆ์ผ€ํŒ…_์ •๋ณด_์ˆ˜์‹ _์ฃผ์†Œ: URL = URL(string: "https://www.notion.so/bb6d0d6569204d5e9a7b67e5825f9d10")!
2525
public static let ๊ณ ๊ฐ๋ฌธ์˜_์ฃผ์†Œ: URL = URL(string: "https://www.instagram.com/pokit.official/")!
26-
public static let ๊ธฐ๋ณธ_์ธ๋„ค์ผ_์ฃผ์†Œ: URL = URL(string: "https://pokit-storage.s3.ap-northeast-2.amazonaws.com/logo/pokit.png")!
26+
public static let ๊ธฐ๋ณธ_์ธ๋„ค์ผ_์ฃผ์†Œ: URL = URL(string: "https://pokit-s3.s3.ap-northeast-2.amazonaws.com/logo/pokit.png")!
2727

2828
public static let ํฌํ‚ท_์ตœ๋Œ€_๊ฐฏ์ˆ˜_๋ฌธ๊ตฌ: String = "์ตœ๋Œ€ 30๊ฐœ์˜ ํฌํ‚ท์„ ์ƒ์„ฑํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.\nํฌํ‚ท์„ ์‚ญ์ œํ•œ ๋’ค์— ์ถ”๊ฐ€ํ•ด์ฃผ์„ธ์š”."
2929
public static let ๋ณต์‚ฌํ•œ_๋งํฌ_์ €์žฅํ•˜๊ธฐ_๋ฌธ๊ตฌ: String = "๋ณต์‚ฌํ•œ ๋งํฌ ์ €์žฅํ•˜๊ธฐ"

0 commit comments

Comments
ย (0)