comparison LazyBear/Views/Company/CompanyView.swift @ 442:6eae10397501

Implementing NewsHelper in CompanyView
author Dennis Concepción Martín <dennisconcepcionmartin@gmail.com>
date Mon, 21 Jun 2021 13:28:45 +0200
parents 417148200aaf
children ffbb1dbab531
comparison
equal deleted inserted replaced
441:417148200aaf 442:6eae10397501
27 27
28 Spacer() 28 Spacer()
29 } 29 }
30 .padding(.horizontal) 30 .padding(.horizontal)
31 31
32 Picker("", selection: $selectedRange) { 32 Picker("Select a range", selection: $selectedRange) {
33 ForEach(ranges, id: \.self) { 33 ForEach(ranges, id: \.self) {
34 Text($0) 34 Text($0)
35 } 35 }
36 } 36 }
37 .pickerStyle(SegmentedPickerStyle()) 37 .pickerStyle(SegmentedPickerStyle())
41 company.request(url, .refresh) 41 company.request(url, .refresh)
42 }) 42 })
43 43
44 ChartHelper(company: company) 44 ChartHelper(company: company)
45 KeyStatsHelper(keyStats: company.data.keyStats) 45 KeyStatsHelper(keyStats: company.data.keyStats)
46 if let latestNews = company.data.latestNews {
47 NewsHelper(latestNews: latestNews)
48 .padding([.horizontal, .bottom])
49 }
46 } 50 }
47 } 51 }
48 .background(Color("customBackground").edgesIgnoringSafeArea(.all)) 52 .background(Color("customBackground").edgesIgnoringSafeArea(.all))
49 .navigationTitle(symbol.uppercased()) 53 .navigationTitle(symbol.uppercased())
50 } 54 }