diff LazyBear/Views/Global Helpers/StockItem.swift @ 398:933546fa5651

Implementing CompanyView
author Dennis Concepción Martín <66180929+denniscm190@users.noreply.github.com>
date Sun, 09 May 2021 00:07:44 +0200
parents bd34e16b01ad
children 8357b101df67
line wrap: on
line diff
--- a/LazyBear/Views/Global Helpers/StockItem.swift	Sat May 08 19:23:06 2021 +0200
+++ b/LazyBear/Views/Global Helpers/StockItem.swift	Sun May 09 00:07:44 2021 +0200
@@ -61,7 +61,17 @@
                             .opacity(0.6)
                             .lineLimit(1)
                         
-                        PriceView(latestPrice: company.latestPrice ?? 0, changePercent: company.changePercent ?? 0, align: .leading)
+                        let priceViewStyle = PriceViewStyle(
+                            alignment: .leading,
+                            priceFont: .body,
+                            priceFontWeight: .semibold,
+                            percentFont: .callout,
+                            percentFontWeight: .semibold
+                        )
+                        
+                        PriceView(latestPrice: company.latestPrice ?? 0,
+                                  changePercent: company.changePercent ?? 0,
+                                  style: priceViewStyle)
                             .padding(.top)
                             
                     }
@@ -110,7 +120,17 @@
                         .padding(.leading)
                 }
                 
-                PriceView(latestPrice: company.latestPrice ?? 0, changePercent: company.changePercent ?? 0, align: .trailing)
+                let priceViewStyle = PriceViewStyle(
+                    alignment: .leading,
+                    priceFont: .body,
+                    priceFontWeight: .semibold,
+                    percentFont: .callout,
+                    percentFontWeight: .semibold
+                )
+                
+                PriceView(latestPrice: company.latestPrice ?? 0,
+                          changePercent: company.changePercent ?? 0,
+                          style: priceViewStyle)
                     // Center PriceView with the other rows
                     .frame(minWidth: 80, alignment: .trailing)
             }