Cleaned up the way we show images, changed the pay button for invoices, and added a new link view to make links appear a bit more friendly (need to work on this more)

This commit is contained in:
Sam DuBois
2022-12-27 12:38:52 -07:00
parent aea271182e
commit 33802a0fa3
4 changed files with 97 additions and 9 deletions

39
damus/Util/LinkView.swift Normal file
View File

@@ -0,0 +1,39 @@
//
// LinkView.swift
// damus
//
// Created by Sam DuBois on 12/27/22.
//
import SwiftUI
import LinkPresentation
class CustomLinkView: LPLinkView {
override var intrinsicContentSize: CGSize { CGSize(width: 0, height: super.intrinsicContentSize.height) }
}
struct LinkViewRepresentable: UIViewRepresentable {
typealias UIViewType = CustomLinkView
var metadata: LPLinkMetadata?
var url: URL?
func makeUIView(context: Context) -> CustomLinkView {
if let metadata {
let linkView = CustomLinkView(metadata: metadata)
return linkView
}
if let url {
let linkView = CustomLinkView(url: url)
return linkView
}
return CustomLinkView()
}
func updateUIView(_ uiView: CustomLinkView, context: Context) {
}
}