DexcomSettingsView.swift 1.4 KB

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