diff LazyBear/Views/Company/Helpers/KeyStatsHelper.swift @ 447:8621ba6fd457

Fixes #48
author Dennis Concepción Martín <dennisconcepcionmartin@gmail.com>
date Wed, 23 Jun 2021 10:54:47 +0200
parents 7d1c4dc8d1d8
children f71761f166f2
line wrap: on
line diff
--- a/LazyBear/Views/Company/Helpers/KeyStatsHelper.swift	Tue Jun 22 19:57:08 2021 +0200
+++ b/LazyBear/Views/Company/Helpers/KeyStatsHelper.swift	Wed Jun 23 10:54:47 2021 +0200
@@ -10,7 +10,6 @@
 struct KeyStatsHelper: View {
     var keyStats: KeyStatsModel?
     let displayWords: DisplayWordsModel = parseJSON("DisplayWords.json")
-    @State private var showList = false
     @Environment(\.colorScheme) private var colorScheme
     
     var body: some View {
@@ -24,7 +23,9 @@
                         if let unwrappedValue = unwrapAnyOptional(value: child.value) {
                             let label = String(child.label!)
                             
-                            Button(action: { showList = true }) {
+                            NavigationLink(destination: KeyStatsList(keyStats: keyStats)
+                                            .navigationTitle("Key Stats")
+                            ) {
                                 Capsule()
                                     .frame(width: 250, height: 40)
                                     .foregroundColor(Color("customSecondaryBackground"))
@@ -53,9 +54,6 @@
                 .frame(height: 70)
                 .padding(.horizontal)
             }
-            .sheet(isPresented: $showList) {
-                KeyStatsList(keyStats: keyStats, isPresented: $showList)
-            }
         }
     }