|
|
@@ -10,6 +10,7 @@ extension AddCarbs {
|
|
|
@State var isPromtPresented = false
|
|
|
@State var saved = false
|
|
|
@State private var showAlert = false
|
|
|
+ @State var displayNote = false
|
|
|
|
|
|
@FetchRequest(
|
|
|
entity: Presets.entity(),
|
|
|
@@ -54,6 +55,10 @@ extension AddCarbs {
|
|
|
proteinAndFat()
|
|
|
}
|
|
|
HStack {
|
|
|
+ Text("Note").foregroundColor(.secondary)
|
|
|
+ TextField("", text: $state.note)
|
|
|
+ }
|
|
|
+ HStack {
|
|
|
Button {
|
|
|
state.useFPUconversion.toggle()
|
|
|
}
|
|
|
@@ -107,12 +112,12 @@ extension AddCarbs {
|
|
|
DatePicker("Date", selection: $state.date)
|
|
|
}
|
|
|
|
|
|
- Section(footer: Text(state.waitersNotepad().description)) {
|
|
|
+ Section {
|
|
|
Button { state.add() }
|
|
|
label: { Text("Save and continue").font(.title3) }
|
|
|
.disabled(state.carbs <= 0 && state.fat <= 0 && state.protein <= 0)
|
|
|
.frame(maxWidth: .infinity, alignment: .center)
|
|
|
- }
|
|
|
+ } footer: { Text(state.waitersNotepad().description) }
|
|
|
|
|
|
if !state.useFPUconversion {
|
|
|
Section {
|
|
|
@@ -126,7 +131,7 @@ extension AddCarbs {
|
|
|
|
|
|
var presetPopover: some View {
|
|
|
Form {
|
|
|
- Section(header: Text("Enter Meal Preset Name")) {
|
|
|
+ Section {
|
|
|
TextField("Name Of Dish", text: $dish)
|
|
|
Button {
|
|
|
saved = true
|
|
|
@@ -148,7 +153,7 @@ extension AddCarbs {
|
|
|
saved = false
|
|
|
isPromtPresented = false }
|
|
|
label: { Text("Cancel") }
|
|
|
- }
|
|
|
+ } header: { Text("Enter Meal Preset Name") }
|
|
|
}
|
|
|
}
|
|
|
|