Browse Source

add default wallet option and phoenix

post-button-style
Suhail Saqan 2 years ago
parent
commit
c76e1a39e7
No known key found for this signature in database GPG Key ID: C3E8D33BFD16C6E6
  1. 21
      damus/Assets.xcassets/phoenix.imageset/Contents.json
  2. BIN
      damus/Assets.xcassets/phoenix.imageset/phoenix.png
  3. 1
      damus/Util/Constants.swift
  4. 11
      damus/Views/SelectWalletView.swift

21
damus/Assets.xcassets/phoenix.imageset/Contents.json

@ -0,0 +1,21 @@
{
"images" : [
{
"filename" : "phoenix.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

BIN
damus/Assets.xcassets/phoenix.imageset/phoenix.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

1
damus/Util/Constants.swift

@ -35,6 +35,7 @@ public class Constants {
{"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"},
{"id": 7, "name": "LNLink", "link": "lnlink://", "appStoreLink": "https://testflight.apple.com/join/aNY4yuuZ", "image": "lnlink"},
{"id": 8, "name": "Phoenix", "link": "phoenix://", "appStoreLink": "https://apps.apple.com/us/app/phoenix-wallet/id1544097028", "image": "phoenix"},
]
""".data(using: .utf8)!
}

11
damus/Views/SelectWalletView.swift

@ -36,7 +36,7 @@ struct SelectWalletView: View {
Spacer()
Image(systemName: self.invoice_copied ? "checkmark.circle" : "doc.on.doc")
Image(systemName: self.invoice_copied ? "checkmark.circle" : "doc.on.doc").foregroundColor(.blue)
}.clipShape(RoundedRectangle(cornerRadius: 5)).onTapGesture {
UIPasteboard.general.string = invoice
self.invoice_copied = true
@ -45,6 +45,15 @@ struct SelectWalletView: View {
}
Section("Select a lightning wallet"){
List{
Button() {
if let url = URL(string: "lightning:\(invoice)"), UIApplication.shared.canOpenURL(url) {
openURL(url)
}
} label: {
HStack {
Text("Default Wallet").font(.body).foregroundColor(.blue)
}
}.buttonStyle(.plain)
ForEach(walletItems, id: \.self) { wallet in
Button() {
if let url = URL(string: "\(wallet.link)\(invoice)"), UIApplication.shared.canOpenURL(url) {

Loading…
Cancel
Save