diff --git a/TidepoolService.xcodeproj/project.pbxproj b/TidepoolService.xcodeproj/project.pbxproj index 2b9bca8..3f0d3cf 100644 --- a/TidepoolService.xcodeproj/project.pbxproj +++ b/TidepoolService.xcodeproj/project.pbxproj @@ -62,7 +62,7 @@ A9DAAD6A22E7E81E00E76C9F /* LoopKitUI.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A9DAAD6922E7E81E00E76C9F /* LoopKitUI.framework */; }; A9DAAD6D22E7EA8F00E76C9F /* IdentifiableClass.swift in Sources */ = {isa = PBXBuildFile; fileRef = A9DAAD6C22E7EA8F00E76C9F /* IdentifiableClass.swift */; }; A9DAAD6F22E7EA9700E76C9F /* NibLoadable.swift in Sources */ = {isa = PBXBuildFile; fileRef = A9DAAD6E22E7EA9700E76C9F /* NibLoadable.swift */; }; - E93BA05E24A14CBA00C5D7E6 /* PrescriptionCodeEntryViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = E93BA05D24A14CBA00C5D7E6 /* PrescriptionCodeEntryViewModel.swift */; }; + E93BA05E24A14CBA00C5D7E6 /* PrescriptionReviewViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = E93BA05D24A14CBA00C5D7E6 /* PrescriptionReviewViewModel.swift */; }; E93BA06024A15FA800C5D7E6 /* PrescriptionDeviceView.swift in Sources */ = {isa = PBXBuildFile; fileRef = E93BA05F24A15FA800C5D7E6 /* PrescriptionDeviceView.swift */; }; E93BA06224A29C9C00C5D7E6 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = E93BA06124A29C9C00C5D7E6 /* Assets.xcassets */; }; E9692172249BC73600D9BE3B /* MockPrescriptionManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = E9692171249BC73600D9BE3B /* MockPrescriptionManager.swift */; }; @@ -71,6 +71,7 @@ E96AEB98249C2FF1003797B4 /* PrescriptionCodeEntryView.swift in Sources */ = {isa = PBXBuildFile; fileRef = E96AEB97249C2FF1003797B4 /* PrescriptionCodeEntryView.swift */; }; E991F1B724A548580059281B /* AdaptiveKeyboardPadding.swift in Sources */ = {isa = PBXBuildFile; fileRef = E991F1B624A548580059281B /* AdaptiveKeyboardPadding.swift */; }; E991F1BB24A654CC0059281B /* TimeInterval.swift in Sources */ = {isa = PBXBuildFile; fileRef = E991F1BA24A654CC0059281B /* TimeInterval.swift */; }; + E991F1C524AAB25C0059281B /* CorrectionRangeReviewView.swift in Sources */ = {isa = PBXBuildFile; fileRef = E991F1C424AAB25C0059281B /* CorrectionRangeReviewView.swift */; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ @@ -177,7 +178,7 @@ A9DAAD6922E7E81E00E76C9F /* LoopKitUI.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; path = LoopKitUI.framework; sourceTree = BUILT_PRODUCTS_DIR; }; A9DAAD6C22E7EA8F00E76C9F /* IdentifiableClass.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = IdentifiableClass.swift; sourceTree = ""; }; A9DAAD6E22E7EA9700E76C9F /* NibLoadable.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NibLoadable.swift; sourceTree = ""; }; - E93BA05D24A14CBA00C5D7E6 /* PrescriptionCodeEntryViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PrescriptionCodeEntryViewModel.swift; sourceTree = ""; }; + E93BA05D24A14CBA00C5D7E6 /* PrescriptionReviewViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PrescriptionReviewViewModel.swift; sourceTree = ""; }; E93BA05F24A15FA800C5D7E6 /* PrescriptionDeviceView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PrescriptionDeviceView.swift; sourceTree = ""; }; E93BA06124A29C9C00C5D7E6 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; E9692171249BC73600D9BE3B /* MockPrescriptionManager.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MockPrescriptionManager.swift; sourceTree = ""; }; @@ -186,6 +187,7 @@ E96AEB97249C2FF1003797B4 /* PrescriptionCodeEntryView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PrescriptionCodeEntryView.swift; sourceTree = ""; }; E991F1B624A548580059281B /* AdaptiveKeyboardPadding.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AdaptiveKeyboardPadding.swift; sourceTree = ""; }; E991F1BA24A654CC0059281B /* TimeInterval.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TimeInterval.swift; sourceTree = ""; }; + E991F1C424AAB25C0059281B /* CorrectionRangeReviewView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CorrectionRangeReviewView.swift; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -386,7 +388,7 @@ E93BA05C24A126E000C5D7E6 /* View Models */ = { isa = PBXGroup; children = ( - E93BA05D24A14CBA00C5D7E6 /* PrescriptionCodeEntryViewModel.swift */, + E93BA05D24A14CBA00C5D7E6 /* PrescriptionReviewViewModel.swift */, ); path = "View Models"; sourceTree = ""; @@ -414,6 +416,7 @@ E96AEB97249C2FF1003797B4 /* PrescriptionCodeEntryView.swift */, E93BA05F24A15FA800C5D7E6 /* PrescriptionDeviceView.swift */, E991F1B624A548580059281B /* AdaptiveKeyboardPadding.swift */, + E991F1C424AAB25C0059281B /* CorrectionRangeReviewView.swift */, ); path = Views; sourceTree = ""; @@ -787,7 +790,8 @@ A9DAAD3422E7CA1A00E76C9F /* LocalizedString.swift in Sources */, A9DAAD3922E7DEE000E76C9F /* TidepoolService+UI.swift in Sources */, A9DAAD6F22E7EA9700E76C9F /* NibLoadable.swift in Sources */, - E93BA05E24A14CBA00C5D7E6 /* PrescriptionCodeEntryViewModel.swift in Sources */, + E991F1C524AAB25C0059281B /* CorrectionRangeReviewView.swift in Sources */, + E93BA05E24A14CBA00C5D7E6 /* PrescriptionReviewViewModel.swift in Sources */, A92E770122E9181500591027 /* TidepoolServiceSetupViewController.swift in Sources */, A9DAAD3B22E7DEF100E76C9F /* TidepoolServiceSettingsViewController.swift in Sources */, ); diff --git a/TidepoolServiceKit/Mocks/MockPrescription.swift b/TidepoolServiceKit/Mocks/MockPrescription.swift index f8f7b70..05d2492 100644 --- a/TidepoolServiceKit/Mocks/MockPrescription.swift +++ b/TidepoolServiceKit/Mocks/MockPrescription.swift @@ -29,7 +29,7 @@ public enum BGUnit: String, Codable { case mgdl case mmol - var hkUnit: HKUnit { + public var hkUnit: HKUnit { switch self { case .mgdl: return .milligramsPerDeciliter diff --git a/TidepoolServiceKit/TidepoolService.swift b/TidepoolServiceKit/TidepoolService.swift index 8d607fd..5ca0533 100644 --- a/TidepoolServiceKit/TidepoolService.swift +++ b/TidepoolServiceKit/TidepoolService.swift @@ -92,6 +92,10 @@ public final class TidepoolService: Service { public func completeUpdate() { serviceDelegate?.serviceDidUpdateState(self) } + + public func saveSettings(settings: TherapySettings) { + serviceDelegate?.serviceHasNewTherapySettings(settings) + } public func completeDelete() { guard let session = session else { diff --git a/TidepoolServiceKitUI/Assets.xcassets/blue gray.colorset/Contents.json b/TidepoolServiceKitUI/Assets.xcassets/blue gray.colorset/Contents.json deleted file mode 100644 index 6ae1fa9..0000000 --- a/TidepoolServiceKitUI/Assets.xcassets/blue gray.colorset/Contents.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "colors" : [ - { - "color" : { - "color-space" : "srgb", - "components" : { - "alpha" : "1.000", - "blue" : "0x8D", - "green" : "0x78", - "red" : "0x6A" - } - }, - "idiom" : "universal" - } - ], - "info" : { - "author" : "xcode", - "version" : 1 - } -} diff --git a/TidepoolServiceKitUI/Extensions/UIColor.swift b/TidepoolServiceKitUI/Extensions/UIColor.swift index 3092541..d9df1db 100644 --- a/TidepoolServiceKitUI/Extensions/UIColor.swift +++ b/TidepoolServiceKitUI/Extensions/UIColor.swift @@ -18,5 +18,4 @@ extension UIColor { private static func HIGRedColor() -> UIColor { return UIColor(red: 1, green: 59 / 255, blue: 48 / 255, alpha: 1) } - } diff --git a/TidepoolServiceKitUI/TidepoolServiceSettingsViewController.swift b/TidepoolServiceKitUI/TidepoolServiceSettingsViewController.swift index 4a89fe2..78f8ade 100644 --- a/TidepoolServiceKitUI/TidepoolServiceSettingsViewController.swift +++ b/TidepoolServiceKitUI/TidepoolServiceSettingsViewController.swift @@ -8,8 +8,8 @@ import LoopKitUI import TidepoolServiceKit - -final class TidepoolServiceSettingsViewController: UITableViewController { + /* Added to support prescription flow */ +final class TidepoolServiceSettingsViewController: UITableViewController, CompletionDelegate { private let service: TidepoolService @@ -27,7 +27,8 @@ final class TidepoolServiceSettingsViewController: UITableViewController { super.viewDidLoad() tableView.register(TextButtonTableViewCell.self, forCellReuseIdentifier: TextButtonTableViewCell.className) - + + navigationItem.leftBarButtonItem = UIBarButtonItem(barButtonSystemItem: .action, target: self, action: #selector(startFlow)) navigationItem.rightBarButtonItem = UIBarButtonItem(barButtonSystemItem: .done, target: self, action: #selector(done)) } @@ -47,6 +48,22 @@ final class TidepoolServiceSettingsViewController: UITableViewController { present(alert, animated: true, completion: completion) } + + @objc private func startFlow() { + let setupViewController = PrescriptionReviewUICoordinator() + setupViewController.completionDelegate = self + setupViewController.onReviewFinished = { [weak service] (settings) in + service?.saveSettings(settings: settings) + } + self.present(setupViewController, animated: true, completion: nil) + } + + /* Added to support prescription flow */ + func completionNotifyingDidComplete(_ object: CompletionNotifying) { + if let vc = object as? UIViewController, presentedViewController === vc { + dismiss(animated: true, completion: nil) + } + } private func notifyComplete() { if let serviceViewController = navigationController as? ServiceViewController { diff --git a/TidepoolServiceKitUI/TidepoolServiceSetupViewController.swift b/TidepoolServiceKitUI/TidepoolServiceSetupViewController.swift index 340d153..e46a259 100644 --- a/TidepoolServiceKitUI/TidepoolServiceSetupViewController.swift +++ b/TidepoolServiceKitUI/TidepoolServiceSetupViewController.swift @@ -32,7 +32,6 @@ final class TidepoolServiceSetupViewController: UIViewController, TLoginSignupDe title = service.localizedTitle navigationItem.leftBarButtonItem = UIBarButtonItem(barButtonSystemItem: .cancel, target: self, action: #selector(cancel)) - navigationItem.rightBarButtonItem = UIBarButtonItem(barButtonSystemItem: .action, target: self, action: #selector(startFlow)) var loginSignupViewController = service.tapi.loginSignupViewController() loginSignupViewController.delegate = self @@ -47,13 +46,6 @@ final class TidepoolServiceSetupViewController: UIViewController, TLoginSignupDe @objc private func cancel() { notifyComplete() } - - - @objc private func startFlow() { - let setupViewController = PrescriptionReviewUICoordinator() - setupViewController.completionDelegate = self - self.present(setupViewController, animated: true, completion: nil) - } func loginSignup(_ loginSignup: TLoginSignup, didCreateSession session: TSession, completion: @escaping (Error?) -> Void) { service.completeCreate(withSession: session) { error in diff --git a/TidepoolServiceKitUI/View Controllers/PrescriptionReviewUICoordinator.swift b/TidepoolServiceKitUI/View Controllers/PrescriptionReviewUICoordinator.swift index 967f48a..a9cc581 100644 --- a/TidepoolServiceKitUI/View Controllers/PrescriptionReviewUICoordinator.swift +++ b/TidepoolServiceKitUI/View Controllers/PrescriptionReviewUICoordinator.swift @@ -9,16 +9,23 @@ import Foundation import SwiftUI import LoopKitUI +import LoopKit enum PrescriptionReviewScreen { case enterCode case reviewDevices + case correctionRangeInfo + case correctionRangeEditor func next() -> PrescriptionReviewScreen? { switch self { case .enterCode: return .reviewDevices case .reviewDevices: + return .correctionRangeInfo + case .correctionRangeInfo: + return .correctionRangeEditor + case .correctionRangeEditor: return nil } } @@ -27,14 +34,14 @@ enum PrescriptionReviewScreen { class PrescriptionReviewUICoordinator: UINavigationController, CompletionNotifying, UINavigationControllerDelegate { var screenStack = [PrescriptionReviewScreen]() weak var completionDelegate: CompletionDelegate? - - let viewModel = PrescriptionCodeEntryViewModel() + var onReviewFinished: ((TherapySettings) -> Void)? + + let viewModel = PrescriptionReviewViewModel(settings: TherapySettings()) var currentScreen: PrescriptionReviewScreen { return screenStack.last! } - - // TODO: create delegate so we can add settings to LoopDataManager + init() { super.init(navigationBarClass: UINavigationBar.self, toolbarClass: UIToolbar.self) } @@ -59,21 +66,47 @@ class PrescriptionReviewUICoordinator: UINavigationController, CompletionNotifyi self?.stepFinished() } let view = PrescriptionCodeEntryView(viewModel: viewModel) - return DismissibleHostingController(rootView: view) + let hostedView = DismissibleHostingController(rootView: view) + hostedView.title = LocalizedString("Your Settings", comment: "Navigation view title") + return hostedView case .reviewDevices: viewModel.didFinishStep = { [weak self] in self?.stepFinished() } guard let prescription = viewModel.prescription else { // Go back to code entry step if we don't have prescription - let view = PrescriptionCodeEntryView(viewModel: viewModel) - return DismissibleHostingController(rootView: view) + return restartFlow() } let view = PrescriptionDeviceView(viewModel: viewModel, prescription: prescription) - return DismissibleHostingController(rootView: view) + let hostedView = DismissibleHostingController(rootView: view) + hostedView.title = LocalizedString("Review your settings", comment: "Navigation view title") + return hostedView + case .correctionRangeInfo: + let exiting: (() -> Void) = { [weak self] in + self?.stepFinished() + } + let view = CorrectionRangeInformationView(onExit: exiting) + let hostedView = DismissibleHostingController(rootView: view) + hostedView.title = LocalizedString("Correction Range", comment: "Title for correction range informational screen") + return hostedView + case .correctionRangeEditor: + guard let prescription = viewModel.prescription else { + // Go back to code entry step if we don't have prescription + return restartFlow() + } + let view = CorrectionRangeReviewView(model: viewModel, prescription: prescription) + let hostedView = DismissibleHostingController(rootView: view) + hostedView.navigationItem.largeTitleDisplayMode = .never // fix for jumping + return hostedView } } + private func restartFlow() -> UIViewController { + screenStack = [.enterCode] + let view = PrescriptionCodeEntryView(viewModel: viewModel) + return DismissibleHostingController(rootView: view) + } + public func navigationController(_ navigationController: UINavigationController, willShow viewController: UIViewController, animated: Bool) { @@ -94,6 +127,7 @@ class PrescriptionReviewUICoordinator: UINavigationController, CompletionNotifyi setViewControllers([viewController], animated: false) } + // TODO: have separate flow for cancelling private func setupCanceled() { completionDelegate?.completionNotifyingDidComplete(self) } @@ -102,6 +136,9 @@ class PrescriptionReviewUICoordinator: UINavigationController, CompletionNotifyi if let nextStep = currentScreen.next() { navigate(to: nextStep) } else { + if let settingDelegate = onReviewFinished { + settingDelegate(viewModel.settings) + } completionDelegate?.completionNotifyingDidComplete(self) } } diff --git a/TidepoolServiceKitUI/View Models/PrescriptionCodeEntryViewModel.swift b/TidepoolServiceKitUI/View Models/PrescriptionReviewViewModel.swift similarity index 80% rename from TidepoolServiceKitUI/View Models/PrescriptionCodeEntryViewModel.swift rename to TidepoolServiceKitUI/View Models/PrescriptionReviewViewModel.swift index f6dc406..976a999 100644 --- a/TidepoolServiceKitUI/View Models/PrescriptionCodeEntryViewModel.swift +++ b/TidepoolServiceKitUI/View Models/PrescriptionReviewViewModel.swift @@ -8,16 +8,21 @@ import Foundation import TidepoolServiceKit +import LoopKit -class PrescriptionCodeEntryViewModel: ObservableObject { +class PrescriptionReviewViewModel: ObservableObject { var didFinishStep: (() -> Void) var didCancel: (() -> Void)? var prescription: MockPrescription? let prescriptionCodeLength = 4 - init(finishedStepHandler: @escaping () -> Void = { }) { + var settings: TherapySettings + + init(finishedStepHandler: @escaping () -> Void = { }, + settings: TherapySettings) { self.didFinishStep = finishedStepHandler + self.settings = settings } func entryNavigation(success: Bool) { @@ -49,4 +54,8 @@ class PrescriptionCodeEntryViewModel: ObservableObject { } } } + + func saveCorrectionRange(range: GlucoseRangeSchedule) { + settings.glucoseTargetRangeSchedule = range + } } diff --git a/TidepoolServiceKitUI/Views/CorrectionRangeReviewView.swift b/TidepoolServiceKitUI/Views/CorrectionRangeReviewView.swift new file mode 100644 index 0000000..5fb7742 --- /dev/null +++ b/TidepoolServiceKitUI/Views/CorrectionRangeReviewView.swift @@ -0,0 +1,39 @@ +// +// CorrectionRangeReviewView.swift +// TidepoolServiceKitUI +// +// Created by Anna Quinlan on 6/29/20. +// Copyright © 2020 LoopKit Authors. All rights reserved. +// +import SwiftUI +import LoopKitUI +import LoopKit +import HealthKit +import TidepoolServiceKit + + +struct CorrectionRangeReviewView: View { + @ObservedObject var viewModel: PrescriptionReviewViewModel + let prescription: MockPrescription + + init( + model: PrescriptionReviewViewModel, + prescription: MockPrescription + ) { + self.viewModel = model + self.prescription = prescription + } + + var body: some View { + CorrectionRangeScheduleEditor( + schedule: prescription.glucoseTargetRangeSchedule, + unit: prescription.bloodGlucoseUnit.hkUnit, + minValue: prescription.suspendThreshold.quantity, + onSave: { newSchedule in + self.viewModel.saveCorrectionRange(range: newSchedule) + self.viewModel.didFinishStep() + }, + mode: .flow + ) + } +} diff --git a/TidepoolServiceKitUI/Views/PrescriptionCodeEntryView.swift b/TidepoolServiceKitUI/Views/PrescriptionCodeEntryView.swift index fe2f8ee..948819f 100644 --- a/TidepoolServiceKitUI/Views/PrescriptionCodeEntryView.swift +++ b/TidepoolServiceKitUI/Views/PrescriptionCodeEntryView.swift @@ -8,14 +8,13 @@ import SwiftUI import LoopKitUI +import LoopKit struct PrescriptionCodeEntryView: View, HorizontalSizeClassOverride { @State private var prescriptionCode: String = "" - @ObservedObject var viewModel: PrescriptionCodeEntryViewModel + @ObservedObject var viewModel: PrescriptionReviewViewModel - let blueGray = Color("blue gray", bundle: Bundle(for: PrescriptionReviewUICoordinator.self)) - var body: some View { List { VStack(alignment: .leading, spacing: 25) { @@ -47,11 +46,11 @@ struct PrescriptionCodeEntryView: View, HorizontalSizeClassOverride { } private var itemsNeededDescription: some View { - VStack (alignment: .leading, spacing: 10) { + VStack(alignment: .leading, spacing: 10) { Text(LocalizedString("What you'll need", comment: "Title for section describing items needed to review settings")) .font(.headline) Text(LocalizedString("For the next section, you'll want to have the following:", comment: "Subheader for items-needed section")) - .foregroundColor(blueGray) + .foregroundColor(.secondary) .fixedSize(horizontal: false, vertical: true) // prevent text from being cut off } @@ -59,26 +58,26 @@ struct PrescriptionCodeEntryView: View, HorizontalSizeClassOverride { private var itemsNeededList: some View { Section { - VStack (alignment: .leading, spacing: 10) { + VStack(alignment: .leading, spacing: 10) { itemsNeededDescription InstructionList(instructions: [ LocalizedString("Prescription activation code", comment: "Label text for the first needed prescription activation item"), LocalizedString("Configuration settings for glucose targets and insulin delivery from your healthcare provider", comment: "Label text for the second needed prescription activation item") ], - stepsColor: blueGray + stepsColor: .secondary ) - .foregroundColor(blueGray) + .foregroundColor(.secondary) } } } private var codeEntryRequest: some View { Section { - VStack (alignment: .leading, spacing: 10) { + VStack(alignment: .leading, spacing: 10) { Text(LocalizedString("Enter your prescription code", comment: "Title for section to enter your prescription code")) .font(.headline) Text(LocalizedString("If you have a prescription activation code, please enter it now.", comment: "Text requesting entry of activation code")) - .foregroundColor(blueGray) + .foregroundColor(.secondary) prescriptionCodeInputField } } @@ -126,7 +125,7 @@ struct PrescriptionCodeEntryView: View, HorizontalSizeClassOverride { struct PrescriptionCodeEntryView_Previews: PreviewProvider { static var previews: some View { - PrescriptionCodeEntryView(viewModel: PrescriptionCodeEntryViewModel()) + PrescriptionCodeEntryView(viewModel: PrescriptionReviewViewModel(settings: TherapySettings())) } } diff --git a/TidepoolServiceKitUI/Views/PrescriptionDeviceView.swift b/TidepoolServiceKitUI/Views/PrescriptionDeviceView.swift index 312f163..ce79fd1 100644 --- a/TidepoolServiceKitUI/Views/PrescriptionDeviceView.swift +++ b/TidepoolServiceKitUI/Views/PrescriptionDeviceView.swift @@ -11,11 +11,8 @@ import LoopKitUI import TidepoolServiceKit struct PrescriptionDeviceView: View, HorizontalSizeClassOverride { - @State private var prescriptionCode: String = "" - @ObservedObject var viewModel: PrescriptionCodeEntryViewModel + @ObservedObject var viewModel: PrescriptionReviewViewModel var prescription: MockPrescription - - let blueGray = Color("blue gray", bundle: Bundle(for: PrescriptionReviewUICoordinator.self)) static let imageWidth: CGFloat = 48 var body: some View { @@ -41,7 +38,7 @@ struct PrescriptionDeviceView: View, HorizontalSizeClassOverride { private var prescribedDeviceInfo: some View { Section { Text(LocalizedString("Since your provider included your recommended settings with your prescription, you'll have the chance to review and accept each of these settings now.", comment: "Text describing purpose of settings walk-through")) - .foregroundColor(blueGray) + .foregroundColor(.secondary) .fixedSize(horizontal: false, vertical: true) } } @@ -50,7 +47,7 @@ struct PrescriptionDeviceView: View, HorizontalSizeClassOverride { Section { VStack(alignment: .leading, spacing: 20) { Text(LocalizedString("Your prescription contains recommended settings for the following devices:", comment: "Title for devices prescribed section")) - .foregroundColor(blueGray) + .foregroundColor(.secondary) .fixedSize(horizontal: false, vertical: true) // prevent text from being cut off // TODO: get images and descriptions from pump manager pumpStack @@ -70,11 +67,11 @@ struct PrescriptionDeviceView: View, HorizontalSizeClassOverride { HStack { dashIcon .padding(.horizontal) - VStack (alignment: .leading) { + VStack(alignment: .leading) { Text(LocalizedString("Omnipod 5", comment: "Text describing insulin pump name")) Text(LocalizedString("Insulin Pump", comment: "Insulin pump label")) .font(.footnote) - .foregroundColor(blueGray) + .foregroundColor(.secondary) } Spacer() } @@ -100,11 +97,11 @@ struct PrescriptionDeviceView: View, HorizontalSizeClassOverride { HStack { dexcomIcon .padding(.horizontal) - VStack (alignment: .leading) { + VStack(alignment: .leading) { Text(LocalizedString("Dexcom G6", comment: "Text describing CGM name")) Text(LocalizedString("Continuous Glucose Monitor", comment: "CGM label")) .font(.footnote) - .foregroundColor(blueGray) + .foregroundColor(.secondary) } Spacer() } @@ -119,10 +116,10 @@ struct PrescriptionDeviceView: View, HorizontalSizeClassOverride { private var disclaimer: some View { Section { - VStack (alignment: .leading) { + VStack(alignment: .leading) { Text(LocalizedString("Note", comment: "Title for disclaimer section")) .font(.headline) - VStack (alignment: .leading, spacing: 10) { + VStack(alignment: .leading, spacing: 10) { Text(LocalizedString("Tidepool Loop does NOT automatically adjust or recommend changes to your settings", comment: "Text describing that Tidepool Loop doesn't automatically change settings")) .italic() .fixedSize(horizontal: false, vertical: true) // prevent text from being cut off @@ -131,7 +128,7 @@ struct PrescriptionDeviceView: View, HorizontalSizeClassOverride { .italic() } .fixedSize(horizontal: false, vertical: true) // prevent text from being cut off - .foregroundColor(blueGray) + .foregroundColor(.secondary) } } }