tek-wallet 0.0.449 → 0.0.451
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.
|
@@ -22,6 +22,7 @@ var EmptyData_1 = __importDefault(require("../EmptyData"));
|
|
|
22
22
|
var ActivityItem_1 = __importDefault(require("../ActivityItem"));
|
|
23
23
|
var useActivities_1 = __importDefault(require("../../../hooks/useActivities"));
|
|
24
24
|
var react_1 = require("react");
|
|
25
|
+
var WaitingData_1 = __importDefault(require("../WaitingData"));
|
|
25
26
|
var Status;
|
|
26
27
|
(function (Status) {
|
|
27
28
|
Status["Loading"] = "loading";
|
|
@@ -32,7 +33,7 @@ var prefix = "activities_";
|
|
|
32
33
|
function ActivitiesTypeSlice(props) {
|
|
33
34
|
var _a;
|
|
34
35
|
var theme = (0, material_1.useTheme)();
|
|
35
|
-
var _b = (0, useActivities_1.default)(), activities = _b.activities, updateActivities = _b.updateActivities;
|
|
36
|
+
var _b = (0, useActivities_1.default)(), activities = _b.activities, updateActivities = _b.updateActivities, isLoadingActivities = _b.isLoadingActivities;
|
|
36
37
|
var type = props.type, isActive = props.isActive;
|
|
37
38
|
var activitiesByType = (0, react_1.useMemo)(function () {
|
|
38
39
|
if (!(type === null || type === void 0 ? void 0 : type.slug))
|
|
@@ -47,18 +48,18 @@ function ActivitiesTypeSlice(props) {
|
|
|
47
48
|
return Status.Empty;
|
|
48
49
|
}, [type, activitiesByType]);
|
|
49
50
|
(0, react_1.useEffect)(function () {
|
|
50
|
-
if (!isActive ||
|
|
51
|
+
if (!isActive ||
|
|
52
|
+
!(type === null || type === void 0 ? void 0 : type.slug) ||
|
|
53
|
+
!!activitiesByType ||
|
|
54
|
+
isLoadingActivities[type.slug])
|
|
51
55
|
return;
|
|
52
|
-
if (!!activitiesByType)
|
|
53
|
-
return;
|
|
54
|
-
console.warn("🚀 ~ useEffect ~ type:", type);
|
|
55
56
|
updateActivities({
|
|
56
57
|
transaction_types: type.slug,
|
|
57
58
|
page: 1,
|
|
58
59
|
take: 10,
|
|
59
60
|
});
|
|
60
61
|
}, [isActive, type, activitiesByType, updateActivities]);
|
|
61
|
-
return ((0, jsx_runtime_1.jsxs)(material_1.Box, { sx: { width: "100%", height: "100%", display: "flex" }, children: [status === Status.Empty && ((0, jsx_runtime_1.jsx)(EmptyData_1.default, { sx: { margin: "auto" }, icon: (0, getIcon_1.default)(prefix + "empty_" + type.slug), description: "No ".concat((_a = type.name) === null || _a === void 0 ? void 0 : _a.toLowerCase(), " activity") })), status === Status.Filled && ((0, jsx_runtime_1.jsx)(material_1.Box, { sx: __assign(__assign({}, theme.mixins.column), { gap: theme.mixins.gaps.g12, paddingTop: theme.mixins.customPadding.p16 }), children: activitiesByType === null || activitiesByType === void 0 ? void 0 : activitiesByType.map(function (activity, index) {
|
|
62
|
+
return ((0, jsx_runtime_1.jsxs)(material_1.Box, { sx: { width: "100%", height: "100%", display: "flex" }, children: [status === Status.Loading && (0, jsx_runtime_1.jsx)(WaitingData_1.default, {}), status === Status.Empty && ((0, jsx_runtime_1.jsx)(EmptyData_1.default, { sx: { margin: "auto" }, icon: (0, getIcon_1.default)(prefix + "empty_" + type.slug), description: "No ".concat((_a = type.name) === null || _a === void 0 ? void 0 : _a.toLowerCase(), " activity") })), status === Status.Filled && ((0, jsx_runtime_1.jsx)(material_1.Box, { sx: __assign(__assign({}, theme.mixins.column), { gap: theme.mixins.gaps.g12, paddingTop: theme.mixins.customPadding.p16 }), children: activitiesByType === null || activitiesByType === void 0 ? void 0 : activitiesByType.map(function (activity, index) {
|
|
62
63
|
if (!activity)
|
|
63
64
|
return null;
|
|
64
65
|
var dataAsJson = JSON.stringify(activity);
|
|
@@ -30,7 +30,10 @@ var LoadingLayout = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
30
30
|
setLoading(false);
|
|
31
31
|
},
|
|
32
32
|
}); });
|
|
33
|
-
return ((0, jsx_runtime_1.jsxs)(material_1.Box, { sx: __assign({ position: "relative", width: "fit-content", height: "fit-content" }, sx), children: [children, loading && ((0, jsx_runtime_1.jsxs)(material_1.Box, { sx: __assign(__assign(__assign({}, theme.mixins.whiteLoadingOverlay), theme.mixins.row), { gap: theme.mixins.gaps.g8, justifyContent: "center" }), children: [(0, jsx_runtime_1.jsx)(material_1.CircularProgress, { color: "secondary", size: 20 }), (0, jsx_runtime_1.jsx)(Text_1.default, { sx:
|
|
33
|
+
return ((0, jsx_runtime_1.jsxs)(material_1.Box, { sx: __assign({ position: "relative", width: "fit-content", height: "fit-content" }, sx), children: [children, loading && ((0, jsx_runtime_1.jsxs)(material_1.Box, { sx: __assign(__assign(__assign({}, theme.mixins.whiteLoadingOverlay), theme.mixins.row), { gap: theme.mixins.gaps.g8, justifyContent: "center" }), children: [(0, jsx_runtime_1.jsx)(material_1.CircularProgress, { color: "secondary", size: 20 }), (0, jsx_runtime_1.jsx)(Text_1.default, { sx: {
|
|
34
|
+
fontSize: theme.typography.fontSize12,
|
|
35
|
+
color: "text.secondary",
|
|
36
|
+
}, children: loadingMessage })] }))] }));
|
|
34
37
|
});
|
|
35
38
|
LoadingLayout.displayName = "LoadingLayout";
|
|
36
39
|
exports.default = LoadingLayout;
|
|
@@ -108,7 +108,7 @@ var ReceiveFunction = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
108
108
|
var _f = (0, react_1.useState)(0), inputAmount = _f[0], setInputAmount = _f[1];
|
|
109
109
|
var _g = (0, react_1.useState)(0), amount = _g[0], setAmount = _g[1];
|
|
110
110
|
var _h = (0, react_1.useState)(""), amountError = _h[0], setAmountError = _h[1];
|
|
111
|
-
var _j = (0, useReceiveData_1.default)(), receiveExternalTokens = _j.receiveExternalTokens, updateReceiveExternalToken = _j.updateReceiveExternalToken, receiveInternalTokens = _j.receiveInternalTokens, updateReceiveInternalToken = _j.updateReceiveInternalToken;
|
|
111
|
+
var _j = (0, useReceiveData_1.default)(), receiveExternalTokens = _j.receiveExternalTokens, updateReceiveExternalToken = _j.updateReceiveExternalToken, isLoadingReceiveExternalToken = _j.isLoadingReceiveExternalToken, isLoadingReceiveInternalToken = _j.isLoadingReceiveInternalToken, receiveInternalTokens = _j.receiveInternalTokens, updateReceiveInternalToken = _j.updateReceiveInternalToken;
|
|
112
112
|
var receiveTokens = (0, react_1.useMemo)(function () {
|
|
113
113
|
if (selectedMethod === ReceiveMethods.RECEIVE_INTERNAL) {
|
|
114
114
|
return receiveInternalTokens;
|
|
@@ -283,10 +283,12 @@ var ReceiveFunction = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
283
283
|
gotoStep(ReceiveStep.SELECT_METHOD);
|
|
284
284
|
};
|
|
285
285
|
(0, react_1.useEffect)(function () {
|
|
286
|
-
if (isAuthenticated && !receiveTokens) {
|
|
286
|
+
if (isAuthenticated && !receiveTokens && !isLoadingReceiveExternalToken) {
|
|
287
287
|
updateReceiveExternalToken();
|
|
288
288
|
}
|
|
289
|
-
if (isAuthenticated &&
|
|
289
|
+
if (isAuthenticated &&
|
|
290
|
+
!receiveInternalTokens &&
|
|
291
|
+
!isLoadingReceiveInternalToken) {
|
|
290
292
|
updateReceiveInternalToken();
|
|
291
293
|
}
|
|
292
294
|
}, [isAuthenticated]);
|
|
@@ -160,7 +160,7 @@ var WithdrawFunction = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
160
160
|
var _d = (0, react_1.useState)(), selectedToken = _d[0], setSelectedToken = _d[1];
|
|
161
161
|
var _e = (0, react_1.useState)(), selectedNetwork = _e[0], setSelectedNetwork = _e[1];
|
|
162
162
|
var isAuthenticated = (0, useWalletData_1.default)().isAuthenticated;
|
|
163
|
-
var _f = (0, useWithdrawData_1.default)(), withdrawTokens = _f.withdrawTokens, updateWithdrawToken = _f.updateWithdrawToken, updateSendInternalToken = _f.updateSendInternalToken, sendInternalTokens = _f.sendInternalTokens;
|
|
163
|
+
var _f = (0, useWithdrawData_1.default)(), withdrawTokens = _f.withdrawTokens, updateWithdrawToken = _f.updateWithdrawToken, updateSendInternalToken = _f.updateSendInternalToken, sendInternalTokens = _f.sendInternalTokens, isLoadingWithdrawToken = _f.isLoadingWithdrawToken, isLoadingSendInternalToken = _f.isLoadingSendInternalToken;
|
|
164
164
|
var _g = (0, react_1.useState)(), infoDialogContent = _g[0], setInfoDialogContent = _g[1];
|
|
165
165
|
var _h = (0, react_1.useState)(""), amount = _h[0], setAmount = _h[1];
|
|
166
166
|
var _j = (0, react_1.useState)(undefined), memo = _j[0], setMemo = _j[1];
|
|
@@ -612,10 +612,10 @@ var WithdrawFunction = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
612
612
|
}
|
|
613
613
|
};
|
|
614
614
|
(0, react_1.useEffect)(function () {
|
|
615
|
-
if (isAuthenticated && !withdrawToken) {
|
|
615
|
+
if (isAuthenticated && !withdrawToken && !isLoadingWithdrawToken) {
|
|
616
616
|
updateWithdrawToken();
|
|
617
617
|
}
|
|
618
|
-
if (isAuthenticated && !withdrawToken) {
|
|
618
|
+
if (isAuthenticated && !withdrawToken && !isLoadingSendInternalToken) {
|
|
619
619
|
updateSendInternalToken();
|
|
620
620
|
}
|
|
621
621
|
}, [isAuthenticated]);
|