2023-02-04 17:38:48 +01:00
|
|
|
import DesignSystem
|
|
|
|
import Env
|
|
|
|
import Models
|
2024-01-06 19:27:26 +01:00
|
|
|
import StatusKit
|
2023-02-04 17:38:48 +01:00
|
|
|
import SwiftUI
|
|
|
|
|
2023-09-19 09:18:20 +02:00
|
|
|
@MainActor
|
2023-02-04 17:38:48 +01:00
|
|
|
struct HapticSettingsView: View {
|
2023-09-18 21:03:52 +02:00
|
|
|
@Environment(Theme.self) private var theme
|
2023-09-19 09:18:20 +02:00
|
|
|
@Environment(UserPreferences.self) private var userPreferences
|
2023-02-04 17:38:48 +01:00
|
|
|
|
|
|
|
var body: some View {
|
2023-09-19 09:18:20 +02:00
|
|
|
@Bindable var userPreferences = userPreferences
|
2023-02-04 17:38:48 +01:00
|
|
|
Form {
|
|
|
|
Section {
|
|
|
|
Toggle("settings.haptic.timeline", isOn: $userPreferences.hapticTimelineEnabled)
|
|
|
|
Toggle("settings.haptic.tab-selection", isOn: $userPreferences.hapticTabSelectionEnabled)
|
|
|
|
Toggle("settings.haptic.buttons", isOn: $userPreferences.hapticButtonPressEnabled)
|
|
|
|
}
|
2023-12-19 09:51:20 +01:00
|
|
|
#if !os(visionOS)
|
2023-02-04 17:38:48 +01:00
|
|
|
.listRowBackground(theme.primaryBackgroundColor)
|
2023-12-19 09:51:20 +01:00
|
|
|
#endif
|
2023-02-04 17:38:48 +01:00
|
|
|
}
|
|
|
|
.navigationTitle("settings.haptic.navigation-title")
|
2023-12-19 09:51:20 +01:00
|
|
|
#if !os(visionOS)
|
2024-02-14 12:48:14 +01:00
|
|
|
.scrollContentBackground(.hidden)
|
|
|
|
.background(theme.secondaryBackgroundColor)
|
2023-12-19 09:51:20 +01:00
|
|
|
#endif
|
2023-02-04 17:38:48 +01:00
|
|
|
}
|
|
|
|
}
|