- Move font settings to dedicated detail screen with larger preview - Add inline explanations directly under each setting - Reorganize sections: split General into Reading Settings and Sync Settings - Combine Legal, Privacy and Support into single section - Move "What's New" to combined Legal/Privacy/Support section - Redesign app info footer with muted styling and center alignment - Remove white backgrounds from font preview for better light/dark mode support
65 lines
1.7 KiB
Swift
65 lines
1.7 KiB
Swift
//
|
|
// SyncSettingsView.swift
|
|
// readeck
|
|
//
|
|
// Created by Ilyas Hallak on 08.11.25.
|
|
//
|
|
|
|
import SwiftUI
|
|
|
|
struct SyncSettingsView: View {
|
|
@State private var viewModel: SettingsGeneralViewModel
|
|
|
|
init(viewModel: SettingsGeneralViewModel = SettingsGeneralViewModel()) {
|
|
self.viewModel = viewModel
|
|
}
|
|
|
|
var body: some View {
|
|
Group {
|
|
#if DEBUG
|
|
Section {
|
|
Toggle("Automatic sync", isOn: $viewModel.autoSyncEnabled)
|
|
if viewModel.autoSyncEnabled {
|
|
Stepper("Sync interval: \(viewModel.syncInterval) minutes", value: $viewModel.syncInterval, in: 1...60)
|
|
}
|
|
} header: {
|
|
Text("Sync Settings")
|
|
}
|
|
|
|
if let successMessage = viewModel.successMessage {
|
|
Section {
|
|
HStack {
|
|
Image(systemName: "checkmark.circle.fill")
|
|
.foregroundColor(.green)
|
|
Text(successMessage)
|
|
.foregroundColor(.green)
|
|
}
|
|
}
|
|
}
|
|
if let errorMessage = viewModel.errorMessage {
|
|
Section {
|
|
HStack {
|
|
Image(systemName: "exclamationmark.triangle.fill")
|
|
.foregroundColor(.red)
|
|
Text(errorMessage)
|
|
.foregroundColor(.red)
|
|
}
|
|
}
|
|
}
|
|
#endif
|
|
}
|
|
.task {
|
|
await viewModel.loadGeneralSettings()
|
|
}
|
|
}
|
|
}
|
|
|
|
#Preview {
|
|
List {
|
|
SyncSettingsView(viewModel: .init(
|
|
MockUseCaseFactory()
|
|
))
|
|
}
|
|
.listStyle(.insetGrouped)
|
|
}
|