Mercurial > public > lazybear
comparison LazyBear/Views/Company/Helpers/InsiderTransactionsList.swift @ 445:7d1c4dc8d1d8
Change presentationMode to Binding
author | Dennis Concepción Martín <dennisconcepcionmartin@gmail.com> |
---|---|
date | Tue, 22 Jun 2021 19:56:59 +0200 |
parents | 428109b1e3f0 |
children | 8621ba6fd457 |
comparison
equal
deleted
inserted
replaced
444:428109b1e3f0 | 445:7d1c4dc8d1d8 |
---|---|
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 @Environment(\.presentationMode) private var insiderTransactionsListPresentation | 12 @Binding var isPresented: Bool |
13 | 13 |
14 var body: some View { | 14 var body: some View { |
15 NavigationView { | 15 NavigationView { |
16 ScrollView(showsIndicators: false) { | 16 ScrollView(showsIndicators: false) { |
17 VStack { | 17 VStack { |
23 .padding() | 23 .padding() |
24 } | 24 } |
25 .navigationTitle("Insider Transactions") | 25 .navigationTitle("Insider Transactions") |
26 .toolbar { | 26 .toolbar { |
27 ToolbarItem(placement: .cancellationAction) { | 27 ToolbarItem(placement: .cancellationAction) { |
28 Button(action: { insiderTransactionsListPresentation.wrappedValue.dismiss() }) { | 28 Button(action: { self.isPresented.toggle() }) { |
29 Image(systemName: "multiply") | 29 Image(systemName: "multiply") |
30 } | 30 } |
31 } | 31 } |
32 } | 32 } |
33 } | 33 } |
48 transactionPrice: 20.08, | 48 transactionPrice: 20.08, |
49 transactionShares: 12345, | 49 transactionShares: 12345, |
50 transactionValue: 1234567.0 | 50 transactionValue: 1234567.0 |
51 ) | 51 ) |
52 ] | 52 ] |
53 , isPresented: .constant(true) | |
53 ) | 54 ) |
54 } | 55 } |
55 } | 56 } |