Mercurial > public > lazybear
diff LazyBear/Views/Search/Helpers/SearchedCompanyItem.swift @ 358:280cbc5653b5
SearchView implemented
author | Dennis Concepción Martín <66180929+denniscm190@users.noreply.github.com> |
---|---|
date | Fri, 16 Apr 2021 17:03:48 +0200 |
parents | |
children | db8bc3ed526a |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/LazyBear/Views/Search/Helpers/SearchedCompanyItem.swift Fri Apr 16 17:03:48 2021 +0200 @@ -0,0 +1,39 @@ +// +// SearchedCompanyItem.swift +// LazyBear +// +// Created by Dennis Concepción Martín on 3/4/21. +// + +import SwiftUI + +struct SearchedCompanyItem: View { + var company: SearchResponse + + var body: some View { + HStack { + VStack(alignment: .leading) { + Text(company.symbol!.uppercased()) + .fontWeight(.semibold) + + Text(company.securityName!.capitalized) + .lineLimit(1) + } + + Spacer() + + VStack(alignment: .trailing) { + Text(company.currency!) + .fontWeight(.semibold) + + Text(company.region!) + } + } + } +} + +struct CompanyRow_Previews: PreviewProvider { + static var previews: some View { + SearchedCompanyItem(company: SearchResponse(currency: "USD", region: "US", securityName: "apple inc", symbol: "aapl")) + } +}