tek-wallet 0.0.829 → 0.0.830
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/TekWallet/components/index.d.ts +1 -0
- package/dist/components/TekWallet/components/index.js +1 -0
- package/dist/components/TekWallet/components/ui/AssetsBoard/index.js +4 -2
- package/dist/components/TekWallet/components/ui/NftDetail/index.js +1 -1
- package/dist/components/TekWallet/components/ui/NftsBoard/index.d.ts +5 -1
- package/dist/components/TekWallet/components/ui/NftsBoard/index.js +5 -1
- package/dist/components/TekWallet/components/ui/TokensBoard/index.d.ts +5 -1
- package/dist/components/TekWallet/components/ui/TokensBoard/index.js +6 -1
- package/dist/components/TekWallet/components/views/AssetView/LoadingView.d.ts +2 -0
- package/dist/components/TekWallet/components/views/AssetView/LoadingView.js +55 -0
- package/dist/components/TekWallet/components/views/AssetView/index.js +4 -2
- package/dist/components/TekWallet/hooks/useEventHandler.js +2 -2
- package/package.json +1 -1
|
@@ -23,6 +23,7 @@ export * from "./views/SwapView";
|
|
|
23
23
|
export * from "./views/ActivityView";
|
|
24
24
|
export * from "./views/DetailActivityView";
|
|
25
25
|
export * from "./views/SettingView";
|
|
26
|
+
export * from "./views/SendNftView";
|
|
26
27
|
export * from "./ui/ReceiveFunction";
|
|
27
28
|
export * from "./ui/ReceiveDirectly";
|
|
28
29
|
export * from "./ui/TokensBoard";
|
|
@@ -39,6 +39,7 @@ __exportStar(require("./views/SwapView"), exports);
|
|
|
39
39
|
__exportStar(require("./views/ActivityView"), exports);
|
|
40
40
|
__exportStar(require("./views/DetailActivityView"), exports);
|
|
41
41
|
__exportStar(require("./views/SettingView"), exports);
|
|
42
|
+
__exportStar(require("./views/SendNftView"), exports);
|
|
42
43
|
__exportStar(require("./ui/ReceiveFunction"), exports);
|
|
43
44
|
__exportStar(require("./ui/ReceiveDirectly"), exports);
|
|
44
45
|
__exportStar(require("./ui/TokensBoard"), exports);
|
|
@@ -11,6 +11,7 @@ var SwiperControlled_1 = __importDefault(require("../SwiperControlled"));
|
|
|
11
11
|
var react_1 = require("swiper/react");
|
|
12
12
|
var TokensBoard_1 = __importDefault(require("../TokensBoard"));
|
|
13
13
|
var NftsBoard_1 = __importDefault(require("../NftsBoard"));
|
|
14
|
+
var react_2 = require("react");
|
|
14
15
|
var ASSETS_TABS = [
|
|
15
16
|
{
|
|
16
17
|
name: "Tokens",
|
|
@@ -23,7 +24,8 @@ var ASSETS_TABS = [
|
|
|
23
24
|
];
|
|
24
25
|
var AssetsBoard = function () {
|
|
25
26
|
var theme = (0, mui_1.useTheme)();
|
|
26
|
-
|
|
27
|
+
var swiperRef = (0, react_2.useRef)(null);
|
|
28
|
+
return ((0, jsx_runtime_1.jsx)(material_1.Box, { children: (0, jsx_runtime_1.jsx)(SwiperControlled_1.default, { ref: swiperRef, swiperProps: {
|
|
27
29
|
slidesPerView: 1,
|
|
28
30
|
spaceBetween: 40,
|
|
29
31
|
autoHeight: true,
|
|
@@ -54,7 +56,7 @@ var AssetsBoard = function () {
|
|
|
54
56
|
}, children: ASSETS_TABS === null || ASSETS_TABS === void 0 ? void 0 : ASSETS_TABS.map(function (type, index) {
|
|
55
57
|
return ((0, jsx_runtime_1.jsxs)(react_1.SwiperSlide, { style: {
|
|
56
58
|
position: "relative",
|
|
57
|
-
}, children: [type.value === "tokens" && (0, jsx_runtime_1.jsx)(TokensBoard_1.default, {}), type.value === "nfts" && (0, jsx_runtime_1.jsx)(NftsBoard_1.default, {})] }, index));
|
|
59
|
+
}, children: [type.value === "tokens" && ((0, jsx_runtime_1.jsx)(TokensBoard_1.default, { onDataChanged: function () { var _a; return (_a = swiperRef.current) === null || _a === void 0 ? void 0 : _a.update(); } })), type.value === "nfts" && ((0, jsx_runtime_1.jsx)(NftsBoard_1.default, { onDataChanged: function () { var _a; return (_a = swiperRef.current) === null || _a === void 0 ? void 0 : _a.update(); } }))] }, index));
|
|
58
60
|
}) }) }));
|
|
59
61
|
};
|
|
60
62
|
exports.AssetsBoard = AssetsBoard;
|
|
@@ -42,6 +42,6 @@ function NftDetail(props) {
|
|
|
42
42
|
alignItems: "center",
|
|
43
43
|
mt: "auto",
|
|
44
44
|
gap: theme.styleMixins.gaps.g4,
|
|
45
|
-
}, children: (voucher === null || voucher === void 0 ? void 0 : voucher.expire) && ((0, jsx_runtime_1.jsxs)(Text_1.default, { sx: __assign(__assign({}, theme.styleMixins.activityDescription), { textTransform: "none", py: 1, px: 2, borderRadius: Infinity, color: theme.palette.tertiary.main, backgroundColor: "color-mix(in srgb, currentcolor 10%, transparent)", fontSize: theme.typography.fontSize13 }), children: ["Exp ", (0, formatDate_1.default)(voucher === null || voucher === void 0 ? void 0 : voucher.expire)] })) })] }), (0, jsx_runtime_1.jsx)(Button_1.default, { sx: { mt: "auto" }, onClick: handleClickButton, loading: isMinting, fullWidth: true, children: buttonLabel })] })));
|
|
45
|
+
}, children: (voucher === null || voucher === void 0 ? void 0 : voucher.expire) && ((0, jsx_runtime_1.jsxs)(Text_1.default, { sx: __assign(__assign({}, theme.styleMixins.activityDescription), { textTransform: "none", py: 1, px: 2, borderRadius: Infinity, color: theme.palette.tertiary.main, backgroundColor: "color-mix(in srgb, currentcolor 10%, transparent)", fontSize: theme.typography.fontSize13 }), children: ["Exp ", (0, formatDate_1.default)(voucher === null || voucher === void 0 ? void 0 : voucher.expire, true)] })) })] }), (0, jsx_runtime_1.jsx)(Button_1.default, { sx: { mt: "auto" }, onClick: handleClickButton, loading: isMinting, fullWidth: true, children: buttonLabel })] })));
|
|
46
46
|
}
|
|
47
47
|
exports.default = NftDetail;
|
|
@@ -1,2 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
import { Nft } from "../../../hooks/data/useNfts/service.type";
|
|
2
|
+
export interface NftsBoardProps {
|
|
3
|
+
onDataChanged: (nfts?: Nft[]) => void;
|
|
4
|
+
}
|
|
5
|
+
export declare const NftsBoard: (props: NftsBoardProps) => import("react/jsx-runtime").JSX.Element;
|
|
2
6
|
export default NftsBoard;
|
|
@@ -63,7 +63,8 @@ var react_1 = require("react");
|
|
|
63
63
|
var DrawerComponent_1 = __importStar(require("../DrawerComponent"));
|
|
64
64
|
var NftDetailView_1 = __importDefault(require("../../views/NftDetailView"));
|
|
65
65
|
var useCustomRouter_1 = __importDefault(require("../../../hooks/useCustomRouter"));
|
|
66
|
-
var NftsBoard = function () {
|
|
66
|
+
var NftsBoard = function (props) {
|
|
67
|
+
var onDataChanged = props.onDataChanged;
|
|
67
68
|
var searchParams = (0, navigation_1.useSearchParams)();
|
|
68
69
|
var pathname = (0, navigation_1.usePathname)();
|
|
69
70
|
var detailNftId = searchParams.get("detail") || undefined;
|
|
@@ -71,6 +72,9 @@ var NftsBoard = function () {
|
|
|
71
72
|
var theme = (0, mui_1.useTheme)();
|
|
72
73
|
var router = (0, useCustomRouter_1.default)();
|
|
73
74
|
var _a = (0, useNfts_1.default)(), nfts = _a.nfts, isLoadingNfts = _a.isLoading, hasNextPageNfts = _a.hasNextPage, fetchNextPageNfts = _a.fetchNextPage, refetchNfts = _a.refetch;
|
|
75
|
+
(0, react_1.useEffect)(function () {
|
|
76
|
+
onDataChanged === null || onDataChanged === void 0 ? void 0 : onDataChanged(nfts);
|
|
77
|
+
}, [nfts, onDataChanged]);
|
|
74
78
|
var isEmpty = nfts && nfts.length === 0;
|
|
75
79
|
var openDetailNft = (0, react_1.useCallback)(function () {
|
|
76
80
|
var _a;
|
|
@@ -1,2 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
import { Balance } from "../../../types/expose-type";
|
|
2
|
+
export interface TokensBoardProps {
|
|
3
|
+
onDataChanged: (tokens?: Balance[]) => void;
|
|
4
|
+
}
|
|
5
|
+
export declare const TokensBoard: (props: TokensBoardProps) => import("react/jsx-runtime").JSX.Element;
|
|
2
6
|
export default TokensBoard;
|
|
@@ -22,9 +22,14 @@ var TokenItem_1 = __importDefault(require("../TokenItem"));
|
|
|
22
22
|
var material_1 = require("@mui/material");
|
|
23
23
|
var mui_1 = require("../../../theme/mui");
|
|
24
24
|
var WaitingData_1 = __importDefault(require("../WaitingData"));
|
|
25
|
-
var
|
|
25
|
+
var react_1 = require("react");
|
|
26
|
+
var TokensBoard = function (props) {
|
|
27
|
+
var onDataChanged = props.onDataChanged;
|
|
26
28
|
var tokens = (0, useWalletData_1.default)().tokens;
|
|
27
29
|
var theme = (0, mui_1.useTheme)();
|
|
30
|
+
(0, react_1.useEffect)(function () {
|
|
31
|
+
onDataChanged === null || onDataChanged === void 0 ? void 0 : onDataChanged(tokens);
|
|
32
|
+
}, [tokens, onDataChanged]);
|
|
28
33
|
return ((0, jsx_runtime_1.jsxs)(material_1.Box, { sx: __assign(__assign({}, theme.styleMixins.column), { gap: theme.styleMixins.gaps.g12, mt: theme.styleMixins.customMargin.m8, pt: theme.styleMixins.customPadding.p8, minHeight: !tokens ? "20rem" : "unset" }), children: [!!tokens && ((0, jsx_runtime_1.jsxs)(material_1.Box, { sx: {
|
|
29
34
|
display: "grid",
|
|
30
35
|
gridTemplateColumns: "1fr auto",
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __assign = (this && this.__assign) || function () {
|
|
3
|
+
__assign = Object.assign || function(t) {
|
|
4
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
+
s = arguments[i];
|
|
6
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
+
t[p] = s[p];
|
|
8
|
+
}
|
|
9
|
+
return t;
|
|
10
|
+
};
|
|
11
|
+
return __assign.apply(this, arguments);
|
|
12
|
+
};
|
|
13
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
14
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
18
|
+
var material_1 = require("@mui/material");
|
|
19
|
+
var mui_1 = require("../../../theme/mui");
|
|
20
|
+
var WaitingData_1 = __importDefault(require("../../ui/WaitingData"));
|
|
21
|
+
function AssetViewLoadingView() {
|
|
22
|
+
var theme = (0, mui_1.useTheme)();
|
|
23
|
+
return ((0, jsx_runtime_1.jsxs)(material_1.Box, { sx: __assign(__assign(__assign({}, theme.styleMixins.column), theme.styleMixins.pagePadding), { gap: theme.styleMixins.gaps.g16 }), children: [(0, jsx_runtime_1.jsxs)(material_1.Box, { sx: __assign(__assign({}, theme.styleMixins.column), { gap: theme.styleMixins.gaps.g12 }), children: [(0, jsx_runtime_1.jsxs)(material_1.Box, { sx: __assign(__assign({}, theme.styleMixins.row), { justifyContent: "space-between", alignItems: "center" }), children: [(0, jsx_runtime_1.jsx)(material_1.Skeleton, { variant: "text", width: 120, height: 18, sx: {
|
|
24
|
+
transform: "scale(1)",
|
|
25
|
+
} }), (0, jsx_runtime_1.jsx)(material_1.Skeleton, { variant: "text", width: 70, height: 18, sx: {
|
|
26
|
+
transform: "scale(1)",
|
|
27
|
+
} })] }), (0, jsx_runtime_1.jsxs)(material_1.Box, { sx: __assign(__assign({}, theme.styleMixins.column), { gap: theme.styleMixins.gaps.g6 }), children: [(0, jsx_runtime_1.jsx)(material_1.Skeleton, { variant: "text", width: "55%", height: 34, sx: {
|
|
28
|
+
transform: "scale(1)",
|
|
29
|
+
} }), (0, jsx_runtime_1.jsx)(material_1.Skeleton, { variant: "text", width: "35%", height: 18, sx: {
|
|
30
|
+
transform: "scale(1)",
|
|
31
|
+
} })] })] }), (0, jsx_runtime_1.jsx)(material_1.Box, { sx: {
|
|
32
|
+
borderRadius: theme.styleMixins.customRadius.r16,
|
|
33
|
+
border: "1px solid ".concat(theme.palette.divider),
|
|
34
|
+
overflow: "hidden",
|
|
35
|
+
display: "grid",
|
|
36
|
+
gridTemplateColumns: "1fr 1px 1fr 1px 1fr",
|
|
37
|
+
// alignItems: "stretch",
|
|
38
|
+
}, children: Array.from({ length: 3 }).map(function (_, idx) {
|
|
39
|
+
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [idx !== 0 && (0, jsx_runtime_1.jsx)(material_1.Divider, { orientation: "vertical", flexItem: true, sx: { my: 4 } }), (0, jsx_runtime_1.jsxs)(material_1.Box, { sx: {
|
|
40
|
+
py: theme.styleMixins.customPadding.p12,
|
|
41
|
+
display: "flex",
|
|
42
|
+
flexDirection: "column",
|
|
43
|
+
alignItems: "center",
|
|
44
|
+
justifyContent: "center",
|
|
45
|
+
gap: theme.styleMixins.gaps.g8,
|
|
46
|
+
}, children: [(0, jsx_runtime_1.jsx)(material_1.Skeleton, { variant: "circular", width: 32, height: 32 }), (0, jsx_runtime_1.jsx)(material_1.Skeleton, { variant: "text", width: 56, height: 18, sx: {
|
|
47
|
+
transform: "scale(1)",
|
|
48
|
+
} })] }, "item-".concat(idx))] }));
|
|
49
|
+
}) }), (0, jsx_runtime_1.jsxs)(material_1.Box, { sx: __assign(__assign({}, theme.styleMixins.row), { gap: theme.styleMixins.gaps.g12, alignItems: "center" }), children: [(0, jsx_runtime_1.jsx)(material_1.Skeleton, { variant: "text", width: 64, height: 20, sx: {
|
|
50
|
+
transform: "scale(1)",
|
|
51
|
+
} }), (0, jsx_runtime_1.jsx)(material_1.Skeleton, { variant: "text", width: 48, height: 20, sx: {
|
|
52
|
+
transform: "scale(1)",
|
|
53
|
+
} })] }), (0, jsx_runtime_1.jsxs)(material_1.Box, { sx: __assign(__assign({}, theme.styleMixins.column), { gap: theme.styleMixins.gaps.g12 }), children: [(0, jsx_runtime_1.jsxs)(material_1.Box, { sx: { display: "grid", gridTemplateColumns: "1fr auto", gap: theme.styleMixins.gaps.g12 }, children: [(0, jsx_runtime_1.jsx)(material_1.Skeleton, { variant: "text", width: 80, height: 20, sx: { transform: "scale(1)" } }), (0, jsx_runtime_1.jsx)(material_1.Skeleton, { variant: "text", width: 80, height: 20, sx: { transform: "scale(1)" } })] }), (0, jsx_runtime_1.jsx)(WaitingData_1.default, { numberOfSkeleton: 6 })] })] }));
|
|
54
|
+
}
|
|
55
|
+
exports.default = AssetViewLoadingView;
|
|
@@ -84,9 +84,10 @@ var ClickEffect_1 = __importDefault(require("../../ui/ClickEffect"));
|
|
|
84
84
|
var mui_1 = require("../../../theme/mui");
|
|
85
85
|
var AssetsBoard_1 = __importDefault(require("../../ui/AssetsBoard"));
|
|
86
86
|
var InitPasscodeView_1 = __importDefault(require("../InitPasscodeView"));
|
|
87
|
+
var LoadingView_1 = __importDefault(require("./LoadingView"));
|
|
87
88
|
var AssetView = function (props) {
|
|
88
89
|
var sx = props.sx, rest = __rest(props, ["sx"]);
|
|
89
|
-
var _a = (0, useWalletData_1.default)(), isInitPasscode = _a.isInitPasscode, masterWallet = _a.masterWallet, updateWalletDetail = _a.updateWalletDetail;
|
|
90
|
+
var _a = (0, useWalletData_1.default)(), isInitPasscode = _a.isInitPasscode, masterWallet = _a.masterWallet, updateWalletDetail = _a.updateWalletDetail, isTokensLoading = _a.isTokensLoading, tokens = _a.tokens;
|
|
90
91
|
var theme = (0, mui_1.useTheme)();
|
|
91
92
|
var options = (0, TekWalletProvider_1.useWalletSetup)().options;
|
|
92
93
|
var _b = options || {}, hideActivitySectionInAssetView = _b.hideActivitySectionInAssetView, useBasicAmountGroupInAssetView = _b.useBasicAmountGroupInAssetView, basePath = _b.basePath;
|
|
@@ -95,7 +96,8 @@ var AssetView = function (props) {
|
|
|
95
96
|
return [2 /*return*/, updateWalletDetail()];
|
|
96
97
|
});
|
|
97
98
|
}); };
|
|
98
|
-
|
|
99
|
+
var isInitialLoading = !!isInitPasscode && isTokensLoading && !tokens;
|
|
100
|
+
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [!masterWallet && (0, jsx_runtime_1.jsx)(LoadingView_1.default, {}), !isInitPasscode && !!masterWallet && (0, jsx_runtime_1.jsx)(InitPasscodeView_1.default, { useAutoBack: false }), !!isInitPasscode && ((0, jsx_runtime_1.jsx)(ChildPageLayout_1.default, { header: !!isInitPasscode && !isInitialLoading && (0, jsx_runtime_1.jsx)(AssetViewHeader_1.default, {}), pullToRefreshProps: {
|
|
99
101
|
isPullable: !!isInitPasscode,
|
|
100
102
|
onRefresh: handleRefresh,
|
|
101
103
|
}, children: (0, jsx_runtime_1.jsxs)(DefaultPageLayout_1.default, __assign({}, rest, { sx: __assign({ display: "flex", flexDirection: "column", gap: theme.styleMixins.gaps.g16 }, sx), children: [useBasicAmountGroupInAssetView ? (0, jsx_runtime_1.jsx)(BasicAmountGroup_1.default, {}) : (0, jsx_runtime_1.jsx)(AmountGroupAndChart_1.default, {}), (0, jsx_runtime_1.jsx)(Menu_1.default, { sx: {
|
|
@@ -44,7 +44,7 @@ var useEventHandler = function () {
|
|
|
44
44
|
var _a, _b, _c;
|
|
45
45
|
if (!messageEvent)
|
|
46
46
|
return undefined;
|
|
47
|
-
var type = messageEvent.transaction_type;
|
|
47
|
+
var type = messageEvent === null || messageEvent === void 0 ? void 0 : messageEvent.transaction_type;
|
|
48
48
|
var amount = messageEvent.amount;
|
|
49
49
|
var currency = (_a = messageEvent.currency_data) === null || _a === void 0 ? void 0 : _a.name;
|
|
50
50
|
var status = messageEvent.transaction_status;
|
|
@@ -64,7 +64,7 @@ var useEventHandler = function () {
|
|
|
64
64
|
notificationType = "info";
|
|
65
65
|
}
|
|
66
66
|
var notificationMessage = ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(Text_1.default, { sx: { textTransform: "capitalize" }, children: type === null || type === void 0 ? void 0 : type.name }), " ", (0, jsx_runtime_1.jsx)(Formatter_1.default, { disableTooltip: true, value: amount, unit: " ".concat(currency) }), " is ", status] }));
|
|
67
|
-
switch (type.slug) {
|
|
67
|
+
switch (type === null || type === void 0 ? void 0 : type.slug) {
|
|
68
68
|
case type_1.TransactionSlug.SWAP:
|
|
69
69
|
var toCurrency = (_b = messageEvent.to_currency_data) === null || _b === void 0 ? void 0 : _b.name;
|
|
70
70
|
var toAmount = (_c = messageEvent.to_currency_data) === null || _c === void 0 ? void 0 : _c.swap_total_amount;
|