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.
- package/dist/components/Toast/ToastProvider.d.ts +1 -1
- package/dist/index.esm.js +10 -4
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +10 -4
- package/dist/index.js.map +1 -1
- package/dist/utils/toast-manager.d.ts +2 -2
- package/package.json +1 -1
- package/src/components/Toast/ToastProvider.tsx +1 -1
- package/src/components/Toast/index.tsx +14 -6
- package/src/utils/toast-manager.tsx +2 -2
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
|
|
6287
|
+
case SPACER.NORMAL:
|
|
6282
6288
|
return 0;
|
|
6283
|
-
case
|
|
6289
|
+
case SPACER.MEDIUM:
|
|
6284
6290
|
return 72;
|
|
6285
|
-
case
|
|
6291
|
+
case SPACER.LARGE:
|
|
6286
6292
|
return 104;
|
|
6287
6293
|
default:
|
|
6288
6294
|
return 0;
|