Mike Plante 1 год назад
Родитель
Сommit
4f0b38a8af
1 измененных файлов с 9 добавлено и 18 удалено
  1. 9 18
      Trio/Sources/Modules/Treatments/View/PopupView.swift

+ 9 - 18
Trio/Sources/Modules/Treatments/View/PopupView.swift

@@ -255,7 +255,7 @@ struct PopupView: View {
                 Text("\(state.units.rawValue)/U")
                 Text("\(state.units.rawValue)/U")
                 Text("")
                 Text("")
                     .layoutPriority(-15)
                     .layoutPriority(-15)
-                Text(padForNegative(state.targetDifferenceInsulin) + String(localized: "U"))
+                Text("U")
             }
             }
             .unitStyle()
             .unitStyle()
         }
         }
@@ -300,7 +300,7 @@ struct PopupView: View {
                 Text("U")
                 Text("U")
                 Text("")
                 Text("")
                     .layoutPriority(-15)
                     .layoutPriority(-15)
-                Text(padForNegative(-1 * state.iob) + String(localized: "U"))
+                Text("U")
             }
             }
             .unitStyle()
             .unitStyle()
         }
         }
@@ -371,7 +371,7 @@ struct PopupView: View {
                     if !hasExceededMaxCOB {
                     if !hasExceededMaxCOB {
                         Text("")
                         Text("")
                             .layoutPriority(-15)
                             .layoutPriority(-15)
-                        Text(padForNegative(state.wholeCobInsulin) + String(localized: "U"))
+                        Text("U")
                     }
                     }
                 }
                 }
                 .unitStyle()
                 .unitStyle()
@@ -415,7 +415,7 @@ struct PopupView: View {
                         Text("g/U")
                         Text("g/U")
                         Text("")
                         Text("")
                             .layoutPriority(-15)
                             .layoutPriority(-15)
-                        Text(padForNegative(state.wholeCobInsulin) + String(localized: "U"))
+                        Text("U")
                     }
                     }
                     .unitStyle()
                     .unitStyle()
                 }
                 }
@@ -461,7 +461,7 @@ struct PopupView: View {
                 Text("\(state.units.rawValue)/U")
                 Text("\(state.units.rawValue)/U")
                 Text("")
                 Text("")
                     .layoutPriority(-15)
                     .layoutPriority(-15)
-                Text(padForNegative(state.fifteenMinInsulin) + String(localized: "U"))
+                Text("U")
             }
             }
             .unitStyle()
             .unitStyle()
         }
         }
@@ -626,7 +626,7 @@ struct PopupView: View {
                     Text("")
                     Text("")
                         .layoutPriority(-15)
                         .layoutPriority(-15)
                         .gridCellColumns(3)
                         .gridCellColumns(3)
-                    Text(padForNegative(state.factoredInsulin) + String(localized: "U"))
+                    Text("U")
                 }
                 }
                 .unitStyle()
                 .unitStyle()
 
 
@@ -668,7 +668,7 @@ struct PopupView: View {
                     Text("U")
                     Text("U")
                     Text("")
                     Text("")
                         .layoutPriority(-15)
                         .layoutPriority(-15)
-                    Text(padForNegative(state.factoredInsulin) + String(localized: "U"))
+                    Text("U")
                 }
                 }
                 .unitStyle()
                 .unitStyle()
 
 
@@ -721,7 +721,7 @@ struct PopupView: View {
                         Text("U")
                         Text("U")
                         Text("")
                         Text("")
                             .layoutPriority(-15)
                             .layoutPriority(-15)
-                        Text(padForNegative(state.factoredInsulin) + String(localized: "U"))
+                        Text("U")
                     }
                     }
                     .unitStyle()
                     .unitStyle()
                 } else {
                 } else {
@@ -757,7 +757,7 @@ struct PopupView: View {
                         Text("U")
                         Text("U")
                         Text("")
                         Text("")
                             .layoutPriority(-15)
                             .layoutPriority(-15)
-                        Text(padForNegative(state.factoredInsulin) + String(localized: "U"))
+                        Text("U")
                     }
                     }
                     .unitStyle()
                     .unitStyle()
                 }
                 }
@@ -957,13 +957,4 @@ struct PopupView: View {
     private func wrapNegative(_ value: Decimal, _ roundingMode: NSDecimalNumber.RoundingMode = .down) -> String {
     private func wrapNegative(_ value: Decimal, _ roundingMode: NSDecimalNumber.RoundingMode = .down) -> String {
         value < 0 ? "(" + insulinFormatter(value, roundingMode) + ")" : insulinFormatter(value, roundingMode)
         value < 0 ? "(" + insulinFormatter(value, roundingMode) + ")" : insulinFormatter(value, roundingMode)
     }
     }
-
-    /// Adds a leading space before unit symbols for negative values to ensure proper center alignment.
-    /// This compensates for the negative sign's width, maintaining consistent text alignment
-    /// when displaying both positive and negative values with their units.
-    /// - Parameter value: The decimal value to check for negativity
-    /// - Returns: A single space string if the value is negative, otherwise an empty string
-    private func padForNegative(_ value: Decimal) -> String {
-        value < 0 ? " " : ""
-    }
 }
 }