tek-wallet 0.0.631 → 0.0.633

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.
@@ -128,6 +128,6 @@ var SendExternalTokenWithdrawn = function (_a) {
128
128
  }
129
129
  });
130
130
  }); };
131
- return ((0, jsx_runtime_1.jsx)(RequireConnect_1.default, { children: (0, jsx_runtime_1.jsx)(ConfirmLayout_1.default, { action: transactionSlug, trigger: trigger, confirmAction: (0, jsx_runtime_1.jsx)(ConfirmByPasscode_1.default, { action: transactionSlug, onConfirmSuccess: handleSendExternalTokenWithdrawn, children: (0, jsx_runtime_1.jsx)(Button_1.default.Primary, { status: buttonStatus, children: "Confirm" }) }), children: children }) }));
131
+ return ((0, jsx_runtime_1.jsx)(RequireConnect_1.default, { children: (0, jsx_runtime_1.jsx)(ConfirmLayout_1.default, { trigger: trigger, action: transactionSlug, confirmAction: (0, jsx_runtime_1.jsx)(ConfirmByPasscode_1.default, { action: transactionSlug, onConfirmSuccess: handleSendExternalTokenWithdrawn, children: (0, jsx_runtime_1.jsx)(Button_1.default.Primary, { status: buttonStatus, children: "Confirm" }) }), children: children }) }));
132
132
  };
133
133
  exports.default = SendExternalTokenWithdrawn;
@@ -1,8 +1,10 @@
1
1
  import React from "react";
2
2
  import { RealtimeProviderDataType } from "./type";
3
+ import { Options } from "../TekWalletProvider";
3
4
  export declare const initialRealtime: RealtimeProviderDataType;
4
5
  export declare const RealtimeContext: React.Context<RealtimeProviderDataType>;
5
- export declare function RealtimeProvider({ children }: {
6
+ export declare function RealtimeProvider({ children, options }: {
6
7
  children: React.ReactNode;
8
+ options?: Options;
7
9
  }): import("react/jsx-runtime").JSX.Element;
8
10
  export default RealtimeProvider;
@@ -76,13 +76,15 @@ function GrowTransition(props) {
76
76
  }
77
77
  exports.RealtimeContext = react_1.default.createContext(exports.initialRealtime);
78
78
  function RealtimeProvider(_a) {
79
- var children = _a.children;
79
+ var children = _a.children, options = _a.options;
80
80
  var theme = (0, ThemeProvider_1.useTheme)();
81
81
  var masterWallet = (0, useWalletData_1.default)().masterWallet;
82
82
  var _b = (0, react_1.useState)(exports.initialRealtime.isConnected), isConnected = _b[0], setIsConnected = _b[1];
83
83
  var _c = (0, react_1.useState)(exports.initialRealtime.transaction), transaction = _c[0], setTransaction = _c[1];
84
84
  var _d = (0, react_1.useState)([]), notifications = _d[0], setNotifications = _d[1];
85
85
  var pushNotification = function (notification) {
86
+ if (!(options === null || options === void 0 ? void 0 : options.useDefaultToastMessage))
87
+ return;
86
88
  setNotifications(function (prev) { return __spreadArray(__spreadArray([], prev, true), [notification], false); });
87
89
  };
88
90
  (0, react_1.useEffect)(function () {
@@ -109,7 +111,7 @@ function RealtimeProvider(_a) {
109
111
  isConnected: isConnected,
110
112
  transaction: transaction,
111
113
  pushNotification: pushNotification,
112
- }, children: [children, (0, jsx_runtime_1.jsx)(notistack_1.SnackbarProvider, { maxSnack: 2, children: notifications.map(function (notification) {
114
+ }, children: [children, (options === null || options === void 0 ? void 0 : options.useDefaultToastMessage) && ((0, jsx_runtime_1.jsx)(notistack_1.SnackbarProvider, { maxSnack: 2, children: notifications.map(function (notification) {
113
115
  var _a, _b, _c, _d, _e, _f;
114
116
  return ((0, jsx_runtime_1.jsx)(material_1.Snackbar, { open: (_a = notification.open) !== null && _a !== void 0 ? _a : true, anchorOrigin: {
115
117
  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",
@@ -126,6 +128,6 @@ function RealtimeProvider(_a) {
126
128
  padding: "".concat(theme.mixins.customPadding.p6, " ").concat(theme.mixins.customPadding.p0),
127
129
  },
128
130
  }, children: notification.message }) }, notification.id));
129
- }) })] }));
131
+ }) }))] }));
130
132
  }
