Mercurial > public > lazybear
diff LazyBear/Views/Company/CompanyView.swift @ 434:277197ce1416
Delete CompanyView and Helpers
author | Dennis Concepción Martín <dennisconcepcionmartin@gmail.com> |
---|---|
date | Sun, 20 Jun 2021 12:36:55 +0200 |
parents | 5f21f7c23c5e |
children | 7f2a24a774eb |
line wrap: on
line diff
--- a/LazyBear/Views/Company/CompanyView.swift Sat Jun 19 20:40:33 2021 +0200 +++ b/LazyBear/Views/Company/CompanyView.swift Sun Jun 20 12:36:55 2021 +0200 @@ -2,57 +2,19 @@ // CompanyView.swift // LazyBear // -// Created by Dennis Concepción Martín on 8/5/21. +// Created by Dennis Concepción Martín on 20/6/21. // import SwiftUI -import StockCharts struct CompanyView: View { - var symbol: String - @ObservedObject var company = Company() - @State private var showViewSelector = false - - /* - Views - */ - @State private var showChartView = true - @State private var showInsiderView = false - var body: some View { - ScrollView { - VStack { - CompanyHeader(symbol: symbol, showViewSelector: $showViewSelector) - .padding(.bottom) - - if showChartView { - Chart(company: company, symbol: symbol) - } else if showInsiderView { - Insiders(company: company, symbol: symbol) - } - } - .padding() - } - .actionSheet(isPresented: $showViewSelector) { - ActionSheet(title: Text("Select an option"), buttons: [ - .default(Text("Chart & News")) { resetViews(); showChartView = true }, - .default(Text("Insiders")) { resetViews(); showInsiderView = true }, - .cancel() - ]) - } - } - - /* - Hide all views to show the one selected by user - */ - private func resetViews() { - showChartView = false - showInsiderView = false + Text(/*@START_MENU_TOKEN@*/"Hello, World!"/*@END_MENU_TOKEN@*/) } } struct CompanyView_Previews: PreviewProvider { static var previews: some View { - CompanyView(symbol: "AAPL") + CompanyView() } }