@@ -28,6 +28,7 @@ public struct SettingsView: View {
28
28
@State private var cgmChooserIsPresented : Bool = false
29
29
@State private var serviceChooserIsPresented : Bool = false
30
30
@State private var therapySettingsIsPresented : Bool = false
31
+ @State private var profilesIsPresented : Bool = false
31
32
@State private var deletePumpDataAlertIsPresented = false
32
33
@State private var deleteCGMDataAlertIsPresented = false
33
34
@@ -198,6 +199,10 @@ extension SettingsView {
198
199
}
199
200
}
200
201
202
+ private var isAnySheetPresented : Bool {
203
+ therapySettingsIsPresented || profilesIsPresented
204
+ }
205
+
201
206
private var configurationSection : some View {
202
207
Section ( header: SectionHeader ( label: NSLocalizedString ( " Configuration " , comment: " The title of the Configuration section in settings " ) ) ) {
203
208
LargeButton ( action: { self . therapySettingsIsPresented = true } ,
@@ -221,6 +226,26 @@ extension SettingsView {
221
226
. environment ( \. insulinTintColor, self . insulinTintColor)
222
227
}
223
228
229
+ LargeButton ( action: { self . profilesIsPresented = true } ,
230
+ includeArrow: true ,
231
+ imageView: AnyView ( Image ( systemName: " arrow.triangle.2.circlepath " ) . font ( . system( size: 30 , weight: . bold) ) ) ,
232
+ label: NSLocalizedString ( " Profiles " , comment: " Title text for button to Profiles " ) ,
233
+ descriptiveText: NSLocalizedString ( " Switch between profiles for different scenarios " , comment: " Descriptive text for Profiles " ) )
234
+ . sheet ( isPresented: $profilesIsPresented) {
235
+ ProfileView ( viewModel: ProfileViewModel ( therapySettings: self . viewModel. therapySettings ( ) ,
236
+ sensitivityOverridesEnabled: FeatureFlags . sensitivityOverridesEnabled,
237
+ adultChildInsulinModelSelectionEnabled: FeatureFlags . adultChildInsulinModelSelectionEnabled,
238
+ delegate: self . viewModel. therapySettingsViewModelDelegate) )
239
+ . environmentObject ( displayGlucoseUnitObservable)
240
+ . environment ( \. dismissAction, self . dismiss)
241
+ . environment ( \. appName, self . appName)
242
+ . environment ( \. chartColorPalette, . primary)
243
+ . environment ( \. carbTintColor, self . carbTintColor)
244
+ . environment ( \. glucoseTintColor, self . glucoseTintColor)
245
+ . environment ( \. guidanceColors, self . guidanceColors)
246
+ . environment ( \. insulinTintColor, self . insulinTintColor)
247
+ }
248
+
224
249
ForEach ( pluginMenuItems. filter { $0. section == . configuration} ) { item in
225
250
item. view
226
251
}
0 commit comments