feat: in-app dark mode toggle (System / Light / Dark)
- AppearanceManager with UserDefaults persistence - Three modes: System (follows iOS), Light, Dark - Toggle in Home screen profile menu under "Appearance" - Applied via .preferredColorScheme at app root - Persists across app launches Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -3,6 +3,7 @@ import PhotosUI
|
||||
|
||||
struct HomeView: View {
|
||||
@Environment(AuthManager.self) private var auth
|
||||
@Environment(AppearanceManager.self) private var appearance
|
||||
@State private var vm = HomeViewModel()
|
||||
@State private var ringAnimated = false
|
||||
@Binding var selectedTab: Int
|
||||
@@ -50,6 +51,18 @@ struct HomeView: View {
|
||||
}
|
||||
}
|
||||
Divider()
|
||||
Menu {
|
||||
ForEach(AppearanceManager.Mode.allCases, id: \.self) { mode in
|
||||
Button {
|
||||
appearance.mode = mode
|
||||
} label: {
|
||||
Label(mode.label, systemImage: mode.icon)
|
||||
}
|
||||
}
|
||||
} label: {
|
||||
Label("Appearance", systemImage: appearance.mode.icon)
|
||||
}
|
||||
Divider()
|
||||
Button(role: .destructive) {
|
||||
Task { await auth.logout() }
|
||||
} label: {
|
||||
|
||||
Reference in New Issue
Block a user