DevicesView.swift 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  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 DevicesView: 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("Setup & Configuraton"),
  34. content: {
  35. Text("Pump").navigationLink(to: .pumpConfig, from: self)
  36. Text("Pump Settings").navigationLink(to: .pumpSettingsEditor, from: self)
  37. Text("TODO: Migrate Settings into Pump 👆")
  38. Text("CGM").navigationLink(to: .cgm, from: self)
  39. Text("Watch").navigationLink(to: .watch, from: self)
  40. }
  41. )
  42. .listRowBackground(Color.chart)
  43. }
  44. .scrollContentBackground(.hidden).background(color)
  45. .navigationTitle("Devices")
  46. .navigationBarTitleDisplayMode(.automatic)
  47. }
  48. }