cleanup and improve design

This commit is contained in:
Suhail Saqan
2022-12-24 23:05:06 -06:00
parent dd50ffd555
commit f74a7c620a

View File

@@ -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
}) { }) {