diff --git a/damus.xcodeproj/project.pbxproj b/damus.xcodeproj/project.pbxproj index 60964081..98208648 100644 --- a/damus.xcodeproj/project.pbxproj +++ b/damus.xcodeproj/project.pbxproj @@ -1025,7 +1025,7 @@ CODE_SIGN_STYLE = Automatic; CURRENT_PROJECT_VERSION = 2; DEVELOPMENT_ASSET_PATHS = "\"damus/Preview Content\""; - DEVELOPMENT_TEAM = XK7H4JAB3D; + DEVELOPMENT_TEAM = XL4476DR2X; ENABLE_PREVIEWS = YES; GENERATE_INFOPLIST_FILE = YES; INFOPLIST_FILE = damus/Info.plist; @@ -1064,7 +1064,7 @@ CODE_SIGN_STYLE = Automatic; CURRENT_PROJECT_VERSION = 2; DEVELOPMENT_ASSET_PATHS = "\"damus/Preview Content\""; - DEVELOPMENT_TEAM = XK7H4JAB3D; + DEVELOPMENT_TEAM = XL4476DR2X; ENABLE_PREVIEWS = YES; GENERATE_INFOPLIST_FILE = YES; INFOPLIST_FILE = damus/Info.plist; diff --git a/damus/Assets.xcassets/breez.imageset/Contents.json b/damus/Assets.xcassets/breez.imageset/Contents.json deleted file mode 100644 index d07c6ece..00000000 --- a/damus/Assets.xcassets/breez.imageset/Contents.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "images" : [ - { - "filename" : "breez.png", - "idiom" : "universal", - "scale" : "1x" - }, - { - "idiom" : "universal", - "scale" : "2x" - }, - { - "idiom" : "universal", - "scale" : "3x" - } - ], - "info" : { - "author" : "xcode", - "version" : 1 - } -} diff --git a/damus/Assets.xcassets/breez.imageset/breez.png b/damus/Assets.xcassets/breez.imageset/breez.png deleted file mode 100644 index 710c4cdb..00000000 Binary files a/damus/Assets.xcassets/breez.imageset/breez.png and /dev/null differ diff --git a/damus/Util/Constants.swift b/damus/Util/Constants.swift index c5c21d3f..54411f61 100644 --- a/damus/Util/Constants.swift +++ b/damus/Util/Constants.swift @@ -25,14 +25,13 @@ public class Constants { static let WALLETS = """ [ - {"id": 0, "name": "Strike", "link": "strike:lightning", "appStoreLink": "https://apps.apple.com/us/app/strike-bitcoin-payments/id1488724463", "image": "strike"}, + {"id": 0, "name": "Strike", "link": "strike:", "appStoreLink": "https://apps.apple.com/us/app/strike-bitcoin-payments/id1488724463", "image": "strike"}, {"id": 1, "name": "Cash App", "link": "squarecash://", "appStoreLink": "https://apps.apple.com/us/app/cash-app/id711923939", "image": "cashapp"}, {"id": 2, "name": "Muun", "link": "muun:", "appStoreLink": "https://apps.apple.com/us/app/muun-wallet/id1482037683", "image": "muun"}, - {"id": 3, "name": "Blue Wallet", "link": "bluewallet:lightning", "appStoreLink": "https://apps.apple.com/us/app/bluewallet-bitcoin-wallet/id1376878040", "image": "bluewallet"}, - {"id": 4, "name": "Wallet Of Satoshi", "link": "walletofsatoshi:lightning", "appStoreLink": "https://apps.apple.com/us/app/wallet-of-satoshi/id1438599608", "image": "walletofsatoshi"}, - {"id": 5, "name": "Breez", "link": "breez:lightning", "appStoreLink": "https://testflight.apple.com/join/wPju2Du7", "image": "breez"}, - {"id": 6, "name": "Zebedee", "link": "zebedee:lightning", "appStoreLink": "https://apps.apple.com/us/app/zebedee-wallet/id1484394401", "image": "zebedee"}, - {"id": 7, "name": "Zeus LN", "link": "zeusln:lightning", "appStoreLink": "https://apps.apple.com/us/app/zeus-ln/id1456038895", "image": "zeusln"}, + {"id": 3, "name": "Blue Wallet", "link": "bluewallet:lightning:", "appStoreLink": "https://apps.apple.com/us/app/bluewallet-bitcoin-wallet/id1376878040", "image": "bluewallet"}, + {"id": 4, "name": "Wallet Of Satoshi", "link": "walletofsatoshi:lightning:", "appStoreLink": "https://apps.apple.com/us/app/wallet-of-satoshi/id1438599608", "image": "walletofsatoshi"}, + {"id": 5, "name": "Zebedee", "link": "zebedee:lightning:", "appStoreLink": "https://apps.apple.com/us/app/zebedee-wallet/id1484394401", "image": "zebedee"}, + {"id": 6, "name": "Zeus LN", "link": "zeusln:lightning:", "appStoreLink": "https://apps.apple.com/us/app/zeus-ln/id1456038895", "image": "zeusln"}, ] """.data(using: .utf8)! } diff --git a/damus/Views/SelectWalletView.swift b/damus/Views/SelectWalletView.swift index 13f17686..3d710985 100644 --- a/damus/Views/SelectWalletView.swift +++ b/damus/Views/SelectWalletView.swift @@ -7,7 +7,7 @@ import SwiftUI -struct WalletItem : Decodable, Identifiable { +struct WalletItem : Decodable, Identifiable, Hashable { var id: Int var name : String var link : String @@ -29,56 +29,59 @@ struct SelectWalletView: View { NavigationView { Form { VStack(alignment: .leading) { - Text("Copy invoice") - .bold() - .font(.title3) - .multilineTextAlignment(.center) - .padding([.bottom, .top], 8) - HStack { - Text(invoice).font(.body) - .multilineTextAlignment(.center) - .lineLimit(3) - .truncationMode(.tail) - - 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() - } + Text("Copy invoice") + .bold() + .font(.title3) + .multilineTextAlignment(.center) + .padding([.bottom, .top], 8) + HStack { + Text(invoice).font(.body) + .lineLimit(2) + .truncationMode(.tail) + + 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() + } Spacer() - Text("Select a lightning wallet") - .bold() - .font(.title3) - .multilineTextAlignment(.center) - .padding([.bottom], 8) - ForEach(walletItems) { wallet in - HStack(spacing: 20) { - Image(wallet.image) - .resizable() - .frame(width: 32.0, height: 32.0,alignment: .center) - .cornerRadius(5) - Text("\(wallet.name)") - }.onTapGesture { - if let url = URL(string: "\(wallet.link)\(invoice)"), UIApplication.shared.canOpenURL(url) { - openURL(url) - } else { - if let url = URL(string: wallet.appStoreLink), UIApplication.shared.canOpenURL(url) { + List { + Section{ + ForEach(walletItems, id: \.self) { wallet in + Button() { + if let url = URL(string: "\(wallet.link)\(invoice)"), UIApplication.shared.canOpenURL(url) { openURL(url) + } else { + if let url = URL(string: wallet.appStoreLink), UIApplication.shared.canOpenURL(url) { + openURL(url) + } } - } + } label: { + HStack { + Image(wallet.image).resizable().frame(width: 32.0, height: 32.0,alignment: .center).cornerRadius(5) + Text(wallet.name).font(.body) + .lineLimit(2) + .truncationMode(.tail) + }.padding([.bottom], 4) + }.buttonStyle(.plain) + wallet.id != 6 ? Divider().padding([.bottom], -6) : nil } - Divider() + } header: { + Text("Select a lightning wallet") + .bold() + .font(.title3) + .multilineTextAlignment(.center) + .padding([.bottom, .top], 8) } + } } - .navigationBarTitle(Text("Pay the lightning invoice"), displayMode: .inline) - .navigationBarItems(trailing: Button(action: { - self.show_select_wallet = false - }) { - Text("Done").bold() - }) - } + }.navigationBarTitle(Text("Pay the lightning invoice"), displayMode: .inline).navigationBarItems(trailing: Button(action: { + self.show_select_wallet = false + }) { + Text("Done").bold() + }) } } }