Merge branch 'master' into add-wallet-modal

This commit is contained in:
Suhail Saqan
2022-12-25 23:44:51 -06:00
4 changed files with 43 additions and 8 deletions

View File

@@ -126,7 +126,7 @@ struct ProfileView: View {
//@EnvironmentObject var profile: ProfileModel
func LNButton(lud06: String?, lud16: String?) -> some View {
func LNButton(lud06: String?, lud16: String?, profile: Profile) -> some View {
Button(action: {
if let l = lud06 {
inv = l
@@ -139,6 +139,12 @@ struct ProfileView: View {
.symbolRenderingMode(.palette)
.font(.system(size: 34).weight(.thin))
.foregroundStyle(colorScheme == .light ? .black : .white, colorScheme == .light ? .black.opacity(0.1) : .white.opacity(0.2))
}.contextMenu {
Button {
UIPasteboard.general.string = profile.lnurl ?? ""
} label: {
Label("Copy LNUrl", systemImage: "doc.on.doc")
}
}.sheet(isPresented: $showingSelectWallet, onDismiss: {showingSelectWallet = false}) {
SelectWalletView(showingSelectWallet: $showingSelectWallet, invoice: $inv)
}
@@ -164,9 +170,11 @@ struct ProfileView: View {
ProfilePicView(pubkey: profile.pubkey, size: PFP_SIZE, highlight: .custom(Color.black, 2), profiles: damus_state.profiles)
Spacer()
if (data != nil) && (data?.lud06 != nil || data?.lud16 != nil) {
LNButton(lud06: data?.lud06, lud16: data?.lud16)
if let profile = data {
if (profile?.lud06 != nil || profile?.lud16 != nil) {
LNButton(lud06: data?.lud06, lud16: data?.lud16,, profile: profile)
}
}
DMButton