jel/Jel/Views/ContentView.swift

45 lines
898 B
Swift
Raw Normal View History

2023-12-11 19:27:48 +00:00
//
// ContentView.swift
// Jel
//
// Created by zerocool on 12/11/23.
//
import SwiftUI
2023-12-13 00:51:54 +00:00
import PulseUI
2023-12-11 19:27:48 +00:00
struct ContentView: View {
2023-12-15 15:41:00 +00:00
@EnvironmentObject var jellyfinClient: JellyfinClientController
2023-12-13 00:51:54 +00:00
2023-12-15 15:41:00 +00:00
@StateObject var settingsController: SettingsController = SettingsController.shared
@StateObject var authState: AuthStateController = AuthStateController.shared
2023-12-13 00:51:54 +00:00
@State var showingConsoleSheet: Bool = false
2023-12-12 06:22:43 +00:00
var body: some View {
2023-12-13 00:51:54 +00:00
VStack {
if !authState.loggedIn {
2023-12-15 15:41:00 +00:00
SignInView()
2023-12-13 00:51:54 +00:00
} else {
2023-12-15 15:41:00 +00:00
NavigationStack {
DashboardView()
2023-12-11 19:27:48 +00:00
}
2023-12-13 00:51:54 +00:00
}
2023-12-11 19:27:48 +00:00
}
2023-12-13 00:51:54 +00:00
.padding()
2023-12-15 15:41:00 +00:00
.preferredColorScheme({
switch settingsController.appearance {
case .dark:
return ColorScheme.dark
case .light:
return ColorScheme.light
case .automatic:
return .none
}
}())
2023-12-13 00:51:54 +00:00
}
2023-12-11 19:27:48 +00:00
}
#Preview {
2023-12-15 15:41:00 +00:00
ContentView()
2023-12-11 19:27:48 +00:00
}