-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathKeihatsu_iOSApp.swift
More file actions
53 lines (48 loc) · 1.36 KB
/
Copy pathKeihatsu_iOSApp.swift
File metadata and controls
53 lines (48 loc) · 1.36 KB
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
45
46
47
48
49
50
51
52
53
//
// Keihatsu_iOSApp.swift
// Keihatsu-iOS
//
// Created by admin on 5/27/26.
//
//import SwiftUI
//
//@main
//struct Keihatsu_iOSApp: App {
// @StateObject private var appEnvironment = AppEnvironment()
// @StateObject private var appRouter = AppRouter()
//
// var body: some Scene {
// WindowGroup {
// AppRootView()
// .environmentObject(appEnvironment)
// .environmentObject(appRouter)
// .environment(\.keihatsuTheme, appEnvironment.theme)
// }
// }
//}
import SwiftUI
@main
struct Keihatsu_iOSApp: App {
@StateObject private var preferencesStore = AppPreferencesStore()
@StateObject private var syncQueueStore = SyncQueueStore()
var body: some Scene {
WindowGroup {
ContentView()
.environmentObject(preferencesStore)
.environmentObject(syncQueueStore)
.environment(\.keihatsuTheme, KeihatsuTheme.default)
.preferredColorScheme(preferredColorScheme)
.tint(Color(hex: preferencesStore.preferences.theme.hex))
}
}
private var preferredColorScheme: ColorScheme? {
switch preferencesStore.preferences.colorScheme {
case .system:
return nil
case .light:
return .light
case .dark:
return .dark
}
}
}