summaryrefslogtreecommitdiff
path: root/Jel/Views/ContentView.swift
diff options
context:
space:
mode:
Diffstat (limited to 'Jel/Views/ContentView.swift')
-rw-r--r--Jel/Views/ContentView.swift34
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()
}