|
@@ -60,10 +60,8 @@ extension DataTable {
|
|
|
private var color: LinearGradient {
|
|
private var color: LinearGradient {
|
|
|
colorScheme == .dark ? LinearGradient(
|
|
colorScheme == .dark ? LinearGradient(
|
|
|
gradient: Gradient(colors: [
|
|
gradient: Gradient(colors: [
|
|
|
- Color("Background_1"),
|
|
|
|
|
- Color("Background_1"),
|
|
|
|
|
- Color("Background_2")
|
|
|
|
|
- // Color("Background_1")
|
|
|
|
|
|
|
+ Color.bgDarkBlue,
|
|
|
|
|
+ Color.bgDarkerDarkBlue
|
|
|
]),
|
|
]),
|
|
|
startPoint: .top,
|
|
startPoint: .top,
|
|
|
endPoint: .bottom
|
|
endPoint: .bottom
|
|
@@ -115,9 +113,15 @@ extension DataTable {
|
|
|
}
|
|
}
|
|
|
ToolbarItem(placement: .topBarTrailing) {
|
|
ToolbarItem(placement: .topBarTrailing) {
|
|
|
switch state.mode {
|
|
switch state.mode {
|
|
|
- case .treatments: addInsulinButton
|
|
|
|
|
|
|
+ case .treatments: addButton( {
|
|
|
|
|
+ showExternalInsulin = true
|
|
|
|
|
+ state.externalInsulinDate = Date()
|
|
|
|
|
+ })
|
|
|
case .meals: EmptyView()
|
|
case .meals: EmptyView()
|
|
|
- case .glucose: addGlucoseButton
|
|
|
|
|
|
|
+ case .glucose: addButton({
|
|
|
|
|
+ showManualGlucose = true
|
|
|
|
|
+ state.manualGlucose = 0
|
|
|
|
|
+ })
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
@@ -130,26 +134,15 @@ extension DataTable {
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- private var addGlucoseButton: some View {
|
|
|
|
|
|
|
+ @ViewBuilder func addButton(_ action: @escaping () -> Void) -> some View {
|
|
|
Button(
|
|
Button(
|
|
|
- action: { showManualGlucose = true
|
|
|
|
|
- state.manualGlucose = 0 },
|
|
|
|
|
- label: {
|
|
|
|
|
|
|
+ action: action,
|
|
|
|
|
+ label: {
|
|
|
Image(systemName: "plus.circle.fill")
|
|
Image(systemName: "plus.circle.fill")
|
|
|
Text("Add")
|
|
Text("Add")
|
|
|
}
|
|
}
|
|
|
)
|
|
)
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
- private var addInsulinButton: some View {
|
|
|
|
|
- Button(action: { showExternalInsulin = true
|
|
|
|
|
- state.externalInsulinDate = Date() }, label: {
|
|
|
|
|
- HStack {
|
|
|
|
|
- Image(systemName: "plus.circle.fill")
|
|
|
|
|
- Text("Add")
|
|
|
|
|
- }
|
|
|
|
|
- })
|
|
|
|
|
- }
|
|
|
|
|
|
|
|
|
|
private var treatmentsList: some View {
|
|
private var treatmentsList: some View {
|
|
|
List {
|
|
List {
|