tek-wallet 0.0.582 → 0.0.583
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.
|
@@ -191,7 +191,7 @@ var LockToken = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
191
191
|
(0, react_1.useEffect)(function () {
|
|
192
192
|
validateAmount(props.lockData);
|
|
193
193
|
}, [validateAmount]);
|
|
194
|
-
return ((0, jsx_runtime_1.jsx)(RequireConnect_1.default, { children: (0, jsx_runtime_1.jsx)(ConfirmLayout_1.default, { ref: confirmLayoutDrawerRef, action: type_1.TransactionSlug.LockedBalances, trigger: props.children, children: (0, jsx_runtime_1.jsxs)(material_1.Box, { sx: __assign(__assign({}, theme.mixins.column), { gap: theme.mixins.gaps.g12 }), children: [(0, jsx_runtime_1.jsx)(material_1.Box, { sx: __assign({}, theme.mixins.paper), 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 }) }) }), (0, jsx_runtime_1.jsxs)(Text_1.default, { sx: __assign({}, theme.mixins.value), children: ["Your balance is", " ", (0, jsx_runtime_1.jsx)(Text_1.default, { sx: {
|
|
194
|
+
return ((0, jsx_runtime_1.jsx)(RequireConnect_1.default, { children: (0, jsx_runtime_1.jsx)(ConfirmLayout_1.default, { ref: confirmLayoutDrawerRef, action: type_1.TransactionSlug.LockedBalances, trigger: props.children, children: (0, jsx_runtime_1.jsxs)(material_1.Box, { sx: __assign(__assign({}, theme.mixins.column), { gap: theme.mixins.gaps.g12 }), children: [(0, jsx_runtime_1.jsx)(material_1.Box, { sx: __assign({}, theme.mixins.paper), 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: " ".concat(token === null || token === void 0 ? void 0 : token.name) }) }) }), (0, jsx_runtime_1.jsxs)(Text_1.default, { sx: __assign({}, theme.mixins.value), children: ["Your balance is", " ", (0, jsx_runtime_1.jsx)(Text_1.default, { sx: {
|
|
195
195
|
fontWeight: theme.typography.fontWeight600,
|
|
196
196
|
color: theme.palette.text.secondary,
|
|
197
197
|
}, children: (0, jsx_runtime_1.jsx)(Formatter_1.default, { value: token === null || token === void 0 ? void 0 : token.balance, unit: " ".concat(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: " ".concat(token === null || token === void 0 ? void 0 : token.name) })] })), (0, jsx_runtime_1.jsx)(ConfirmByPasscode_1.default, { action: type_1.TransactionSlug.LockedBalances, 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" }) })] }) }) }));
|
|
@@ -110,7 +110,7 @@ var UpdateLockTokenError;
|
|
|
110
110
|
var UpdateLockToken = (0, react_1.forwardRef)(function (props, ref) {
|
|
111
111
|
var _a;
|
|
112
112
|
var theme = (0, material_1.useTheme)();
|
|
113
|
-
var _b = (0, useLockTokenData_1.default)(), lockedTokens = _b.lockedTokens, lockTokens = _b.lockTokens;
|
|
113
|
+
var _b = (0, useLockTokenData_1.default)(), lockedTokens = _b.lockedTokens, lockTokens = _b.lockTokens, updateLockedToken = _b.updateLockedToken;
|
|
114
114
|
var isAuthenticated = (0, useWalletData_1.default)().isAuthenticated;
|
|
115
115
|
var confirmLayoutDrawerRef = (0, react_1.useRef)(null);
|
|
116
116
|
var _c = (0, react_1.useState)(undefined), token = _c[0], setToken = _c[1];
|
|
@@ -204,7 +204,12 @@ var UpdateLockToken = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
204
204
|
(0, react_1.useEffect)(function () {
|
|
205
205
|
validateAmount(props.lockData);
|
|
206
206
|
}, [validateAmount]);
|
|
207
|
-
|
|
207
|
+
(0, react_1.useEffect)(function () {
|
|
208
|
+
if (!!lockedTokens || !isAuthenticated)
|
|
209
|
+
return;
|
|
210
|
+
updateLockedToken();
|
|
211
|
+
}, [isAuthenticated, lockedTokens]);
|
|
212
|
+
return ((0, jsx_runtime_1.jsx)(RequireConnect_1.default, { children: (0, jsx_runtime_1.jsx)(ConfirmLayout_1.default, { ref: confirmLayoutDrawerRef, action: action, trigger: props.children, children: (0, jsx_runtime_1.jsxs)(material_1.Box, { sx: __assign(__assign({}, theme.mixins.column), { gap: theme.mixins.gaps.g12 }), children: [(0, jsx_runtime_1.jsx)(material_1.Box, { sx: __assign({}, theme.mixins.paper), children: (0, jsx_runtime_1.jsx)(LineValue_1.default, { field: "Amount", value: (0, jsx_runtime_1.jsx)(Formatter_1.default, { value: props.lockData.locked_amount, unit: " ".concat(token === null || token === void 0 ? void 0 : token.name) }) }) }), (0, jsx_runtime_1.jsxs)(Text_1.default, { sx: __assign({}, theme.mixins.value), children: ["Your balance is", " ", (0, jsx_runtime_1.jsx)(Text_1.default, { sx: {
|
|
208
213
|
fontWeight: theme.typography.fontWeight600,
|
|
209
214
|
color: theme.palette.text.secondary,
|
|
210
215
|
}, children: (0, jsx_runtime_1.jsx)(Formatter_1.default, { value: token === null || token === void 0 ? void 0 : token.balance, unit: " ".concat(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: " ".concat(token === null || token === void 0 ? void 0 : token.name) })] })), (0, jsx_runtime_1.jsx)(ConfirmByPasscode_1.default, { action: action, 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" }) })] }) }) }));
|