diff options
author | Shav Kinderlehrer <[email protected]> | 2023-12-15 10:41:00 -0500 |
---|---|---|
committer | Shav Kinderlehrer <[email protected]> | 2023-12-15 10:41:00 -0500 |
commit | 2e3c12fed339c8bf3dc966217cbdf4c385fb98a1 (patch) | |
tree | 356a0bbfd24f98bf04545eb876cf20cd6179850e /Jel/Views/ContentView.swift | |
parent | 3994a6f408905049a5c280a303e30fe636b07968 (diff) | |
download | jel-2e3c12fed339c8bf3dc966217cbdf4c385fb98a1.tar.gz jel-2e3c12fed339c8bf3dc966217cbdf4c385fb98a1.zip |
Add settings view + fix signin flow
Diffstat (limited to 'Jel/Views/ContentView.swift')
-rw-r--r-- | Jel/Views/ContentView.swift | 34 |
1 files changed, 18 insertions, 16 deletions
diff --git a/Jel/Views/ContentView.swift b/Jel/Views/ContentView.swift index 91d5c7c..11a8277 100644 --- a/Jel/Views/ContentView.swift +++ b/Jel/Views/ContentView.swift @@ -9,34 +9,36 @@ import SwiftUI import PulseUI struct ContentView: View { - @ObservedObject var authState: AuthStateController + @EnvironmentObject var jellyfinClient: JellyfinClientController + @StateObject var settingsController: SettingsController = SettingsController.shared + + @StateObject var authState: AuthStateController = AuthStateController.shared @State var showingConsoleSheet: Bool = false var body: some View { VStack { - Button { - showingConsoleSheet.toggle() - } label: { - Label("Console", systemImage: "network") - } - .sheet(isPresented: $showingConsoleSheet) { - ConsoleSheetView(showingConsoleSheet: $showingConsoleSheet) - } - if !authState.loggedIn { - SignInView(authState: authState) + SignInView() } else { - Text("Logged in") - Button("Log out") { - authState.loggedIn = false - authState.save() + NavigationStack { + DashBoardView() } } } .padding() + .preferredColorScheme({ + switch settingsController.appearance { + case .dark: + return ColorScheme.dark + case .light: + return ColorScheme.light + case .automatic: + return .none + } + }()) } } #Preview { - ContentView(authState: AuthStateController()) + ContentView() } |