2020-07-22 13:57:10 +00:00
|
|
|
import SwiftUI
|
|
|
|
|
|
|
|
@main
|
|
|
|
struct WriteFreely_MultiPlatformApp: App {
|
2020-08-11 18:32:45 +00:00
|
|
|
@StateObject private var preferences = PreferencesModel()
|
2020-08-11 20:27:14 +00:00
|
|
|
@StateObject private var account = AccountModel()
|
2020-08-11 18:32:45 +00:00
|
|
|
|
2020-08-03 16:16:41 +00:00
|
|
|
#if DEBUG
|
|
|
|
@StateObject private var store = testPostStore
|
|
|
|
#else
|
2020-07-25 11:02:11 +00:00
|
|
|
@StateObject private var store = PostStore()
|
2020-08-03 16:16:41 +00:00
|
|
|
#endif
|
2020-07-31 17:40:40 +00:00
|
|
|
|
2020-07-22 13:57:10 +00:00
|
|
|
var body: some Scene {
|
|
|
|
WindowGroup {
|
2020-08-11 20:27:14 +00:00
|
|
|
ContentView(postStore: store, preferences: preferences, account: account)
|
2020-08-11 18:44:34 +00:00
|
|
|
.preferredColorScheme(preferences.preferredColorScheme)
|
2020-07-22 13:57:10 +00:00
|
|
|
}
|
2020-08-07 20:30:09 +00:00
|
|
|
|
|
|
|
#if os(macOS)
|
|
|
|
Settings {
|
2020-08-11 21:03:17 +00:00
|
|
|
SettingsView(preferences: preferences, account: account)
|
2020-08-10 16:54:29 +00:00
|
|
|
.frame(minWidth: 300, maxWidth: 300, minHeight: 200, maxHeight: 200)
|
|
|
|
.padding()
|
2020-08-11 20:27:14 +00:00
|
|
|
.preferredColorScheme(preferences.preferredColorScheme)
|
2020-08-07 20:30:09 +00:00
|
|
|
}
|
|
|
|
#endif
|
2020-07-22 13:57:10 +00:00
|
|
|
}
|
|
|
|
}
|