tek-wallet 0.0.396 → 0.0.398
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.
- package/dist/components/ui/Button/index.js +4 -1
- package/dist/components/ui/Fees/index.js +1 -0
- package/dist/components/ui/SwiperControlled/index.d.ts +1 -0
- package/dist/components/ui/SwiperControlled/index.js +5 -0
- package/dist/components/ui/WithdrawFunction/index.js +5 -5
- package/package.json +1 -1
|
@@ -40,7 +40,10 @@ Button.displayName = "Button";
|
|
|
40
40
|
Button.Primary = function (props) {
|
|
41
41
|
var sx = props.sx, children = props.children, rest = __rest(props, ["sx", "children"]);
|
|
42
42
|
var theme = (0, material_1.useTheme)();
|
|
43
|
-
return ((0, jsx_runtime_1.jsx)(Button, __assign({}, rest, { variant: "contained", color: "primary", sx: __assign({ borderRadius: theme.mixins.theBorderRadius.full
|
|
43
|
+
return ((0, jsx_runtime_1.jsx)(Button, __assign({}, rest, { variant: "contained", color: "primary", sx: __assign({ borderRadius: theme.mixins.theBorderRadius.full, "&::disabled": {
|
|
44
|
+
backgroundColor: theme.palette.background.white16,
|
|
45
|
+
color: theme.palette.text.white24,
|
|
46
|
+
} }, sx), children: children })));
|
|
44
47
|
};
|
|
45
48
|
Button.Primary.displayName = "Button.Primary";
|
|
46
49
|
Button.Secondary = function (props) {
|
|
@@ -65,6 +65,7 @@ function Fees(props) {
|
|
|
65
65
|
+((_d = token === null || token === void 0 ? void 0 : token.current_value) !== null && _d !== void 0 ? _d : 0) >= totalFeeInCurrency;
|
|
66
66
|
}
|
|
67
67
|
});
|
|
68
|
+
console.warn("🚀 ~ consttokensFee:FeeDetailType[]=useMemo ~ result:", result);
|
|
68
69
|
return result;
|
|
69
70
|
}, [tokens, feesData === null || feesData === void 0 ? void 0 : feesData.feeDetail, amount]);
|
|
70
71
|
var feeCheckedBalance = (0, react_1.useMemo)(function () {
|
|
@@ -12,6 +12,7 @@ export interface SwiperControlledRef {
|
|
|
12
12
|
slideTo: (index: number) => void;
|
|
13
13
|
next: () => void;
|
|
14
14
|
prev: () => void;
|
|
15
|
+
update: () => void;
|
|
15
16
|
}
|
|
16
17
|
declare const SwiperControlled: import("react").ForwardRefExoticComponent<SwiperControlledProps & import("react").RefAttributes<SwiperControlledRef>>;
|
|
17
18
|
export default SwiperControlled;
|
|
@@ -40,10 +40,15 @@ var SwiperControlled = (0, react_2.forwardRef)(function (props, ref) {
|
|
|
40
40
|
var _a, _b;
|
|
41
41
|
(_b = (_a = swiperRef.current) === null || _a === void 0 ? void 0 : _a.swiper) === null || _b === void 0 ? void 0 : _b.slidePrev();
|
|
42
42
|
};
|
|
43
|
+
var update = function () {
|
|
44
|
+
var _a, _b;
|
|
45
|
+
(_b = (_a = swiperRef.current) === null || _a === void 0 ? void 0 : _a.swiper) === null || _b === void 0 ? void 0 : _b.update();
|
|
46
|
+
};
|
|
43
47
|
(0, react_2.useImperativeHandle)(ref, function () { return ({
|
|
44
48
|
slideTo: slideTo,
|
|
45
49
|
next: next,
|
|
46
50
|
prev: prev,
|
|
51
|
+
update: update,
|
|
47
52
|
}); });
|
|
48
53
|
var handleSlideChange = function (swiper) {
|
|
49
54
|
setActiveTab(swiper.activeIndex);
|
|
@@ -193,9 +193,9 @@ var WithdrawFunction = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
193
193
|
return undefined;
|
|
194
194
|
return +amount - +(estimateFee === null || estimateFee === void 0 ? void 0 : estimateFee.feeInCurrency);
|
|
195
195
|
}, [estimateFee, amount]);
|
|
196
|
-
|
|
196
|
+
(0, react_1.useEffect)(function () {
|
|
197
197
|
var _a;
|
|
198
|
-
|
|
198
|
+
(_a = swiperRef.current) === null || _a === void 0 ? void 0 : _a.update();
|
|
199
199
|
}, [estimateFee, amountError, recipientAddressError]);
|
|
200
200
|
var clearValues = function () {
|
|
201
201
|
setSelectedToken(undefined);
|
|
@@ -354,7 +354,7 @@ var WithdrawFunction = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
354
354
|
return __generator(this, function (_a) {
|
|
355
355
|
switch (_a.label) {
|
|
356
356
|
case 0:
|
|
357
|
-
if (!selectedToken)
|
|
357
|
+
if (!selectedToken || !!amountError)
|
|
358
358
|
return [2 /*return*/];
|
|
359
359
|
setIsLoadingEstimateFee(true);
|
|
360
360
|
return [4 /*yield*/, (0, get_est_fee_service_1.default)({
|
|
@@ -614,14 +614,14 @@ var WithdrawFunction = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
614
614
|
placeholder: "Enter memo",
|
|
615
615
|
value: memo,
|
|
616
616
|
onChange: handleChangeMemo,
|
|
617
|
-
} })] })), ((_a = estimateFee === null || estimateFee === void 0 ? void 0 : estimateFee.feeDetail) === null || _a === void 0 ? void 0 : _a.length) && !!amount && ((0, jsx_runtime_1.jsx)(Fees_1.default, { feesData: JSON.stringify(estimateFee), amount: +amount })), estimateReceive !== undefined && ((0, jsx_runtime_1.jsxs)(material_1.Box, { sx: __assign({}, theme.mixins.row), children: [(0, jsx_runtime_1.jsx)(Text_1.default, { sx: __assign({}, theme.mixins.fieldTitle), children: "Estimate receive" }), (0, jsx_runtime_1.jsx)(Text_1.default, { sx: __assign(__assign({}, theme.mixins.value), { ml: "auto" }), children: (0, jsx_runtime_1.jsx)(Formatter_1.default, { value: estimateReceive }) })] })), (0, jsx_runtime_1.jsx)(Button_1.default.Primary, { sx: { width: "100%" }, onClick: handleSend, status: !!amountError ||
|
|
617
|
+
} })] })), ((_a = estimateFee === null || estimateFee === void 0 ? void 0 : estimateFee.feeDetail) === null || _a === void 0 ? void 0 : _a.length) && !!amount && ((0, jsx_runtime_1.jsx)(Fees_1.default, { feesData: JSON.stringify(estimateFee), amount: +amount })), estimateReceive !== undefined && !amountError && ((0, jsx_runtime_1.jsxs)(material_1.Box, { sx: __assign({}, theme.mixins.row), children: [(0, jsx_runtime_1.jsx)(Text_1.default, { sx: __assign({}, theme.mixins.fieldTitle), children: "Estimate receive" }), (0, jsx_runtime_1.jsx)(Text_1.default, { sx: __assign(__assign({}, theme.mixins.value), { ml: "auto" }), children: (0, jsx_runtime_1.jsx)(Formatter_1.default, { value: estimateReceive }) })] })), (0, jsx_runtime_1.jsx)(Button_1.default.Primary, { sx: { width: "100%" }, onClick: handleSend, status: !!amountError ||
|
|
618
618
|
!!recipientAddressError ||
|
|
619
619
|
!recipientAddress ||
|
|
620
620
|
!amount ||
|
|
621
621
|
!selectedToken ||
|
|
622
622
|
isLoadingEstimateFee
|
|
623
623
|
? Button_1.BUTTON_STATUS.DISABLED
|
|
624
|
-
: Button_1.BUTTON_STATUS.ENABLED, children: "Continue" })] }) },
|
|
624
|
+
: Button_1.BUTTON_STATUS.ENABLED, children: "Continue" })] }) }, WithdrawStep.FORM)] }), (0, jsx_runtime_1.jsx)(QrCodeReader_1.default, { ref: scannerAllQrCodeRef, onResult: handleScanAllQrCode }), (0, jsx_runtime_1.jsx)(QrCodeReader_1.default, { ref: scannerAddressQrCodeRef, onResult: handleScanAddressQrCode }), (0, jsx_runtime_1.jsx)(AppBackDrop_1.default, { ref: backDropRef }), (0, jsx_runtime_1.jsx)(AppDialog_1.default, { overrideOpen: !!infoDialogContent, children: (0, jsx_runtime_1.jsx)(DialogContentLayout_1.default, { content: (0, jsx_runtime_1.jsx)(Text_1.default, { sx: {
|
|
625
625
|
textAlign: "center",
|
|
626
626
|
display: "inline-block",
|
|
627
627
|
width: "100%",
|