tek-wallet 0.0.198 → 0.0.199

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.
@@ -114,6 +114,6 @@ var LockToken = function (props) {
114
114
  (0, react_1.useEffect)(function () {
115
115
  validateAmount(props.lockData);
116
116
  }, [validateAmount]);
117
- return ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: (0, jsx_runtime_1.jsx)(ConfirmLayout_1.default, { ref: confirmByPasscodeDrawerRef, action: type_1.ActionConfirm.LOCK, trigger: props.trigger, children: (0, jsx_runtime_1.jsxs)(material_1.Box, { sx: __assign(__assign({}, theme.mixins.column), { gap: theme.mixins.gaps.g16 }), children: [(0, jsx_runtime_1.jsx)(material_1.Box, { sx: __assign({}, theme.mixins.paper), children: (0, jsx_runtime_1.jsxs)(material_1.Box, { sx: __assign({}, theme.mixins.column), children: [(0, jsx_runtime_1.jsx)(LineValue_1.default, { field: "Amount", value: (0, jsx_runtime_1.jsx)(Formatter_1.default, { value: props.lockData.amount, unit: token === null || token === void 0 ? void 0 : token.name }) }), !error && ((0, jsx_runtime_1.jsxs)(Text_1.default, { sx: __assign(__assign({}, theme.mixins.validationError), { mt: theme.mixins.gaps.g6 }), children: [error, " ", !!errorAmount && ((0, jsx_runtime_1.jsx)(Formatter_1.default, { value: errorAmount, unit: token === null || token === void 0 ? void 0 : token.name }))] }))] }) }), (0, jsx_runtime_1.jsx)(ConfirmByPasscode_1.default, { action: type_1.ActionConfirm.LOCK, onConfirmSuccess: handleLockToken, children: (0, jsx_runtime_1.jsx)(Button_1.default.Primary, { status: !!error ? Button_1.BUTTON_STATUS.DISABLED : buttonStatus, sx: { width: "100%" }, children: "Confirm" }) })] }) }) }));
117
+ return ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: (0, jsx_runtime_1.jsx)(ConfirmLayout_1.default, { ref: confirmByPasscodeDrawerRef, action: type_1.ActionConfirm.LOCK, trigger: props.trigger, children: (0, jsx_runtime_1.jsxs)(material_1.Box, { sx: __assign(__assign({}, theme.mixins.column), { gap: theme.mixins.gaps.g16 }), children: [(0, jsx_runtime_1.jsx)(material_1.Box, { sx: __assign({}, theme.mixins.paper), children: (0, jsx_runtime_1.jsxs)(material_1.Box, { sx: __assign({}, theme.mixins.column), children: [(0, jsx_runtime_1.jsx)(LineValue_1.default, { field: "Amount", value: (0, jsx_runtime_1.jsx)(Formatter_1.default, { value: props.lockData.amount, unit: token === null || token === void 0 ? void 0 : token.name }) }), !!error && ((0, jsx_runtime_1.jsxs)(Text_1.default, { sx: __assign(__assign({}, theme.mixins.validationError), { mt: theme.mixins.gaps.g6 }), children: [error, " ", !!errorAmount && ((0, jsx_runtime_1.jsx)(Formatter_1.default, { value: errorAmount, unit: token === null || token === void 0 ? void 0 : token.name }))] }))] }) }), (0, jsx_runtime_1.jsx)(ConfirmByPasscode_1.default, { action: type_1.ActionConfirm.LOCK, onConfirmSuccess: handleLockToken, children: (0, jsx_runtime_1.jsx)(Button_1.default.Primary, { status: !!error ? Button_1.BUTTON_STATUS.DISABLED : buttonStatus, sx: { width: "100%" }, children: "Confirm" }) })] }) }) }));
118
118
  };
119
119
  exports.default = LockToken;
@@ -2,5 +2,5 @@ import { GeneralProps } from "../../../types/ui";
2
2
  export interface RequireConnectProps extends GeneralProps {
3
3
  children: React.ReactNode;
4
4
  }
