|
|
@@ -453,24 +453,33 @@ extension DataTable {
|
|
|
}
|
|
|
|
|
|
@ViewBuilder private func mealView(_ meal: CarbEntryStored) -> some View {
|
|
|
- HStack {
|
|
|
- if meal.isFPU {
|
|
|
- Image(systemName: "circle.fill").foregroundColor(Color.orange.opacity(0.5))
|
|
|
- Text("Fat / Protein")
|
|
|
- Text((numberFormatter.string(for: meal.carbs) ?? "0") + NSLocalizedString(" g", comment: "gram of carbs"))
|
|
|
- } else {
|
|
|
- Image(systemName: "circle.fill").foregroundColor(Color.loopYellow)
|
|
|
- Text("Carbs")
|
|
|
- Text(
|
|
|
- (numberFormatter.string(for: meal.carbs) ?? "0") +
|
|
|
- NSLocalizedString(" g", comment: "gram of carb equilvalents")
|
|
|
- )
|
|
|
- }
|
|
|
+ VStack {
|
|
|
+ HStack {
|
|
|
+ if meal.isFPU {
|
|
|
+ Image(systemName: "circle.fill").foregroundColor(Color.orange.opacity(0.5))
|
|
|
+ Text("Fat / Protein")
|
|
|
+ Text((numberFormatter.string(for: meal.carbs) ?? "0") + NSLocalizedString(" g", comment: "gram of carbs"))
|
|
|
+ } else {
|
|
|
+ Image(systemName: "circle.fill").foregroundColor(Color.loopYellow)
|
|
|
+ Text("Carbs")
|
|
|
+ Text(
|
|
|
+ (numberFormatter.string(for: meal.carbs) ?? "0") +
|
|
|
+ NSLocalizedString(" g", comment: "gram of carb equilvalents")
|
|
|
+ )
|
|
|
+ }
|
|
|
|
|
|
- Spacer()
|
|
|
+ Spacer()
|
|
|
|
|
|
- Text(dateFormatter.string(from: meal.date ?? Date()))
|
|
|
- .moveDisabled(true)
|
|
|
+ Text(dateFormatter.string(from: meal.date ?? Date()))
|
|
|
+ .moveDisabled(true)
|
|
|
+ }
|
|
|
+ if let note = meal.note {
|
|
|
+ HStack {
|
|
|
+ Image(systemName: "square.and.pencil")
|
|
|
+ Text(note)
|
|
|
+ Spacer()
|
|
|
+ }.padding(.top, 5).foregroundColor(.secondary)
|
|
|
+ }
|
|
|
}
|
|
|
.swipeActions {
|
|
|
Button(
|