From 7d0a86f32708cc31e94075128fb4efaa4276509d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B9=80=EB=8F=84=ED=98=95?= <108233361+ShapeKim98@users.noreply.github.com> Date: Tue, 22 Oct 2024 22:39:59 +0900 Subject: [PATCH 1/3] =?UTF-8?q?[fix]=20#152=20LinkCard=EC=97=90=EC=84=9C?= =?UTF-8?q?=20=EC=9D=B4=EB=AF=B8=EC=A7=80=20=EC=9A=94=EC=B2=AD=20=ED=97=A4?= =?UTF-8?q?=EB=8D=94=EC=97=90=20User-Agent=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Sources/Components/PokitLinkCard.swift | 40 +++++++++++++------ 1 file changed, 28 insertions(+), 12 deletions(-) diff --git a/Projects/DSKit/Sources/Components/PokitLinkCard.swift b/Projects/DSKit/Sources/Components/PokitLinkCard.swift index 5dad4313..a282e330 100644 --- a/Projects/DSKit/Sources/Components/PokitLinkCard.swift +++ b/Projects/DSKit/Sources/Components/PokitLinkCard.swift @@ -34,7 +34,11 @@ public struct PokitLinkCard: View { @MainActor private var buttonLabel: some View { HStack(spacing: 12) { - thumbleNail + if let url = URL(string: link.thumbNail) { + thumbleNail(url: url) + } else { + placeholder + } VStack(spacing: 8) { HStack { @@ -105,27 +109,27 @@ public struct PokitLinkCard: View { } @MainActor - private var thumbleNail: some View { - LazyImage(url: .init(string: link.thumbNail)) { phase in + private func thumbleNail(url: URL) -> some View { + var request = URLRequest(url: url) + request.setValue( + "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/100.0.4896.127 Safari/537.36", + forHTTPHeaderField: "User-Agent" + ) + + return LazyImage(request: .init(urlRequest: request)) { phase in Group { if let image = phase.image { image .resizable() .aspectRatio(contentMode: .fill) } else { - ZStack { - Color.pokit(.bg(.disable)) - - PokitSpinner() - .foregroundStyle(.pokit(.icon(.brand))) - .frame(width: 48, height: 48) - } + placeholder } } .animation(.pokitDissolve, value: phase.image) + .frame(width: 124, height: 94) + .clipShape(RoundedRectangle(cornerRadius: 8, style: .continuous)) } - .frame(width: 124, height: 94) - .clipShape(RoundedRectangle(cornerRadius: 8, style: .continuous)) } private var divider: some View { @@ -134,6 +138,18 @@ public struct PokitLinkCard: View { .frame(height: 1) } + private var placeholder: some View { + ZStack { + Color.pokit(.bg(.disable)) + + PokitSpinner() + .foregroundStyle(.pokit(.icon(.brand))) + .frame(width: 48, height: 48) + } + .frame(width: 124, height: 94) + .clipShape(RoundedRectangle(cornerRadius: 8, style: .continuous)) + } + @ViewBuilder public func divider(isFirst: Bool, isLast: Bool) -> some View { let edge: Edge.Set = isFirst ? .bottom : isLast ? .top : .vertical From b5d25231882a07f4388a81ac0d1f9f500d46abb6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B9=80=EB=8F=84=ED=98=95?= <108233361+ShapeKim98@users.noreply.github.com> Date: Tue, 22 Oct 2024 22:55:34 +0900 Subject: [PATCH 2/3] =?UTF-8?q?[fix]=20#152=20RemindView=EC=97=90=EC=84=9C?= =?UTF-8?q?=20=EB=A7=81=ED=81=AC=20=EC=9D=B4=EB=AF=B8=EC=A7=80=20=EC=A1=B0?= =?UTF-8?q?=ED=9A=8C=20=ED=97=A4=EB=8D=94=EC=97=90=20User-Agent=20?= =?UTF-8?q?=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Sources/Remind/RemindView.swift | 46 +++++++++++++------ 1 file changed, 32 insertions(+), 14 deletions(-) diff --git a/Projects/Feature/FeatureRemind/Sources/Remind/RemindView.swift b/Projects/Feature/FeatureRemind/Sources/Remind/RemindView.swift index de321408..d44e9238 100644 --- a/Projects/Feature/FeatureRemind/Sources/Remind/RemindView.swift +++ b/Projects/Feature/FeatureRemind/Sources/Remind/RemindView.swift @@ -137,25 +137,15 @@ extension RemindView { Button(action: { send(.컨텐츠_항목_눌렀을때(content: content)) }) { recommendedContentCellLabel(content: content) } - } @ViewBuilder private func recommendedContentCellLabel(content: BaseContentItem) -> some View { ZStack(alignment: .bottom) { - LazyImage(url: .init(string: content.thumbNail)) { phase in - if let image = phase.image { - image - .resizable() - } else { - ZStack { - Color.pokit(.bg(.disable)) - - PokitSpinner() - .foregroundStyle(.pokit(.icon(.brand))) - .frame(width: 48, height: 48) - } - } + if let url = URL(string: content.thumbNail) { + recommendedContentCellImage(url: url) + } else { + imagePlaceholder } LinearGradient( @@ -205,6 +195,34 @@ extension RemindView { .clipShape(RoundedRectangle(cornerRadius: 12, style: .continuous)) } + @MainActor + private func recommendedContentCellImage(url: URL) -> some View { + var request = URLRequest(url: url) + request.setValue( + "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/100.0.4896.127 Safari/537.36", + forHTTPHeaderField: "User-Agent" + ) + + return LazyImage(request: .init(urlRequest: request)) { phase in + if let image = phase.image { + image + .resizable() + } else { + imagePlaceholder + } + } + } + + private var imagePlaceholder: some View { + ZStack { + Color.pokit(.bg(.disable)) + + PokitSpinner() + .foregroundStyle(.pink) + .frame(width: 48, height: 48) + } + } + @ViewBuilder private func kebabButton(action: @escaping () -> Void) -> some View { Button(action: action) { From 495989ff7acf55a83c8c02d8bc84118479a7d6e6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B9=80=EB=8F=84=ED=98=95?= <108233361+ShapeKim98@users.noreply.github.com> Date: Tue, 22 Oct 2024 22:58:08 +0900 Subject: [PATCH 3/3] =?UTF-8?q?[fix]=20App=EA=B3=BC=20Share=20Extension=20?= =?UTF-8?q?=EB=B2=84=EC=A0=84=20=EC=9D=BC=EC=B9=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Projects/App/ShareExtension/Info.plist | 34 ++++++++++++++------------ 1 file changed, 18 insertions(+), 16 deletions(-) diff --git a/Projects/App/ShareExtension/Info.plist b/Projects/App/ShareExtension/Info.plist index 44c3637f..8e36808f 100644 --- a/Projects/App/ShareExtension/Info.plist +++ b/Projects/App/ShareExtension/Info.plist @@ -2,12 +2,18 @@ - TeamID - $(TeamID) - GIDClientID - $(GIDClientID) AppleKeyID $(AppleKeyID) + CFBundleDisplayName + Pokit + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleName + Pokit + CFBundleShortVersionString + 1.0.4 CFBundleURLTypes @@ -19,34 +25,30 @@ - CFBundleExecutable - $(EXECUTABLE_NAME) - CFBundleIdentifier - $(PRODUCT_BUNDLE_IDENTIFIER) CFBundleVersion 1 - CFBundleName - Pokit - CFBundleDisplayName - Pokit + GIDClientID + $(GIDClientID) NSExtension NSExtensionAttributes NSExtensionActivationRule + NSExtensionActivationSupportsText + NSExtensionActivationSupportsWebPageWithMaxCount 1000 NSExtensionActivationSupportsWebURLWithMaxCount 1000 - NSExtensionActivationSupportsText - - NSExtensionPrincipalClass - $(PRODUCT_MODULE_NAME).ShareViewController NSExtensionPointIdentifier com.apple.share-services + NSExtensionPrincipalClass + $(PRODUCT_MODULE_NAME).ShareViewController + TeamID + $(TeamID)