5
- declare function RequireConnect({ children, ...rest }: RequireConnectProps): import("react/jsx-runtime").JSX.Element;
5
+ declare function RequireConnect({ children }: RequireConnectProps): import("react/jsx-runtime").JSX.Element;
6
6
  export default RequireConnect;
@@ -1,16 +1,5 @@
1
1
  "use strict";
2
2
  "use client";
3
- var __assign = (this && this.__assign) || function () {
4
- __assign = Object.assign || function(t) {
5
- for (var s, i = 1, n = arguments.length; i < n; i++) {
6
- s = arguments[i];
7
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
8
- t[p] = s[p];
9
- }
10
- return t;
11
- };
12
- return __assign.apply(this, arguments);
13
- };
14
3
  var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
15
4
  if (k2 === undefined) k2 = k;
16
5
  var desc = Object.getOwnPropertyDescriptor(m, k);
@@ -44,17 +33,6 @@ var __importStar = (this && this.__importStar) || (function () {
44
33
  return result;
45
34
  };
46
35
  })();
47
- var __rest = (this && this.__rest) || function (s, e) {
48
- var t = {};
49
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
50
- t[p] = s[p];
51
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
52
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
53
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
54
- t[p[i]] = s[p[i]];
55
- }
56
- return t;
57
- };
58
36
  var __importDefault = (this && this.__importDefault) || function (mod) {
59
37
  return (mod && mod.__esModule) ? mod : { "default": mod };
60
38
  };
@@ -66,15 +44,20 @@ var useWalletData_1 = __importDefault(require("../../../hooks/useWalletData"));
66
44
  var react_1 = require("react");
67
45
  var material_1 = require("@mui/material");
68
46
  function RequireConnect(_a) {
69
- var children = _a.children, rest = __rest(_a, ["children"]);
47
+ var children = _a.children;
70
48
  var authViewRef = (0, react_1.useRef)(null);
71
49
  var isAuthenticated = (0, useWalletData_1.default)().isAuthenticated;
72
50
  var backAuthView = function () {
73
51
  var _a;
74
52
  (_a = authViewRef.current) === null || _a === void 0 ? void 0 : _a.close();
75
53
  };
54
+ var handleOpenAuthView = function (e) {
55
+ var _a;
56
+ e.stopPropagation();
57
+ (_a = authViewRef.current) === null || _a === void 0 ? void 0 : _a.open();
58
+ };
76
59
  if (!isAuthenticated) {
77
- return ((0, jsx_runtime_1.jsx)(DrawerComponent_1.default, { ref: authViewRef, direction: DrawerComponent_1.DRAWER_DIRECTION.RIGHT, trigger: (0, jsx_runtime_1.jsxs)(material_1.Box, __assign({}, rest, { sx: { position: "relative" }, children: [(0, jsx_runtime_1.jsx)(material_1.Box, { sx: { pointerEvents: "none" }, children: children }), (0, jsx_runtime_1.jsx)(material_1.Box, { sx: { position: "absolute", inset: 0, zIndex: 10 } })] })), children: (0, jsx_runtime_1.jsx)(AuthView_1.default, { onBack: backAuthView }) }));
60
+ return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsxs)(material_1.Box, { sx: { position: "relative" }, children: [children, (0, jsx_runtime_1.jsx)(material_1.Box, { sx: { position: "absolute", inset: 0, zIndex: 10 }, onClick: handleOpenAuthView })] }), (0, jsx_runtime_1.jsx)(DrawerComponent_1.default, { ref: authViewRef, direction: DrawerComponent_1.DRAWER_DIRECTION.RIGHT, children: (0, jsx_runtime_1.jsx)(AuthView_1.default, { onBack: backAuthView }) })] }));
78
61
  }
79
62
  return (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: children });
80
63
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tek-wallet",
3
- "version": "0.0.198",
3
+ "version": "0.0.199",
4
4
  "description": "A custom React provider with TypeScript support",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",