tek-wallet 0.0.184 → 0.0.186

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.
@@ -32,15 +32,14 @@ var DRAWER_DIRECTION;
32
32
  DRAWER_DIRECTION["RIGHT"] = "right";
33
33
  })(DRAWER_DIRECTION || (exports.DRAWER_DIRECTION = DRAWER_DIRECTION = {}));
34
34
  var DrawerComponent = (0, react_1.forwardRef)(function (props, ref) {
35
- var _a;
36
35
  var onOpen = props.onOpen, onClose = props.onClose, onToggle = props.onToggle, sx = props.sx, trigger = props.trigger, direction = props.direction, children = props.children, rest = __rest(props, ["onOpen", "onClose", "onToggle", "sx", "trigger", "direction", "children"]);
37
- var _b = (0, react_1.useState)(false), isShowDrawerComponent = _b[0], setIsShowDrawerComponent = _b[1];
38
- var isOpen = (0, react_1.useRef)(undefined);
36
+ var _a = (0, react_1.useState)(false), isShowDrawerComponent = _a[0], setIsShowDrawerComponent = _a[1];
37
+ var _b = (0, react_1.useState)(undefined), isOpen = _b[0], setIsOpen = _b[1];
39
38
  var lockStatus = function () {
40
- isOpen.current = isShowDrawerComponent;
39
+ setIsOpen(isShowDrawerComponent);
41
40
  };
42
41
  var unlockStatus = function () {
43
- isOpen.current = undefined;
42
+ setIsOpen(undefined);
44
43
  };
45
44
  var handleOpen = function () {
46
45
  unlockStatus();
@@ -64,26 +63,21 @@ var DrawerComponent = (0, react_1.forwardRef)(function (props, ref) {
64
63
  unlockStatus: unlockStatus,
65
64
  }); });
66
65
  var onDrawerClose = function (e) {
67
- if (isOpen.current !== undefined) {
68
- setIsShowDrawerComponent(isOpen.current);
69
- }
70
66
  setIsShowDrawerComponent(false);
71
67
  onClose === null || onClose === void 0 ? void 0 : onClose(e);
72
68
  };
73
69
  var onDrawerOpen = function (e) {
74
- if (isOpen.current !== undefined) {
75
- setIsShowDrawerComponent(isOpen.current);
76
- }
77
70
  setIsShowDrawerComponent(true);
78
71
  onOpen === null || onOpen === void 0 ? void 0 : onOpen(e);
79
72
  };
80
- return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(material_1.Box, { sx: sx, onClick: toggle, children: trigger }), (0, jsx_runtime_1.jsx)(material_1.SwipeableDrawer, __assign({}, rest, { sx: {
73
+ var DrawerComponent = isOpen !== undefined ? material_1.Drawer : material_1.SwipeableDrawer;
74
+ return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(material_1.Box, { sx: sx, onClick: toggle, children: trigger }), (0, jsx_runtime_1.jsx)(DrawerComponent, __assign({}, rest, { sx: {
81
75
  "& .MuiDrawer-paper": {
82
76
  backgroundColor: "transparent",
83
77
  overflow: "hidden",
84
78
  boxShadow: "none",
85
79
  },
86
- }, anchor: direction || "bottom", open: (_a = isOpen.current) !== null && _a !== void 0 ? _a : isShowDrawerComponent, onOpen: onDrawerOpen, onClose: onDrawerClose, disableSwipeToOpen: isOpen.current !== undefined, disableDiscovery: isOpen.current !== undefined, children: children }))] }));
80
+ }, anchor: direction || "bottom", open: isOpen !== null && isOpen !== void 0 ? isOpen : isShowDrawerComponent, onOpen: onDrawerOpen, onClose: onDrawerClose, children: children }))] }));
87
81
  });
88
82
  DrawerComponent.displayName = "DrawerComponent";
89
83
  exports.default = DrawerComponent;
@@ -30,7 +30,7 @@ var LoadingLayout = (0, react_1.forwardRef)(function (props, ref) {
30
30
  setLoading(false);
31
31
  },
32
32
  }); });
33
- return ((0, jsx_runtime_1.jsxs)(material_1.Box, { sx: __assign({ position: "relative", width: "fit-content", height: "fit-content" }, sx), children: [children, loading && ((0, jsx_runtime_1.jsx)(material_1.Box, { sx: __assign(__assign({ position: "absolute", inset: 0 }, theme.mixins.whiteLoadingOverlay), { zIndex: 1000, pointerEvents: "none" }), children: (0, jsx_runtime_1.jsx)(Text_1.default, { sx: __assign({}, theme.mixins.center), children: loadingMessage }) }))] }));
33
+ return ((0, jsx_runtime_1.jsxs)(material_1.Box, { sx: __assign({ position: "relative", width: "fit-content", height: "fit-content" }, sx), children: [children, loading && ((0, jsx_runtime_1.jsx)(material_1.Box, { sx: __assign(__assign({ position: "absolute", inset: 0 }, theme.mixins.whiteLoadingOverlay), { zIndex: 1000 }), children: (0, jsx_runtime_1.jsx)(Text_1.default, { sx: __assign({}, theme.mixins.center), children: loadingMessage }) }))] }));
34
34
  });
35
35
  LoadingLayout.displayName = "LoadingLayout";
36
36
  exports.default = LoadingLayout;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tek-wallet",
3
- "version": "0.0.184",
3
+ "version": "0.0.186",
4
4
  "description": "A custom React provider with TypeScript support",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",