tek-wallet 0.0.419 → 0.0.421

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.
@@ -70,8 +70,8 @@ exports.initialRealtime = {
70
70
  isConnected: false,
71
71
  pushNotification: function () { },
72
72
  };
73
- function SlideTransition(props) {
74
- return (0, jsx_runtime_1.jsx)(Slide_1.default, __assign({}, props, { direction: "up" }));
73
+ function GrowTransition(props) {
74
+ return (0, jsx_runtime_1.jsx)(Slide_1.default, __assign({}, props, { direction: "down" }));
75
75
  }
76
76
  exports.RealtimeContext = react_1.default.createContext(exports.initialRealtime);
77
77
  function RealtimeProvider(_a) {
@@ -101,20 +101,22 @@ function RealtimeProvider(_a) {
101
101
  }
102
102
  }, [masterWallet]);
103
103
  var closeNotification = function (id) {
104
- setNotifications(function (prev) { return prev.filter(function (n) { return n.id !== id; }); });
104
+ setNotifications(function (prev) {
105
+ return prev.map(function (n) { return (n.id === id ? __assign(__assign({}, n), { open: false }) : n); });
106
+ });
105
107
  };
106
108
  return ((0, jsx_runtime_1.jsxs)(exports.RealtimeContext.Provider, { value: {
107
109
  isConnected: isConnected,
108
110
  transaction: transaction,
109
111
  pushNotification: pushNotification,
110
112
  }, children: [children, (0, jsx_runtime_1.jsx)(notistack_1.SnackbarProvider, { maxSnack: 2, children: notifications.map(function (notification) {
111
- var _a, _b, _c, _d, _e;
112
- return ((0, jsx_runtime_1.jsx)(material_1.Snackbar, { open: true, anchorOrigin: {
113
- vertical: (_b = (_a = notification === null || notification === void 0 ? void 0 : notification.anchorOrigin) === null || _a === void 0 ? void 0 : _a.vertical) !== null && _b !== void 0 ? _b : "top",
114
- horizontal: (_d = (_c = notification === null || notification === void 0 ? void 0 : notification.anchorOrigin) === null || _c === void 0 ? void 0 : _c.horizontal) !== null && _d !== void 0 ? _d : "right",
113
+ var _a, _b, _c, _d, _e, _f;
114
+ return ((0, jsx_runtime_1.jsx)(material_1.Snackbar, { open: (_a = notification.open) !== null && _a !== void 0 ? _a : true, anchorOrigin: {
115
+ vertical: (_c = (_b = notification === null || notification === void 0 ? void 0 : notification.anchorOrigin) === null || _b === void 0 ? void 0 : _b.vertical) !== null && _c !== void 0 ? _c : "top",
116
+ horizontal: (_e = (_d = notification === null || notification === void 0 ? void 0 : notification.anchorOrigin) === null || _d === void 0 ? void 0 : _d.horizontal) !== null && _e !== void 0 ? _e : "right",
115
117
  }, onClose: function () {
116
118
  closeNotification(notification.id);
117
- }, slots: { transition: SlideTransition }, message: notification.message, autoHideDuration: (_e = notification.duration) !== null && _e !== void 0 ? _e : 2000 }, notification.id));
119
+ }, slots: { transition: GrowTransition }, message: notification.message, autoHideDuration: (_f = notification.duration) !== null && _f !== void 0 ? _f : 2000 }, notification.id));
118
120
  }) })] }));
119
121
  }
120
122
  exports.default = RealtimeProvider;
@@ -12,4 +12,5 @@ export interface NotificationType {
12
12
  vertical: "top" | "bottom";
13
13
  horizontal: "left" | "center" | "right";
14
14
  };
15
+ open?: boolean;
15
16
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tek-wallet",
3
- "version": "0.0.419",
3
+ "version": "0.0.421",
4
4
  "description": "A custom React provider with TypeScript support",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",