tek-wallet 0.0.371 → 0.0.374
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.
|
@@ -75,6 +75,8 @@ var WaitingData_1 = __importDefault(require("../WaitingData"));
|
|
|
75
75
|
var EmptyData_1 = __importDefault(require("../EmptyData"));
|
|
76
76
|
var Formatter_1 = __importDefault(require("../Formatter"));
|
|
77
77
|
var ListItemCustom_1 = __importDefault(require("../ListItemCustom"));
|
|
78
|
+
var CustomTooltip_1 = __importDefault(require("../CustomTooltip"));
|
|
79
|
+
var DialogContentLayout_1 = __importDefault(require("../DialogContentLayout"));
|
|
78
80
|
var ReceiveMethods;
|
|
79
81
|
(function (ReceiveMethods) {
|
|
80
82
|
ReceiveMethods["RECEIVE_INTERNAL"] = "receive_internal";
|
|
@@ -161,6 +163,18 @@ var ReceiveFunction = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
161
163
|
}
|
|
162
164
|
return "ton://transfer/".concat(receiveAddress, "?&jetton=").concat(selectedToken.address, "&amount=").concat(amount * Math.pow(10, ((_b = selectedToken === null || selectedToken === void 0 ? void 0 : selectedToken.decimal) !== null && _b !== void 0 ? _b : 0)));
|
|
163
165
|
}, [receiveAddress, selectedToken, amount, selectedMethod]);
|
|
166
|
+
var warningMessage = (0, react_1.useMemo)(function () {
|
|
167
|
+
if (selectedMethod === ReceiveMethods.RECEIVE_EXTERNAL && !amount) {
|
|
168
|
+
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: ["The amount must be between", " ", (0, jsx_runtime_1.jsxs)("strong", { style: { color: theme.palette.text.white }, children: [selectedToken === null || selectedToken === void 0 ? void 0 : selectedToken.min_value, " to ", selectedToken === null || selectedToken === void 0 ? void 0 : selectedToken.max_value, " ", selectedToken === null || selectedToken === void 0 ? void 0 : selectedToken.name] }), " ", "and", " ", (0, jsx_runtime_1.jsx)("strong", { style: { color: theme.palette.text.white }, children: "select the correct network" }), ", unless you will lose your assets."] }));
|
|
169
|
+
}
|
|
170
|
+
if (selectedMethod === ReceiveMethods.RECEIVE_EXTERNAL && !!amount) {
|
|
171
|
+
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: ["Please", " ", (0, jsx_runtime_1.jsx)("strong", { style: { color: theme.palette.text.white }, children: "select the correct network" }), ", unless you will lose your assets."] }));
|
|
172
|
+
}
|
|
173
|
+
if (selectedMethod === ReceiveMethods.RECEIVE_INTERNAL && !amount) {
|
|
174
|
+
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: ["The amount must be between", " ", (0, jsx_runtime_1.jsxs)("strong", { style: { color: theme.palette.text.white }, children: [selectedToken === null || selectedToken === void 0 ? void 0 : selectedToken.min_value, " to ", selectedToken === null || selectedToken === void 0 ? void 0 : selectedToken.max_value, " ", selectedToken === null || selectedToken === void 0 ? void 0 : selectedToken.name] }), ", unless you will lose your assets."] }));
|
|
175
|
+
}
|
|
176
|
+
return null;
|
|
177
|
+
}, [selectedMethod, selectedToken, amount]);
|
|
164
178
|
var clearValues = function () {
|
|
165
179
|
setInputAmount(0);
|
|
166
180
|
setAmount(0);
|
|
@@ -315,10 +329,9 @@ var ReceiveFunction = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
315
329
|
backdropFilter: "blur(10px)",
|
|
316
330
|
}, children: (0, jsx_runtime_1.jsx)(QRCode_1.default, { value: qrCodeValue, title: "Receive ".concat(selectedToken === null || selectedToken === void 0 ? void 0 : selectedToken.name), logo: (0, getIcon_1.default)("ton"), bgColor: "transparent" }) }), selectedMethod === ReceiveMethods.RECEIVE_EXTERNAL && ((0, jsx_runtime_1.jsxs)(material_1.Box, { sx: __assign(__assign({}, theme.mixins.column), { gap: theme.mixins.gaps.g4, color: "text.white" }), children: [(0, jsx_runtime_1.jsx)(Text_1.default, { sx: __assign({}, theme.mixins.valueDescription), children: "Network" }), (0, jsx_runtime_1.jsxs)(material_1.Box, { component: "button", sx: __assign(__assign({}, theme.mixins.row), { gap: theme.mixins.gaps.g2, cursor: "pointer", transition: "transform 0.3s ease-in-out", "&:active": {
|
|
317
331
|
transform: "translateX(0.5rem)",
|
|
318
|
-
} }), onClick: handleBack, children: [(0, jsx_runtime_1.jsx)(Text_1.default, { sx: __assign({}, theme.mixins.value), children: selectedNetwork === null || selectedNetwork === void 0 ? void 0 : selectedNetwork.name }), (0, jsx_runtime_1.jsx)(Icon_1.default, { src: (0, getIcon_1.default)("right_arrow"), width: 10 })] })] })), (0, jsx_runtime_1.jsxs)(material_1.Box, { sx: __assign(__assign({}, theme.mixins.column), { gap: theme.mixins.gaps.g4, color: "text.white" }), children: [(0, jsx_runtime_1.
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
ReceiveMethods.RECEIVE_EXTERNAL && ((0, jsx_runtime_1.jsxs)(Text_1.default, { sx: __assign({}, theme.mixins.valueDescription), children: [(0, jsx_runtime_1.jsx)("strong", { children: "Please select the correct network" }), ", unless you will lose your assets."] }))] }) })] }), (0, jsx_runtime_1.jsx)(DrawerComponent_1.default, { ref: amountDrawerRef, sx: {
|
|
332
|
+
} }), onClick: handleBack, children: [(0, jsx_runtime_1.jsx)(Text_1.default, { sx: __assign({}, theme.mixins.value), children: selectedNetwork === null || selectedNetwork === void 0 ? void 0 : selectedNetwork.name }), (0, jsx_runtime_1.jsx)(Icon_1.default, { src: (0, getIcon_1.default)("right_arrow"), width: 10 })] })] })), (0, jsx_runtime_1.jsxs)(material_1.Box, { sx: __assign(__assign({}, theme.mixins.column), { gap: theme.mixins.gaps.g4, color: "text.white" }), children: [(0, jsx_runtime_1.jsxs)(material_1.Box, { sx: __assign(__assign({}, theme.mixins.row), { gap: theme.mixins.gaps.g8 }), children: [(0, jsx_runtime_1.jsx)(Text_1.default, { sx: __assign({}, theme.mixins.valueDescription), children: selectedMethod === ReceiveMethods.RECEIVE_INTERNAL
|
|
333
|
+
? "Internal address"
|
|
334
|
+
: "Address" }), selectedMethod === ReceiveMethods.RECEIVE_INTERNAL && ((0, jsx_runtime_1.jsx)(CustomTooltip_1.default, { trigger: (0, jsx_runtime_1.jsx)(Icon_1.default, { src: (0, getIcon_1.default)("tooltip"), width: 16 }), children: (0, jsx_runtime_1.jsx)(DialogContentLayout_1.default, { children: (0, jsx_runtime_1.jsxs)(Text_1.default, { sx: __assign({}, theme.mixins.warning), children: ["This address is used to receive token by internal transfer. You can not use it for blockchain transaction. If you want to receive token by blockchain, please select the", " ", (0, jsx_runtime_1.jsx)("strong", { children: "Receive Internal" }), " method."] }) }) }))] }), (0, jsx_runtime_1.jsx)(Text_1.default, { sx: __assign(__assign({}, theme.mixins.value), { wordBreak: "break-all" }), children: (0, jsx_runtime_1.jsx)(CopyTextComponent_1.default, { value: receiveAddress || "", children: receiveAddress }) })] }), !!warningMessage && ((0, jsx_runtime_1.jsx)(material_1.Box, { sx: __assign(__assign({}, theme.mixins.column), { gap: theme.mixins.gaps.g4, backgroundColor: theme.palette.background.white16, borderRadius: theme.mixins.theBorderRadius.r12, padding: theme.mixins.customPadding.p8 }), children: (0, jsx_runtime_1.jsx)(Text_1.default, { sx: __assign({}, theme.mixins.valueDescription), children: warningMessage }) }))] }), (0, jsx_runtime_1.jsx)(DrawerComponent_1.default, { ref: amountDrawerRef, sx: {
|
|
322
335
|
width: "100%",
|
|
323
336
|
display: "flex",
|
|
324
337
|
justifyContent: "center",
|
package/dist/theme/mui/theme.js
CHANGED
|
@@ -285,6 +285,11 @@ var theme = (0, styles_1.createTheme)({
|
|
|
285
285
|
textAlign: "center",
|
|
286
286
|
padding: "".concat(customPadding.p8, " ").concat(customPadding.p16),
|
|
287
287
|
},
|
|
288
|
+
warning: {
|
|
289
|
+
color: text.warningStatus,
|
|
290
|
+
fontSize: typography.fontSize12,
|
|
291
|
+
lineHeight: typography.leading140,
|
|
292
|
+
},
|
|
288
293
|
},
|
|
289
294
|
});
|
|
290
295
|
exports.default = theme;
|