ServicesView.swift 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. //
  2. // FeatureSettingsView.swift
  3. // FreeAPS
  4. //
  5. // Created by Deniz Cengiz on 26.07.24.
  6. //
  7. import Foundation
  8. import HealthKit
  9. import SwiftUI
  10. import Swinject
  11. struct ServicesView: BaseView {
  12. let resolver: Resolver
  13. @ObservedObject var state: Settings.StateModel
  14. @Environment(\.colorScheme) var colorScheme
  15. @Environment(AppState.self) var appState
  16. var body: some View {
  17. Form {
  18. Section(
  19. header: Text("Connected Services"),
  20. content: {
  21. Text("Nightscout").navigationLink(to: .nighscoutConfig, from: self)
  22. Text("Tidepool").navigationLink(to: .tidepoolConfig, from: self)
  23. if HKHealthStore.isHealthDataAvailable() {
  24. Text("Apple Health").navigationLink(to: .healthkit, from: self)
  25. }
  26. }
  27. )
  28. .listRowBackground(Color.chart)
  29. }
  30. .scrollContentBackground(.hidden)
  31. .background(appState.trioBackgroundColor(for: colorScheme))
  32. .navigationTitle("Services")
  33. .navigationBarTitleDisplayMode(.automatic)
  34. }
  35. }