Skip to content

Commit

Permalink
Merge pull request #1 from suhailsaqan/add-default-button
Browse files Browse the repository at this point in the history
add default wallet option and phoenix
  • Loading branch information
suhailsaqan authored Dec 26, 2022
2 parents a1e6344 + c76e1a3 commit 3a695fb
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 1 deletion.
21 changes: 21 additions & 0 deletions damus/Assets.xcassets/phoenix.imageset/Contents.json
Original file line number Diff line number Diff line change
@@ -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
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions damus/Util/Constants.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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 changes: 10 additions & 1 deletion damus/Views/SelectWalletView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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) {
Expand Down

0 comments on commit 3a695fb

Please sign in to comment.