comparison LazyBear/Views/Company/Helpers/InsiderTransactionsList.swift @ 444:428109b1e3f0

InsiderTransactions implemented
author Dennis Concepción Martín <dennisconcepcionmartin@gmail.com>
date Tue, 22 Jun 2021 16:54:21 +0200
parents
children 7d1c4dc8d1d8
comparison
equal deleted inserted replaced
443:ffbb1dbab531 444:428109b1e3f0
1 //
2 // InsiderTransactionsList.swift
3 // LazyBear
4 //
5 // Created by Dennis Concepción Martín on 22/6/21.
6 //
7
8 import SwiftUI
9
10 struct InsiderTransactionsList: View {
11 var insiderTransactions: [InsiderTransactionModel]
12 @Environment(\.presentationMode) private var insiderTransactionsListPresentation
13
14 var body: some View {
15 NavigationView {
16 ScrollView(showsIndicators: false) {
17 VStack {
18 ForEach(insiderTransactions, id: \.self) { insiderTransaction in
19 InsiderTransactionsRow(insiderTransaction: insiderTransaction)
20 Divider()
21 }
22 }
23 .padding()
24 }
25 .navigationTitle("Insider Transactions")
26 .toolbar {
27 ToolbarItem(placement: .cancellationAction) {
28 Button(action: { insiderTransactionsListPresentation.wrappedValue.dismiss() }) {
29 Image(systemName: "multiply")
30 }
31 }
32 }
33 }
34 }
35 }
36
37 struct InsiderTransactionsList_Previews: PreviewProvider {
38 static var previews: some View {
39 InsiderTransactionsList(
40 insiderTransactions:
41 [
42 InsiderTransactionModel(
43 filingDate: "2020-01-01",
44 fullName: "Dennis Concepcion",
45 postShares: 1234,
46 reportedTitle: "Director",
47 transactionCode: "S",
48 transactionPrice: 20.08,
49 transactionShares: 12345,
50 transactionValue: 1234567.0
51 )
52 ]
53 )
54 }
55 }