IceCubesApp/IceCubesApp/App/Tabs/Settings/HapticSettingsView.swift

31 lines
900 B
Swift
Raw Normal View History

2023-02-04 16:38:48 +00:00
import DesignSystem
import Env
import Models
import Status
import SwiftUI
2023-09-19 07:18:20 +00:00
@MainActor
2023-02-04 16:38:48 +00:00
struct HapticSettingsView: View {
2023-09-18 19:03:52 +00:00
@Environment(Theme.self) private var theme
2023-09-19 07:18:20 +00:00
@Environment(UserPreferences.self) private var userPreferences
2023-02-04 16:38:48 +00:00
var body: some View {
2023-09-19 07:18:20 +00:00
@Bindable var userPreferences = userPreferences
2023-02-04 16:38:48 +00: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 08:48:12 +00:00
#if !os(visionOS)
2023-02-04 16:38:48 +00:00
.listRowBackground(theme.primaryBackgroundColor)
2023-12-19 08:48:12 +00:00
#endif
2023-02-04 16:38:48 +00:00
}
.navigationTitle("settings.haptic.navigation-title")
2023-12-19 08:48:12 +00:00
#if !os(visionOS)
2023-02-04 16:38:48 +00:00
.scrollContentBackground(.hidden)
.background(theme.secondaryBackgroundColor)
2023-12-19 08:48:12 +00:00
#endif
2023-02-04 16:38:48 +00:00
}
}