Mercurial > public > lazybear
diff LazyBear/Views/Company/Chart.swift @ 415:34f9e408b861
Minor UI Updates and tests
author | Dennis Concepción Martín <66180929+denniscm190@users.noreply.github.com> |
---|---|
date | Wed, 09 Jun 2021 12:49:17 +0200 |
parents | 2984d8946342 |
children | 5f21f7c23c5e |
line wrap: on
line diff
--- a/LazyBear/Views/Company/Chart.swift Wed Jun 09 10:57:25 2021 +0200 +++ b/LazyBear/Views/Company/Chart.swift Wed Jun 09 12:49:17 2021 +0200 @@ -19,6 +19,8 @@ // Set recurrent price request @State private var timer = Timer.publish(every: 10, on: .main, in: .common).autoconnect() + @State private var showingStatistics = false + var body: some View { if company.showChartView { VStack { @@ -43,13 +45,17 @@ orientation: .HStack, priceFont: .title3, priceFontWeight: .semibold, - percentFont: .headline, - percentFontWeight: .medium, + percentFont: .body, + percentFontWeight: .semibold, showBackground: true ) PriceView(latestPrice: latestPrice, changePercent: changePercent, style: priceViewStyle) } Spacer() + + if let _ = company.chartData.keyStats { + Button("See stats", action: { showingStatistics = true }) + } } .padding([.top, .leading, .trailing]) @@ -73,6 +79,9 @@ .padding(.top) } } + .sheet(isPresented: $showingStatistics) { + StatsView(keyStats: company.chartData.keyStats!) + } .onAppear { self.timer = Timer.publish(every: 10, on: .main, in: .common).autoconnect() } // Start timer .onDisappear { self.timer.upstream.connect().cancel() } // Stop timer .onReceive(timer) { _ in