Explorar o código

Remove Statistics from settings, add to History view

Deniz Cengiz hai 1 ano
pai
achega
477a048785

+ 14 - 2
FreeAPS/Sources/Modules/DataTable/View/DataTableRootView.swift

@@ -143,12 +143,24 @@ extension DataTable {
                 .navigationTitle("History")
                 .navigationBarTitleDisplayMode(.large)
                 .toolbar {
-                    ToolbarItem(placement: .topBarTrailing) {
+                    ToolbarItem(placement: .topBarLeading, content: {
+                        Button(
+                            action: { state.showModal(for: .statistics) },
+                            label: {
+                                HStack {
+                                    Text("Statistics")
+                                }
+                            }
+                        )
+                    })
+                }
+                .toolbar {
+                    ToolbarItem(placement: .topBarTrailing, content: {
                         addButton({
                             showManualGlucose = true
                             state.manualGlucose = 0
                         })
-                    }
+                    })
                 }
                 .sheet(isPresented: $showManualGlucose) {
                     addGlucoseView()

+ 0 - 2
FreeAPS/Sources/Modules/Settings/View/SettingsRootView.swift

@@ -80,8 +80,6 @@ extension Settings {
                                         }
                                     }
                                 }
-
-                                Text("Statistics").navigationLink(to: .statistics, from: self)
                             }
                         }
                     ).listRowBackground(Color.chart)

+ 13 - 1
FreeAPS/Sources/Modules/Stat/View/StatRootView.swift

@@ -148,7 +148,19 @@ extension Stat {
             }.background(color)
                 .onAppear(perform: configureView)
                 .navigationBarTitle("Statistics")
-                .navigationBarTitleDisplayMode(.large)
+                .navigationBarTitleDisplayMode(.automatic)
+                .toolbar {
+                    ToolbarItem(placement: .topBarLeading, content: {
+                        Button(
+                            action: { state.hideModal() },
+                            label: {
+                                HStack {
+                                    Text("Close")
+                                }
+                            }
+                        )
+                    })
+                }
         }
     }
 }