Mercurial > public > lazybear
changeset 408:f9611c94d636
Fixes #45
author | Dennis Concepción Martín <66180929+denniscm190@users.noreply.github.com> |
---|---|
date | Sun, 06 Jun 2021 17:39:22 +0200 |
parents | c804ce7a1560 |
children | dc8dccd18e86 |
files | LazyBear.xcodeproj/project.xcworkspace/xcuserdata/dennis.xcuserdatad/UserInterfaceState.xcuserstate LazyBear/ContentView.swift LazyBear/Views/Company/Helpers/NewsRow.swift LazyBear/Views/Company/Insiders.swift LazyBear/Views/Profile/ProfileView.swift |
diffstat | 5 files changed, 37 insertions(+), 34 deletions(-) [+] |
line wrap: on
line diff
Binary file LazyBear.xcodeproj/project.xcworkspace/xcuserdata/dennis.xcuserdatad/UserInterfaceState.xcuserstate has changed
--- a/LazyBear/ContentView.swift Sun Jun 06 13:11:41 2021 +0200 +++ b/LazyBear/ContentView.swift Sun Jun 06 17:39:22 2021 +0200 @@ -35,11 +35,6 @@ Text("Profile") } .tag(3) -// Text("The Last Tab") -// .tabItem { -// Image(systemName: "4.square.fill") -// Text("Forth") -// } } .onAppear { // isAppAlreadyLaunchedOnce()
--- a/LazyBear/Views/Company/Helpers/NewsRow.swift Sun Jun 06 13:11:41 2021 +0200 +++ b/LazyBear/Views/Company/Helpers/NewsRow.swift Sun Jun 06 17:39:22 2021 +0200 @@ -16,27 +16,35 @@ RowShape() .frame(height: 140) .overlay( - VStack(alignment: .leading) { - Text(new.source.uppercased()) - .font(.caption) - .opacity(0.5) + HStack { + VStack(alignment: .leading) { + Text(new.source.uppercased()) + .font(.caption) + .opacity(0.5) + + Text(new.headline) + .font(.headline) + + Text(new.summary) + .opacity(0.5) + .font(.subheadline) + .lineLimit(1) + .padding(.bottom, 5) + + let humanDate = convertEpoch(new.datetime, true) + Text("\(humanDate) ago") + .font(.caption2) + .opacity(0.5) + + } + .padding() - Text(new.headline) - .font(.headline) - - Text(new.summary) + Spacer() + Image(systemName: "chevron.right") + .imageScale(.large) .opacity(0.5) - .font(.subheadline) - .lineLimit(1) - .padding(.bottom, 5) - - let humanDate = convertEpoch(new.datetime, true) - Text("\(humanDate) ago") - .font(.caption2) - .opacity(0.5) - + .padding() } - .padding() ,alignment: .leading ) }
--- a/LazyBear/Views/Company/Insiders.swift Sun Jun 06 13:11:41 2021 +0200 +++ b/LazyBear/Views/Company/Insiders.swift Sun Jun 06 17:39:22 2021 +0200 @@ -14,14 +14,9 @@ var body: some View { if company.showInsidersView { VStack(alignment: .leading) { - HStack { - Text("Top net buyers") - .font(.title3) - .fontWeight(.semibold) - - Spacer() - Button("See all", action: { }) - } + Text("Top 10 insiders") + .font(.title3) + .fontWeight(.semibold) if let insiderSummer = company.insidersData.insiderRoster { @@ -34,7 +29,6 @@ let percentage = Double(insider.position) / Double(totalPositions) InsiderRow(percentageOfWidth: CGFloat(percentage), insiderRoster: insider) - .onAppear { print(percentage) } } } }
--- a/LazyBear/Views/Profile/ProfileView.swift Sun Jun 06 13:11:41 2021 +0200 +++ b/LazyBear/Views/Profile/ProfileView.swift Sun Jun 06 17:39:22 2021 +0200 @@ -41,8 +41,12 @@ } } .onAppear { self.timer = Timer.publish(every: 10, on: .main, in: .common).autoconnect() } // Start timer - .onReceive(timer) { _ in prepareUrl(.streaming) } .onDisappear { self.timer.upstream.connect().cancel() } // Stop timer + .onReceive(timer) { _ in + if !showCreateNewWatchlist { + prepareUrl(.streaming) + } + } .navigationTitle("My profile") .navigationBarTitleDisplayMode(.inline) .toolbar { @@ -59,7 +63,9 @@ } } else { ProgressView() - .onAppear { prepareUrl(.initial) } + .onAppear { + print("Appeared") + prepareUrl(.initial) } } }