sapo-components-ui-rn 1.0.8 → 1.0.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -6,7 +6,7 @@ interface ToastRef {
6
6
  position?: "top" | "bottom";
7
7
  type?: "success" | "fail";
8
8
  onPress?: () => void;
9
- title?: string;
9
+ title: string;
10
10
  spacer?: "normal" | "medium" | "large" | number;
11
11
  }) => void;
12
12
  }
package/dist/index.esm.js CHANGED
@@ -6177,6 +6177,11 @@ var POSITION = {
6177
6177
  TOP: "top",
6178
6178
  BOTTOM: "bottom",
6179
6179
  };
6180
+ var SPACER = {
6181
+ NORMAL: "normal",
6182
+ MEDIUM: "medium",
6183
+ LARGE: "large",
6184
+ };
6180
6185
  var Toast = memoWithRef(function (_props, ref) {
6181
6186
  var _a = useState("Thông báo"), message = _a[0], setMessage = _a[1];
6182
6187
  var viewVisibleAnimatedRef = useRef(null);
@@ -6213,6 +6218,7 @@ var Toast = memoWithRef(function (_props, ref) {
6213
6218
  onPress: onPress,
6214
6219
  title: title,
6215
6220
  duration: duration,
6221
+ spacer: spacer,
6216
6222
  });
6217
6223
  }, true);
6218
6224
  };
@@ -6275,14 +6281,14 @@ var Toast = memoWithRef(function (_props, ref) {
6275
6281
  var handleToastBottomHeight = function () {
6276
6282
  var spacer = options.spacer;
6277
6283
  if (typeof spacer === "number") {
6278
- return spacer;
6284
+ return Math.max(0, spacer);
6279
6285
  }
6280
6286
  switch (spacer) {
6281
- case "normal":
6287
+ case SPACER.NORMAL:
6282
6288
  return 0;
6283
- case "medium":
6289
+ case SPACER.MEDIUM:
6284
6290
  return 72;
6285
- case "large":
6291
+ case SPACER.LARGE:
6286
6292
  return 104;
6287
6293
  default:
6288
6294
  return 0;