diff LazyBear/Views/Home/Helpers/StockRow.swift @ 453:37c13ebda381

Improve hierarchy and minor bugs fixed
author Dennis Concepción Martín <dennisconcepcionmartin@gmail.com>
date Sun, 27 Jun 2021 14:18:29 +0200
parents 4255f94d0767
children
line wrap: on
line diff
--- a/LazyBear/Views/Home/Helpers/StockRow.swift	Sat Jun 26 18:45:31 2021 +0200
+++ b/LazyBear/Views/Home/Helpers/StockRow.swift	Sun Jun 27 14:18:29 2021 +0200
@@ -11,9 +11,6 @@
 struct StockRow: View {
     var listName: String
     var companies: [CompanyModel]
-
-    @State private var showList = false
-    @Environment(\.managedObjectContext) private var moc
     
     var body: some View {
         VStack(alignment: .leading) {
@@ -31,9 +28,15 @@
                 }
                 
                 Spacer()
-                Button("See all", action: { showList = true })
-                    .buttonStyle(BorderlessButtonStyle())
-                    .padding(.horizontal)
+                NavigationLink(destination: StockSheet(listName: adaptListTitle(listName), companies: companies)
+                                .navigationTitle(adaptListTitle(listName))
+                ) {
+                    HStack {
+                        Text("See all")
+                        Image(systemName: "chevron.right")
+                    }
+                }
+                .padding(.horizontal)
             }
             
             ScrollView(.horizontal, showsIndicators: false) {
@@ -51,10 +54,6 @@
             }
             .frame(height: 250)
         }
-        .padding(.bottom)
-        .sheet(isPresented: $showList) {
-            StockSheet(listName: adaptListTitle(listName), companies: companies)
-        }
     }
     
     /*