Mercurial > public > lazybear
view LazyBear/Views/Company/Insiders.swift @ 412:a7c9dd0c5822
Main insider view implemented
author | Dennis Concepción Martín <66180929+denniscm190@users.noreply.github.com> |
---|---|
date | Tue, 08 Jun 2021 11:46:58 +0200 |
parents | 681fb377235e |
children |
line wrap: on
line source
// // Insiders.swift // LazyBear // // Created by Dennis Concepción Martín on 23/5/21. // import SwiftUI struct Insiders: View { @ObservedObject var company: Company var symbol: String var body: some View { if company.showInsidersView { VStack { if let insiderSummary = company.insidersData.insiderRoster { InsiderList(insiderSummary: insiderSummary) .padding(.bottom) } if let transactions = company.insidersData.insiderTransactions { TransactionList(transactions: transactions) } } } else { ProgressView() .onAppear { let url = "https://api.lazybear.app/company/insiders/symbol=\(symbol)" company.request(url, .initial, "insider") } } } } struct Insiders_Previews: PreviewProvider { static var previews: some View { Insiders(company: Company(), symbol: "aapl") } }