Fixes navigation stack

release
Laurent 3 years ago
parent 87d15add1b
commit f2656068d0
  1. 5
      LeCountdown/LeCountdownApp.swift
  2. 16
      LeCountdown/Views/ContentView.swift
  3. 2
      LeCountdown/Views/PresetsView.swift
  4. 2
      LeCountdown/Views/RecordsView.swift

@ -36,7 +36,6 @@ struct LeCountdownApp: App {
WindowGroup { WindowGroup {
NavigationStack { NavigationStack {
TabView(selection: $tabSelection) { TabView(selection: $tabSelection) {
PresetsView(tabSelection: $tabSelection) PresetsView(tabSelection: $tabSelection)
.environment(\.managedObjectContext, persistenceController.container.viewContext) .environment(\.managedObjectContext, persistenceController.container.viewContext)
@ -50,10 +49,8 @@ struct LeCountdownApp: App {
RecordsView().environment(\.managedObjectContext, persistenceController.container.viewContext) RecordsView().environment(\.managedObjectContext, persistenceController.container.viewContext)
.tabItem { Label("Stats", systemImage: "chart.bar.fill") } .tabItem { Label("Stats", systemImage: "chart.bar.fill") }
.tag(2) .tag(2)
}.tabViewStyle(.page)
.foregroundColor(Color.accentColor)
} }
}.tabViewStyle(.page)
.onReceive(NotificationCenter.default.publisher(for: UIApplication.willEnterForegroundNotification)) { _ in .onReceive(NotificationCenter.default.publisher(for: UIApplication.willEnterForegroundNotification)) { _ in
self._willEnterForegroundNotification() self._willEnterForegroundNotification()
} }

@ -86,7 +86,6 @@ struct ContentView<T : AbstractTimer>: View {
var body: some View { var body: some View {
NavigationStack {
GeometryReader { reader in GeometryReader { reader in
let width: CGFloat = reader.size.width / 2 - 15.0 let width: CGFloat = reader.size.width / 2 - 15.0
@ -136,18 +135,6 @@ struct ContentView<T : AbstractTimer>: View {
self._reorderSpots(from: from, to: to) self._reorderSpots(from: from, to: to)
} }
} }
// ReorderableForEach(items: timersArray) { timer in
//
// DialView(timer: timer, isEditingBinding: self.$isEditing, frameSize: width)
// .environment(\.managedObjectContext, viewContext)
// .environmentObject(Conductor.maestro)
// .environmentObject(boringContext)
//
// } moveAction: { from, to in
// self._reorder(from: from, to: to)
// }
} }
}.padding(.horizontal, itemSpacing) }.padding(.horizontal, itemSpacing)
@ -161,7 +148,7 @@ struct ContentView<T : AbstractTimer>: View {
} }
} }
} }
// .navigationTitle("Yeah!") .navigationTitle("Home")
.alert(boringContext.error?.localizedDescription ?? "missing error", isPresented: $boringContext.showDefaultAlert) { .alert(boringContext.error?.localizedDescription ?? "missing error", isPresented: $boringContext.showDefaultAlert) {
Button("OK", role: .cancel) { } Button("OK", role: .cancel) { }
} }
@ -199,7 +186,6 @@ struct ContentView<T : AbstractTimer>: View {
.onOpenURL { url in .onOpenURL { url in
self._performActionIfPossible(url: url) self._performActionIfPossible(url: url)
} }
}
} }

@ -82,7 +82,6 @@ struct PresetsView: View {
var body: some View { var body: some View {
NavigationStack {
List { List {
ForEach(PresetSection.allCases) { section in ForEach(PresetSection.allCases) { section in
Section(header: Text(section.localizedName)) { Section(header: Text(section.localizedName)) {
@ -104,7 +103,6 @@ struct PresetsView: View {
.environment(\.managedObjectContext, viewContext) .environment(\.managedObjectContext, viewContext)
}) })
.navigationTitle("Presets") .navigationTitle("Presets")
}
} }
} }

@ -21,7 +21,7 @@ struct RecordsView: View {
var body: some View { var body: some View {
Group { VStack {
if records.isEmpty { if records.isEmpty {
Text("You don't have any recorded activity yet") Text("You don't have any recorded activity yet")
} else { } else {

Loading…
Cancel
Save