Add bolt11 parser and Invoice View

Changelog-Added: Display bolt11 invoice widgets on posts
This commit is contained in:
William Casarin
2022-10-19 07:46:05 -07:00
parent dbe1260b54
commit c6ab1de639
15 changed files with 411 additions and 41 deletions

View File

@@ -0,0 +1,35 @@
//
// InvoicesView.swift
// damus
//
// Created by William Casarin on 2022-10-18.
//
import SwiftUI
struct InvoicesView: View {
var invoices: [Invoice]
@State var open_sheet: Bool = false
@State var current_invoice: Invoice? = nil
var body: some View {
TabView {
ForEach(invoices, id: \.string) { invoice in
InvoiceView(invoice: invoice)
.tabItem {
Text(invoice.string)
}
.id(invoice.string)
}
}
.frame(height: 200)
.tabViewStyle(PageTabViewStyle())
}
}
struct InvoicesView_Previews: PreviewProvider {
static var previews: some View {
InvoicesView(invoices: [Invoice.init(description: "description", amount: 10000, string: "invstr", expiry: 100000, payment_hash: Data(), created_at: 1000000)])
}
}