BatteryDropAlarmEditor.swift 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. // LoopFollow
  2. // BatteryDropAlarmEditor.swift
  3. import SwiftUI
  4. struct BatteryDropAlarmEditor: View {
  5. @Binding var alarm: Alarm
  6. var body: some View {
  7. Group {
  8. InfoBanner(
  9. text: "This warns you if your phone’s battery drops quickly, based on the percentage and time you set.",
  10. alarmType: alarm.type
  11. )
  12. AlarmGeneralSection(alarm: $alarm)
  13. AlarmStepperSection(
  14. header: "Phone Battery Drop",
  15. footer: "This alerts you if the phone battery drops by this much or more.",
  16. title: "Drop Amount",
  17. range: 5 ... 100,
  18. step: 5,
  19. unitLabel: "%",
  20. value: $alarm.delta
  21. )
  22. AlarmStepperSection(
  23. header: "Over This Time",
  24. footer: "How far back to look for that drop.",
  25. title: "Time Window",
  26. range: 5 ... 30,
  27. step: 5,
  28. unitLabel: "min",
  29. value: $alarm.monitoringWindow
  30. )
  31. AlarmActiveSection(alarm: $alarm)
  32. AlarmAudioSection(alarm: $alarm)
  33. AlarmSnoozeSection(alarm: $alarm)
  34. }
  35. }
  36. }