diff --git a/SwiftLeeds/Views/About/AboutView.swift b/SwiftLeeds/Views/About/AboutView.swift index 1d383c4..ea48039 100644 --- a/SwiftLeeds/Views/About/AboutView.swift +++ b/SwiftLeeds/Views/About/AboutView.swift @@ -144,7 +144,7 @@ struct AboutView: View { .ignoresSafeArea(edges: .bottom) } .sheet(isPresented: $isFullAboutShown) { - NavigationView { + NavigationStack { ScrollView { VStack(alignment: .leading, spacing: Padding.cellGap) { Text(aboutSwiftLeeds) diff --git a/SwiftLeeds/Views/My Conference/MyConferenceView.swift b/SwiftLeeds/Views/My Conference/MyConferenceView.swift index 08c77f1..ce5e994 100644 --- a/SwiftLeeds/Views/My Conference/MyConferenceView.swift +++ b/SwiftLeeds/Views/My Conference/MyConferenceView.swift @@ -8,7 +8,7 @@ struct MyConferenceView: View { @Namespace private var namespace var body: some View { - NavigationView { + NavigationStack { VStack(spacing: 0) { Divider() @@ -52,7 +52,6 @@ struct MyConferenceView: View { } } } - .navigationViewStyle(.stack) .accentColor(.white) .task { try? await viewModel.loadSchedule() diff --git a/SwiftLeeds/Views/Tab/SidebarMainView.swift b/SwiftLeeds/Views/Tab/SidebarMainView.swift index 15cb629..d0200cb 100644 --- a/SwiftLeeds/Views/Tab/SidebarMainView.swift +++ b/SwiftLeeds/Views/Tab/SidebarMainView.swift @@ -21,6 +21,5 @@ struct SidebarMainView: View { SettingsView() } } - } } diff --git a/SwiftLeeds/Views/Tab/SidebarView.swift b/SwiftLeeds/Views/Tab/SidebarView.swift index 256fca4..7fb4b64 100644 --- a/SwiftLeeds/Views/Tab/SidebarView.swift +++ b/SwiftLeeds/Views/Tab/SidebarView.swift @@ -1,3 +1,4 @@ +import Settings import SwiftUI struct SidebarView: View { @@ -25,6 +26,12 @@ struct SidebarView: View { }) { Label("Sponsors", systemImage: "sparkles") } + + NavigationLink(destination: SettingsView().onAppear { + appState.selectedTab = .settings + }) { + Label("Settings", systemImage: "gearshape.fill") + } } .listStyle(.sidebar) } diff --git a/SwiftLeeds/Views/Tab/Tabs.swift b/SwiftLeeds/Views/Tab/Tabs.swift index 175f6c6..94913a6 100644 --- a/SwiftLeeds/Views/Tab/Tabs.swift +++ b/SwiftLeeds/Views/Tab/Tabs.swift @@ -1,3 +1,4 @@ +import ColorTheme import SwiftUI struct Tabs: View { @@ -14,8 +15,8 @@ struct Tabs: View { } } -struct Tabs_Previews: PreviewProvider { - static var previews: some View { - Tabs() - } +#Preview { + Tabs() + .environmentObject(AppState()) + .environmentObject(ThemeManager.shared) } diff --git a/SwiftLeedsPackage/Sources/Settings/SettingsView.swift b/SwiftLeedsPackage/Sources/Settings/SettingsView.swift index b71e7c9..b8d1968 100644 --- a/SwiftLeedsPackage/Sources/Settings/SettingsView.swift +++ b/SwiftLeedsPackage/Sources/Settings/SettingsView.swift @@ -8,7 +8,7 @@ public struct SettingsView: View { public init() {} public var body: some View { - NavigationView { + NavigationStack { List { Section("App Icon") { LazyVGrid(columns: Array(repeating: GridItem(.flexible()), count: 3), spacing: 16) { @@ -24,7 +24,7 @@ public struct SettingsView: View { } .padding(.vertical, 8) } - + Section("Appearance") { Picker("Theme", selection: $themeManager.currentTheme) { ForEach(ThemeOption.allCases, id: \.self) { theme in @@ -35,7 +35,7 @@ public struct SettingsView: View { themeManager.setTheme(newTheme) } } - + Section("About") { HStack { Text("Version") @@ -43,11 +43,11 @@ public struct SettingsView: View { Text(viewModel.appVersion) .foregroundColor(.secondary) } - + Button("Contact Us") { viewModel.openContactUs() } - + Button("Code of Conduct") { viewModel.openCodeOfConduct() }