Mercurial > public > lazybear
view LazyBear/Views/Company/Insiders.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 | a7c9dd0c5822 |
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") } }