DexcomSettingsView.swift 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. // LoopFollow
  2. // DexcomSettingsView.swift
  3. import SwiftUI
  4. struct DexcomSettingsView: View {
  5. @ObservedObject var viewModel: DexcomSettingsViewModel
  6. var body: some View {
  7. NavigationView {
  8. Form {
  9. Section(header: Text("Dexcom Settings")) {
  10. HStack {
  11. Text("User Name")
  12. TextField("Enter User Name", text: $viewModel.userName)
  13. .autocapitalization(.none)
  14. .disableAutocorrection(true)
  15. .multilineTextAlignment(.trailing)
  16. }
  17. HStack {
  18. Text("Password")
  19. TogglableSecureInput(
  20. placeholder: "Enter Password",
  21. text: $viewModel.password,
  22. style: .singleLine
  23. )
  24. }
  25. Picker("Server", selection: $viewModel.server) {
  26. Text("US").tag("US")
  27. Text("NON-US").tag("NON-US")
  28. }
  29. .pickerStyle(SegmentedPickerStyle())
  30. }
  31. }
  32. }
  33. .preferredColorScheme(Storage.shared.forceDarkMode.value ? .dark : nil)
  34. .navigationBarTitle("Dexcom Settings", displayMode: .inline)
  35. }
  36. }