BasalRatesInformationView.swift 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. //
  2. // BasalRatesInformationView.swift
  3. // LoopKitUI
  4. //
  5. // Created by Anna Quinlan on 7/3/20.
  6. // Copyright © 2020 LoopKit Authors. All rights reserved.
  7. //
  8. import SwiftUI
  9. import LoopKit
  10. public struct BasalRatesInformationView: View {
  11. var onExit: (() -> Void)?
  12. var mode: SettingsPresentationMode
  13. @Environment(\.presentationMode) var presentationMode
  14. public init(onExit: (() -> Void)?, mode: SettingsPresentationMode = .acceptanceFlow) {
  15. self.onExit = onExit
  16. self.mode = mode
  17. }
  18. public var body: some View {
  19. InformationView(
  20. title: Text(TherapySetting.basalRate.title),
  21. informationalContent: {text},
  22. onExit: onExit ?? { self.presentationMode.wrappedValue.dismiss() },
  23. mode: mode
  24. )
  25. }
  26. private var text: some View {
  27. VStack(alignment: .leading, spacing: 25) {
  28. Text(LocalizedString("Your Basal Rate of insulin is the number of units per hour that you want to use to cover your background insulin needs.", comment: "Information about basal rates"))
  29. Text(LocalizedString("Loop supports 1 to 48 rates per day.", comment: "Information about max number of basal rates"))
  30. Text(LocalizedString("The schedule starts at midnight and cannot contain a rate of 0 U/hr.", comment: "Information about basal rate scheduling"))
  31. }
  32. .foregroundColor(.secondary)
  33. }
  34. }