Cleaned up the way we show images, changed the pay button for invoices, and added a new link view to make links appear a bit more friendly (need to work on this more)

This commit is contained in:
Sam DuBois
2022-12-27 12:38:52 -07:00
parent aea271182e
commit 33802a0fa3
4 changed files with 97 additions and 9 deletions

View File

@@ -8,24 +8,34 @@
import SwiftUI
struct InvoiceView: View {
@Environment(\.colorScheme) var colorScheme
let invoice: Invoice
var PayButton: some View {
Button("Pay") {
Button {
guard let url = URL(string: "lightning:" + invoice.string) else {
return
}
UIApplication.shared.open(url)
} label: {
RoundedRectangle(cornerRadius: 20)
.foregroundColor(colorScheme == .light ? .black : .white)
.overlay {
Text("Pay")
.fontWeight(.medium)
.foregroundColor(colorScheme == .light ? .white : .black)
}
}
.buttonStyle(.bordered)
}
var body: some View {
ZStack {
RoundedRectangle(cornerRadius: 20)
RoundedRectangle(cornerRadius: 10)
.foregroundColor(.secondary.opacity(0.1))
VStack(alignment: .trailing, spacing: 12) {
VStack(alignment: .leading, spacing: 12) {
HStack {
Label("", systemImage: "bolt.fill")
.foregroundColor(.orange)