131
133
  exports.default = RealtimeProvider;
@@ -1,6 +1,7 @@
1
1
  import { ReactNode } from "react";
2
2
  export interface Options {
3
3
  hideDefaultActivities?: boolean;
4
+ useDefaultToastMessage?: boolean;
4
5
  }
5
6
  export interface TekWalletProviderProps {
6
7
  children: ReactNode;
@@ -30,6 +30,6 @@ function TekWalletProvider(_a) {
30
30
  var onDisconnect = function () {
31
31
  setResetTrigger(function (prev) { return prev + "1"; });
32
32
  };
33
- return ((0, jsx_runtime_1.jsx)(ContentHiddenProvider_1.default, { children: (0, jsx_runtime_1.jsx)(exports.TekWalletContext.Provider, { value: { isSSO: isSSO }, children: (0, jsx_runtime_1.jsx)(WalletProvider, { accessToken: accessToken !== null && accessToken !== void 0 ? accessToken : "", onDisconnect: onDisconnect, children: (0, jsx_runtime_1.jsx)(ThemeProvider_1.CustomThemeProvider, { children: (0, jsx_runtime_1.jsx)(RealtimeProvider_1.default, { children: (0, jsx_runtime_1.jsx)(ActivitiesProvider_1.default, { children: (0, jsx_runtime_1.jsx)(ReceiveProvider_1.default, { children: (0, jsx_runtime_1.jsx)(LockTokenProvider_1.default, { children: (0, jsx_runtime_1.jsx)(WithdrawProvider_1.default, { children: (0, jsx_runtime_1.jsx)(SwapProvider_1.default, { children: (0, jsx_runtime_1.jsx)(EventHandlerProvider_1.default, { options: options, children: children }) }) }) }) }) }) }) }) }, resetTrigger) }) }));
33
+ return ((0, jsx_runtime_1.jsx)(ContentHiddenProvider_1.default, { children: (0, jsx_runtime_1.jsx)(exports.TekWalletContext.Provider, { value: { isSSO: isSSO }, children: (0, jsx_runtime_1.jsx)(WalletProvider, { accessToken: accessToken !== null && accessToken !== void 0 ? accessToken : "", onDisconnect: onDisconnect, children: (0, jsx_runtime_1.jsx)(ThemeProvider_1.CustomThemeProvider, { children: (0, jsx_runtime_1.jsx)(RealtimeProvider_1.default, { options: options, children: (0, jsx_runtime_1.jsx)(ActivitiesProvider_1.default, { children: (0, jsx_runtime_1.jsx)(ReceiveProvider_1.default, { children: (0, jsx_runtime_1.jsx)(LockTokenProvider_1.default, { children: (0, jsx_runtime_1.jsx)(WithdrawProvider_1.default, { children: (0, jsx_runtime_1.jsx)(SwapProvider_1.default, { children: (0, jsx_runtime_1.jsx)(EventHandlerProvider_1.default, { options: options, children: children }) }) }) }) }) }) }) }) }, resetTrigger) }) }));
34
34
  }
35
35
  exports.default = TekWalletProvider;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tek-wallet",
3
- "version": "0.0.631",
3
+ "version": "0.0.633",
4
4
  "description": "A custom React provider with TypeScript support",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",