Add ability to copy url from post media previews
This commit is contained in:
@@ -474,9 +474,9 @@ struct ContentView: View {
|
||||
home.filter_muted()
|
||||
}
|
||||
.onReceive(handle_notify(.local_notification)) { notif in
|
||||
let local = notif.object as! LossyLocalNotification
|
||||
|
||||
guard let damus_state else {
|
||||
guard let local = notif.object as? LossyLocalNotification,
|
||||
let damus_state else {
|
||||
return
|
||||
}
|
||||
|
||||
|
||||
@@ -362,9 +362,19 @@ struct PVImageCarouselView: View {
|
||||
.frame(width: media.count == 1 ? deviceWidth*0.8 : 250, height: media.count == 1 ? 400 : 250)
|
||||
.cornerRadius(10)
|
||||
.padding()
|
||||
.contextMenu {
|
||||
if let uploadedURL = media.first(where: { $0.representingImage == image })?.uploadedURL {
|
||||
Button(action: {
|
||||
UIPasteboard.general.string = uploadedURL.absoluteString
|
||||
}) {
|
||||
Label("Copy URL", systemImage: "doc.on.doc")
|
||||
}
|
||||
}
|
||||
}
|
||||
Image(systemName: "xmark.circle.fill")
|
||||
.foregroundColor(.white)
|
||||
.padding(20)
|
||||
.shadow(radius: 5)
|
||||
.onTapGesture {
|
||||
if let index = media.map({$0.representingImage}).firstIndex(of: image) {
|
||||
media.remove(at: index)
|
||||
@@ -378,7 +388,6 @@ struct PVImageCarouselView: View {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
fileprivate func getImage(media: MediaUpload) -> UIImage {
|
||||
var uiimage: UIImage = UIImage()
|
||||
if media.is_image {
|
||||
|
||||
Reference in New Issue
Block a user