damus

nostr ios client
git clone git://jb55.com/damus
Log | Files | Refs | README | LICENSE

InvoicesView.swift (1028B)


      1 //
      2 //  InvoicesView.swift
      3 //  damus
      4 //
      5 //  Created by William Casarin on 2022-10-18.
      6 //
      7 
      8 import SwiftUI
      9 
     10 struct InvoicesView: View {
     11     let our_pubkey: Pubkey
     12     var invoices: [Invoice]
     13     let settings: UserSettingsStore
     14     
     15     var body: some View {
     16         TabView {
     17             ForEach(invoices, id: \.string) { invoice in
     18                 InvoiceView(our_pubkey: our_pubkey, invoice: invoice, settings: settings)
     19                 .tabItem {
     20                     Text(invoice.string)
     21                 }
     22                 .id(invoice.string)
     23             }
     24         }
     25         .frame(height: 240)
     26         .tabViewStyle(PageTabViewStyle())
     27     }
     28 }
     29 
     30 struct InvoicesView_Previews: PreviewProvider {
     31     static var previews: some View {
     32         InvoicesView(our_pubkey: test_note.pubkey, invoices: [Invoice.init(description: .description("description"), amount: .specific(10000), string: "invstr", expiry: 100000, payment_hash: Data(), created_at: 1000000)], settings: test_damus_state.settings)
     33             .frame(width: 300)
     34     }
     35 }