From 0de7b9dc945e737a41713d46418cf408a2494fc2 Mon Sep 17 00:00:00 2001
From: Suhail Saqan <suhail.saqan@gmail.com>
Date: Thu, 22 Dec 2022 05:31:05 -0600
Subject: [PATCH] added copy invoice and fixed alignment

---
 damus.xcodeproj/project.pbxproj    |  2 +-
 damus/Views/SelectWalletView.swift | 21 +++++++++++++++++----
 2 files changed, 18 insertions(+), 5 deletions(-)

diff --git a/damus.xcodeproj/project.pbxproj b/damus.xcodeproj/project.pbxproj
index 1bb8b7a..6096408 100644
--- a/damus.xcodeproj/project.pbxproj
+++ b/damus.xcodeproj/project.pbxproj
@@ -445,9 +445,9 @@
 				4CEE2AF2280B25C500AB5EEF /* ProfilePicView.swift */,
 				4CEE2AF6280B2DEA00AB5EEF /* ProfileName.swift */,
 				4CEE2AF8280B2EAC00AB5EEF /* PowView.swift */,
+				4CA2EF9F280E37AC0044ACD8 /* TimelineView.swift */,
 				4CEE2B01280B39E800AB5EEF /* EventActionBar.swift */,
 				4CACA9D4280C31E100D9BBE8 /* ReplyView.swift */,
-				4CA2EF9F280E37AC0044ACD8 /* TimelineView.swift */,
 				4C0A3F8B280F5FCA000448DE /* ChatroomView.swift */,
 				4C0A3F90280F6528000448DE /* ChatView.swift */,
 				4C0A3F94280F6C78000448DE /* ReplyQuoteView.swift */,
diff --git a/damus/Views/SelectWalletView.swift b/damus/Views/SelectWalletView.swift
index f7781ed..ae83e03 100644
--- a/damus/Views/SelectWalletView.swift
+++ b/damus/Views/SelectWalletView.swift
@@ -19,18 +19,32 @@ struct SelectWalletView: View {
     @Binding var show_select_wallet: Bool
     @Binding var invoice: String
     @Environment(\.openURL) private var openURL
+    @State var invoice_copied: Bool = false
+    
+    let generator = UIImpactFeedbackGenerator(style: .light)
     
     let walletItems = try! JSONDecoder().decode([WalletItem].self, from: Constants.WALLETS)
     
     var body: some View {
         NavigationView {
             VStack(alignment: .leading) {
+                Section("Invoice") {
+                    HStack {
+                        Text(invoice)
+                        
+                        Image(systemName: self.invoice_copied ? "checkmark.circle" : "doc.on.doc")
+                    }
+                    .clipShape(RoundedRectangle(cornerRadius: 5)).onTapGesture {
+                        UIPasteboard.general.string = invoice
+                        self.invoice_copied = true
+                        generator.impactOccurred()
+                    }
+                }
                 ForEach(walletItems) { wallet in
                    HStack(spacing: 20) {
                        Image(wallet.image)
                          .resizable()
-                         .scaledToFit()
-                         .aspectRatio(contentMode: .fit)
+                         .frame(width: 32.0, height: 32.0,alignment: .center)
                          .cornerRadius(5)
                        Text("\(wallet.name)")
                    }.onTapGesture {
@@ -51,8 +65,7 @@ struct SelectWalletView: View {
                 }) {
                     Text("Done").bold()
                 })
-        }
-
+        }.padding([.leading, .trailing], 6)
     }
 }