summaryrefslogtreecommitdiff
path: root/Jel/Views/ContentView.swift
blob: 11a8277e3908326fa19eaacd8c288448442119df (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
//
//  ContentView.swift
//  Jel
//
//  Created by zerocool on 12/11/23.
//

import SwiftUI
import PulseUI

struct ContentView: View {
  @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 {
      if !authState.loggedIn {
        SignInView()
      } else {
        NavigationStack {
          DashBoardView()
        }
      }
    }
    .padding()
    .preferredColorScheme({
      switch settingsController.appearance {
        case .dark:
          return ColorScheme.dark
        case .light:
          return ColorScheme.light
        case .automatic:
          return .none
      }
    }())
  }
}

#Preview {
  ContentView()
}