DexcomSettingsView.swift 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. // LoopFollow
  2. // DexcomSettingsView.swift
  3. // Created by Jonas Björkert on 2025-01-18.
  4. import SwiftUI
  5. struct DexcomSettingsView: View {
  6. @ObservedObject var viewModel: DexcomSettingsViewModel
  7. @Environment(\.presentationMode) var presentationMode
  8. var body: some View {
  9. NavigationView {
  10. Form {
  11. Section(header: Text("Dexcom Settings")) {
  12. TextField("User Name", text: $viewModel.userName)
  13. .autocapitalization(.none)
  14. .disableAutocorrection(true)
  15. TextField("Password", text: $viewModel.password)
  16. .autocapitalization(.none)
  17. .disableAutocorrection(true)
  18. Picker("Server", selection: $viewModel.server) {
  19. Text("US").tag("US")
  20. Text("NON-US").tag("NON-US")
  21. }
  22. .pickerStyle(SegmentedPickerStyle())
  23. }
  24. }
  25. .navigationBarTitle("Dexcom Settings", displayMode: .inline)
  26. .toolbar {
  27. ToolbarItem(placement: .navigationBarTrailing) {
  28. Button("Done") {
  29. presentationMode.wrappedValue.dismiss()
  30. }
  31. }
  32. }
  33. }
  34. }
  35. }