cleanup and improve design
This commit is contained in:
@@ -28,27 +28,23 @@ struct SelectWalletView: View {
|
|||||||
var body: some View {
|
var body: some View {
|
||||||
NavigationView {
|
NavigationView {
|
||||||
Form {
|
Form {
|
||||||
VStack(alignment: .leading) {
|
Section("Copy invoice") {
|
||||||
Text("Copy invoice")
|
|
||||||
.bold()
|
|
||||||
.font(.title3)
|
|
||||||
.multilineTextAlignment(.center)
|
|
||||||
.padding([.bottom, .top], 8)
|
|
||||||
HStack {
|
HStack {
|
||||||
Text(invoice).font(.body)
|
Text(invoice).font(.body)
|
||||||
.lineLimit(2)
|
.lineLimit(2)
|
||||||
.truncationMode(.tail)
|
.truncationMode(.tail)
|
||||||
|
|
||||||
|
Spacer()
|
||||||
|
|
||||||
Image(systemName: self.invoice_copied ? "checkmark.circle" : "doc.on.doc")
|
Image(systemName: self.invoice_copied ? "checkmark.circle" : "doc.on.doc")
|
||||||
}
|
}.clipShape(RoundedRectangle(cornerRadius: 5)).onTapGesture {
|
||||||
.clipShape(RoundedRectangle(cornerRadius: 5)).onTapGesture {
|
|
||||||
UIPasteboard.general.string = invoice
|
UIPasteboard.general.string = invoice
|
||||||
self.invoice_copied = true
|
self.invoice_copied = true
|
||||||
generator.impactOccurred()
|
generator.impactOccurred()
|
||||||
}
|
}
|
||||||
Spacer()
|
}
|
||||||
List {
|
Section("Select a lightning wallet"){
|
||||||
Section{
|
List{
|
||||||
ForEach(walletItems, id: \.self) { wallet in
|
ForEach(walletItems, id: \.self) { wallet in
|
||||||
Button() {
|
Button() {
|
||||||
if let url = URL(string: "\(wallet.link)\(invoice)"), UIApplication.shared.canOpenURL(url) {
|
if let url = URL(string: "\(wallet.link)\(invoice)"), UIApplication.shared.canOpenURL(url) {
|
||||||
@@ -62,21 +58,11 @@ struct SelectWalletView: View {
|
|||||||
HStack {
|
HStack {
|
||||||
Image(wallet.image).resizable().frame(width: 32.0, height: 32.0,alignment: .center).cornerRadius(5)
|
Image(wallet.image).resizable().frame(width: 32.0, height: 32.0,alignment: .center).cornerRadius(5)
|
||||||
Text(wallet.name).font(.body)
|
Text(wallet.name).font(.body)
|
||||||
.lineLimit(2)
|
}
|
||||||
.truncationMode(.tail)
|
|
||||||
}.padding([.bottom], 4)
|
|
||||||
}.buttonStyle(.plain)
|
}.buttonStyle(.plain)
|
||||||
wallet.id != 7 ? Divider().padding([.bottom], -6) : nil
|
|
||||||
}
|
}
|
||||||
} header: {
|
}.padding(.vertical, 2.5)
|
||||||
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: {
|
}.navigationBarTitle(Text("Pay the lightning invoice"), displayMode: .inline).navigationBarItems(trailing: Button(action: {
|
||||||
self.showingSelectWallet = false
|
self.showingSelectWallet = false
|
||||||
}) {
|
}) {
|
||||||
|
|||||||
Reference in New Issue
Block a user