Improve preview images from content

This commit is contained in:
Jackson Harper
2022-06-02 16:17:27 -07:00
parent ef72e09006
commit 5547a7bb6e
3 changed files with 12 additions and 11 deletions

View File

@ -196,12 +196,14 @@ public struct ShareExtensionChildView: View {
.resizable()
.aspectRatio(contentMode: .fill)
.frame(width: 61, height: 61)
.clipped()
} else if case AsyncImageStatus.loading = imageStatus {
Color.appButtonBackground
.aspectRatio(contentMode: .fill)
.frame(width: 61, height: 61)
} else {
EmptyView()
.frame(width: 61, height: 61)
}
}
} else {
@ -257,16 +259,12 @@ public struct ShareExtensionChildView: View {
Spacer()
HStack {
// if case ShareExtensionStatus.saved = status || case ShareExtensionStatus.synced = status {
Button(
action: { readNowButtonAction() },
label: { Text("Read Now").frame(maxWidth: .infinity) }
)
.buttonStyle(RoundedRectButtonStyle())
// }
if case ShareExtensionStatus.processing = viewModel.status, FeatureFlag.enableReadNow {
Button(action: {}, label: { ProgressView().frame(maxWidth: .infinity) })
.buttonStyle(RoundedRectButtonStyle())
if FeatureFlag.enableReadNow {
Button(
action: { readNowButtonAction() },
label: { Text("Read Now").frame(maxWidth: .infinity) }
)
.buttonStyle(RoundedRectButtonStyle())
}
Button(
action: {

View File

@ -2,6 +2,9 @@ var ShareExtension = function() {};
function iconURL() {
try {
const previewImage = document.querySelector("meta[property='og:image'], meta[name='twitter:image']").content
if (previewImage) { return previewImage }
return document.querySelector("link[rel='apple-touch-icon'], link[rel='shortcut icon'], link[rel='icon']").href
} catch {}
return null

View File

@ -12,7 +12,7 @@ import Utils
embed(
childViewController: UIViewController.makeShareExtensionController(extensionContext: extensionContext),
heightRatio: 0.5
heightRatio: 0.55
)
}
}