FeatureSettingsView.swift 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. //
  2. // FeatureSettingsView.swift
  3. // FreeAPS
  4. //
  5. // Created by Deniz Cengiz on 26.07.24.
  6. //
  7. import Foundation
  8. import SwiftUI
  9. import Swinject
  10. struct FeatureSettingsView: BaseView {
  11. let resolver: Resolver
  12. @ObservedObject var state: Settings.StateModel
  13. @Environment(\.colorScheme) var colorScheme
  14. var color: LinearGradient {
  15. colorScheme == .dark ? LinearGradient(
  16. gradient: Gradient(colors: [
  17. Color.bgDarkBlue,
  18. Color.bgDarkerDarkBlue
  19. ]),
  20. startPoint: .top,
  21. endPoint: .bottom
  22. )
  23. :
  24. LinearGradient(
  25. gradient: Gradient(colors: [Color.gray.opacity(0.1)]),
  26. startPoint: .top,
  27. endPoint: .bottom
  28. )
  29. }
  30. var body: some View {
  31. Form {
  32. Section(
  33. header: Text("Trio Features"),
  34. content: {
  35. Text("Bolus Calculator").navigationLink(to: .bolusCalculatorConfig, from: self)
  36. Text("Meal Settings").navigationLink(to: .mealSettings, from: self)
  37. Text("Shortcuts").navigationLink(to: .shortcutsConfig, from: self)
  38. Text("Remote Control").navigationLink(to: .remoteControlConfig, from: self)
  39. }
  40. )
  41. .listRowBackground(Color.chart)
  42. Section(
  43. header: Text("Trio Personalization"),
  44. content: {
  45. Text("User Interface").navigationLink(to: .userInterfaceSettings, from: self)
  46. Text("App Icons").navigationLink(to: .iconConfig, from: self)
  47. }
  48. )
  49. .listRowBackground(Color.chart)
  50. //Section(
  51. //header: Text("Data-Driven Settings Tuning"),
  52. //content: {
  53. //Text("Autotune").navigationLink(to: .autotuneConfig, from: self)
  54. //}
  55. //)
  56. .listRowBackground(Color.chart)
  57. }
  58. .scrollContentBackground(.hidden).background(color)
  59. .navigationTitle("Feature Settings")
  60. .navigationBarTitleDisplayMode(.automatic)
  61. }
  62. }