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) 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 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) {