Mercurial > public > lazybear
diff LazyBear/Views/Company/Insiders.swift @ 411:681fb377235e
Implementing insider transactions
author | Dennis Concepción Martín <66180929+denniscm190@users.noreply.github.com> |
---|---|
date | Mon, 07 Jun 2021 20:59:52 +0200 |
parents | dc8dccd18e86 |
children | a7c9dd0c5822 |
line wrap: on
line diff
--- a/LazyBear/Views/Company/Insiders.swift Sun Jun 06 19:07:52 2021 +0200 +++ b/LazyBear/Views/Company/Insiders.swift Mon Jun 07 20:59:52 2021 +0200 @@ -13,24 +13,12 @@ var body: some View { if company.showInsidersView { - if let insiderSummer = company.insidersData.insiderRoster { - VStack(alignment: .leading) { - Text("Top 10 insiders") - .font(.title3) - .fontWeight(.semibold) + if let insiderSummary = company.insidersData.insiderRoster { + InsiderList(insiderSummary: insiderSummary, numberOfRows: 4) + } + + if let insiderTransactions = company.insidersData.insiderTransactions { - // Get total shares owned by the top 10 insiders - let totalPositions = insiderSummer.map { $0.position }.reduce(0, +) - VStack(alignment: .leading, spacing: 20) { - ForEach(insiderSummer.prefix(10), id: \.self) { insider in - - // Compute percentage of ownership for each insider - let percentage = Double(insider.position) / Double(totalPositions) - - InsiderRow(percentageOfWidth: CGFloat(percentage), insiderRoster: insider) - } - } - } } } else { ProgressView()