comparison 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
comparison
equal deleted inserted replaced
357:eb97439e46cd 358:280cbc5653b5
1 //
2 // SearchedCompanyItem.swift
3 // LazyBear
4 //
5 // Created by Dennis Concepción Martín on 3/4/21.
6 //
7
8 import SwiftUI
9
10 struct SearchedCompanyItem: View {
11 var company: SearchResponse
12
13 var body: some View {
14 HStack {
15 VStack(alignment: .leading) {
16 Text(company.symbol!.uppercased())
17 .fontWeight(.semibold)
18
19 Text(company.securityName!.capitalized)
20 .lineLimit(1)
21 }
22
23 Spacer()
24
25 VStack(alignment: .trailing) {
26 Text(company.currency!)
27 .fontWeight(.semibold)
28
29 Text(company.region!)
30 }
31 }
32 }
33 }
34
35 struct CompanyRow_Previews: PreviewProvider {
36 static var previews: some View {
37 SearchedCompanyItem(company: SearchResponse(currency: "USD", region: "US", securityName: "apple inc", symbol: "aapl"))
38 }
39 }