000a24234c
- 3 screenshots at 1284x2778 (iPhone 6.5"): note list, note detail, settings - Docker WebDAV setup with 9 demo notes in Denote format for local screenshots - Fix theme not applying to NoteListView and NoteEditorView: move tint/preferredColorScheme from App.body (Scene) to RootView.body (View) so @Observable tracking works correctly - NoteEditorView (sheet) now also gets preferredColorScheme and tint directly - Add debug.password UserDefaults fallback in DEBUG builds for screenshot automation
43 lines
1.2 KiB
Swift
43 lines
1.2 KiB
Swift
import SwiftUI
|
|
|
|
@main
|
|
struct DotdenoteApp: App {
|
|
@State private var settings = WebDAVSettings()
|
|
|
|
var body: some Scene {
|
|
WindowGroup {
|
|
RootView()
|
|
.environment(settings)
|
|
}
|
|
}
|
|
}
|
|
|
|
struct RootView: View {
|
|
@Environment(WebDAVSettings.self) private var settings
|
|
@State private var client: WebDAVClient?
|
|
@State private var showSettings = false
|
|
@State private var themeManager = ThemeManager.shared
|
|
|
|
var body: some View {
|
|
Group {
|
|
if settings.isConfigured {
|
|
if let client {
|
|
NoteListView(onSettings: { showSettings = true })
|
|
.environmentObject(client)
|
|
.sheet(isPresented: $showSettings) {
|
|
SetupView(isInitial: false)
|
|
.environment(settings)
|
|
}
|
|
} else {
|
|
Color(.systemBackground)
|
|
.onAppear { client = WebDAVClient(settings: settings) }
|
|
}
|
|
} else {
|
|
SetupView(isInitial: true)
|
|
}
|
|
}
|
|
.tint(themeManager.current.accent)
|
|
.preferredColorScheme(themeManager.current.colorScheme)
|
|
}
|
|
}
|