Mercurial > public > lazybear
comparison LazyBear/Views/Global Helpers/StockRow.swift @ 379:a7e2c5a7b4f6
Implement onDelete in watchlists
author | Dennis Concepción Martín <66180929+denniscm190@users.noreply.github.com> |
---|---|
date | Thu, 22 Apr 2021 23:44:20 +0200 |
parents | f3cb5bdea8e5 |
children | 79c39987aaa4 |
comparison
equal
deleted
inserted
replaced
378:6802c2393203 | 379:a7e2c5a7b4f6 |
---|---|
10 | 10 |
11 struct StockRow: View { | 11 struct StockRow: View { |
12 var listName: String | 12 var listName: String |
13 var list: [String: QuoteModel] | 13 var list: [String: QuoteModel] |
14 var intradayPrices: [String: [IntradayPriceModel]]? | 14 var intradayPrices: [String: [IntradayPriceModel]]? |
15 var addOnDelete: Bool | |
15 | 16 |
16 @State private var showExtensiveList = false | 17 @State private var showExtensiveList = false |
17 | 18 |
18 var body: some View { | 19 var body: some View { |
19 VStack(alignment: .leading) { | 20 VStack(alignment: .leading) { |
46 } | 47 } |
47 .frame(height: 250) | 48 .frame(height: 250) |
48 } | 49 } |
49 .padding(.bottom) | 50 .padding(.bottom) |
50 .sheet(isPresented: $showExtensiveList) { | 51 .sheet(isPresented: $showExtensiveList) { |
51 ExtensiveList(listName: listName, list: list, intradayPrices: intradayPrices, latestCurrencies: nil) | 52 ExtensiveList(listName: listName, list: list, intradayPrices: intradayPrices, latestCurrencies: nil, addOnDelete: addOnDelete) |
52 } | 53 } |
53 } | 54 } |
54 } | 55 } |
55 | 56 |
56 | 57 |
57 struct StockRectangleRow_Previews: PreviewProvider { | 58 struct StockRectangleRow_Previews: PreviewProvider { |
58 static var previews: some View { | 59 static var previews: some View { |
59 StockRow( | 60 StockRow( |
60 listName: "Gainers", | 61 listName: "Gainers", |
61 list: ["AAPL": QuoteModel(changePercent: 0.03, companyName: "Apple Inc", latestPrice: 130.3)], | 62 list: ["AAPL": QuoteModel(changePercent: 0.03, companyName: "Apple Inc", latestPrice: 130.3)], |
62 intradayPrices: ["AAPL": [IntradayPriceModel(open: 130.2)]] | 63 intradayPrices: ["AAPL": [IntradayPriceModel(open: 130.2)]], addOnDelete: false |
63 ) | 64 ) |
64 } | 65 } |
65 } | 66 } |