comparison LazyBear/Views/Global Helpers/StockItem.swift @ 402:8357b101df67

Implementing CompanyView in NavigationLinks
author Dennis Concepción Martín <66180929+denniscm190@users.noreply.github.com>
date Fri, 21 May 2021 23:39:40 +0200
parents 933546fa5651
children 2984d8946342
comparison
equal deleted inserted replaced
401:f843c6382529 402:8357b101df67
19 var orientation: OrientationView 19 var orientation: OrientationView
20 var hidePriceView: Bool? 20 var hidePriceView: Bool?
21 21
22 var body: some View { 22 var body: some View {
23 if orientation == .vertical { 23 if orientation == .vertical {
24 return AnyView(VerticalStockRow(symbol: symbol, company: company, intradayPrices: intradayPrices)) 24 let verticalRow: AnyView = AnyView(
25 NavigationLink(destination: CompanyView(symbol: symbol)) {
26 VerticalStockRow(symbol: symbol, company: company, intradayPrices: intradayPrices)
27 }
28 .buttonStyle(PlainButtonStyle())
29 )
30 return verticalRow
25 } else { 31 } else {
26 return AnyView(HorizontalStockRow(symbol: symbol, company: company, intradayPrices: intradayPrices, hidePriceView: hidePriceView ?? false)) 32 let horizontalRow: AnyView = AnyView(
33 NavigationLink(destination: CompanyView(symbol: symbol)) {
34 HorizontalStockRow(symbol: symbol, company: company, intradayPrices: intradayPrices, hidePriceView: hidePriceView ?? false)
35 }
36 )
37 return horizontalRow
27 } 38 }
28 } 39 }
29 } 40 }
30 41
31 struct StockItem_Previews: PreviewProvider { 42 struct StockItem_Previews: PreviewProvider {