Mercurial > public > lazybear
comparison LazyBearWatchOS Extension/Views/Home/CompanyView.swift @ 454:c79a3ed3d230
StockView for WatchOS implemented
author | Dennis Concepción Martín <dennisconcepcionmartin@gmail.com> |
---|---|
date | Sun, 27 Jun 2021 20:55:05 +0200 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
453:37c13ebda381 | 454:c79a3ed3d230 |
---|---|
1 // | |
2 // CompanyView.swift | |
3 // LazyBearWatchOS Extension | |
4 // | |
5 // Created by Dennis Concepción Martín on 27/06/2021. | |
6 // | |
7 | |
8 import SwiftUI | |
9 | |
10 struct CompanyView: View { | |
11 var symbol: String | |
12 var name: String | |
13 | |
14 @ObservedObject var company = Company() | |
15 | |
16 var body: some View { | |
17 List { | |
18 NavigationLink(destination: StockView(symbol: symbol, company: company) | |
19 .navigationTitle(name.capitalized) | |
20 ) { | |
21 Label("Stock Price", systemImage: "chart.bar") | |
22 } | |
23 | |
24 NavigationLink(destination: LatestNewsView(symbol: symbol, name: name, company: company) | |
25 .navigationTitle(name.capitalized) | |
26 ) { | |
27 Label("Latest News", systemImage: "newspaper") | |
28 } | |
29 | |
30 NavigationLink(destination: KeyStatsView(symbol: symbol, name: name, company: company) | |
31 .navigationTitle(name.capitalized) | |
32 ) { | |
33 Label("Key Stats", systemImage: "chart.pie") | |
34 } | |
35 | |
36 NavigationLink(destination: TopInsidersView(symbol: symbol, name: name, company: company) | |
37 .navigationTitle(name.capitalized) | |
38 ) { | |
39 Label("Top Insiders", systemImage: "person") | |
40 } | |
41 | |
42 NavigationLink(destination: InsiderTransactionsView(symbol: symbol, name: name, company: company) | |
43 .navigationTitle(name.capitalized) | |
44 ) { | |
45 Label("Transactions", systemImage: "creditcard.circle") | |
46 } | |
47 } | |
48 } | |
49 } | |
50 | |
51 struct CompanyView_Previews: PreviewProvider { | |
52 static var previews: some View { | |
53 CompanyView(symbol: "AAPL", name: "Apple Inc") | |
54 .navigationTitle("Apple Inc") | |
55 } | |
56 } |