comparison LazyBear/Views/Company/Helpers/InsiderTransactionsList.swift @ 447:8621ba6fd457

Fixes #48
author Dennis Concepción Martín <dennisconcepcionmartin@gmail.com>
date Wed, 23 Jun 2021 10:54:47 +0200
parents 7d1c4dc8d1d8
children
comparison
equal deleted inserted replaced
446:9cc0455bc46f 447:8621ba6fd457
7 7
8 import SwiftUI 8 import SwiftUI
9 9
10 struct InsiderTransactionsList: View { 10 struct InsiderTransactionsList: View {
11 var insiderTransactions: [InsiderTransactionModel] 11 var insiderTransactions: [InsiderTransactionModel]
12 @Binding var isPresented: Bool
13 12
14 var body: some View { 13 var body: some View {
15 NavigationView { 14 ScrollView(showsIndicators: false) {
16 ScrollView(showsIndicators: false) { 15 VStack {
17 VStack { 16 ForEach(insiderTransactions, id: \.self) { insiderTransaction in
18 ForEach(insiderTransactions, id: \.self) { insiderTransaction in 17 InsiderTransactionsRow(insiderTransaction: insiderTransaction)
19 InsiderTransactionsRow(insiderTransaction: insiderTransaction) 18 Divider()
20 Divider()
21 }
22 }
23 .padding()
24 }
25 .navigationTitle("Insider Transactions")
26 .toolbar {
27 ToolbarItem(placement: .cancellationAction) {
28 Button(action: { self.isPresented.toggle() }) {
29 Image(systemName: "multiply")
30 }
31 } 19 }
32 } 20 }
21 .padding()
33 } 22 }
34 } 23 }
35 } 24 }
36 25
37 struct InsiderTransactionsList_Previews: PreviewProvider { 26 struct InsiderTransactionsList_Previews: PreviewProvider {
48 transactionPrice: 20.08, 37 transactionPrice: 20.08,
49 transactionShares: 12345, 38 transactionShares: 12345,
50 transactionValue: 1234567.0 39 transactionValue: 1234567.0
51 ) 40 )
52 ] 41 ]
53 , isPresented: .constant(true)
54 ) 42 )
55 } 43 }
56 } 44 }