tek-wallet 0.0.665 → 0.0.667
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/ui/ChangePasscode/index.d.ts +1 -2
- package/dist/components/TekWallet/components/ui/ChangePasscode/index.js +2 -2
- package/dist/components/TekWallet/components/ui/ConfirmByPasscode/index.js +1 -1
- package/dist/components/TekWallet/components/ui/CopyTextComponent/index.js +7 -9
- package/dist/components/TekWallet/components/ui/Icon/index.d.ts +0 -1
- package/dist/components/TekWallet/components/ui/Icon/index.js +2 -2
- package/dist/components/TekWallet/components/ui/InitPasscode/index.d.ts +6 -0
- package/dist/components/TekWallet/components/ui/InitPasscode/index.js +84 -0
- package/dist/components/TekWallet/components/ui/ListItemCustom/index.d.ts +1 -1
- package/dist/components/TekWallet/components/ui/ListItemCustom/index.js +4 -3
- package/dist/components/TekWallet/components/ui/ModalLayout/index.d.ts +0 -1
- package/dist/components/TekWallet/components/ui/ModalLayout/index.js +1 -1
- package/dist/components/TekWallet/components/ui/NetworkSelection/index.js +1 -1
- package/dist/components/TekWallet/components/ui/QRCode/index.js +3 -4
- package/dist/components/TekWallet/components/ui/ReceiveFunction/components/sortByBalance.d.ts +3 -2
- package/dist/components/TekWallet/components/ui/ReceiveFunction/components/sortByBalance.js +4 -4
- package/dist/components/TekWallet/components/ui/ReceiveFunction/index.js +56 -44
- package/dist/components/TekWallet/components/ui/RequireConnect/index.js +3 -2
- package/dist/components/TekWallet/components/ui/Share/index.d.ts +3 -1
- package/dist/components/TekWallet/components/ui/Share/index.js +7 -30
- package/dist/components/TekWallet/components/ui/SvgPath/index.d.ts +4 -0
- package/dist/components/TekWallet/components/ui/SvgPath/index.js +5 -1
- package/dist/components/TekWallet/components/ui/TokenSelection/index.js +2 -2
- package/dist/components/TekWallet/components/ui/TransferInternal/index.js +1 -1
- package/dist/components/TekWallet/components/ui/WithdrawFunction/index.js +1 -1
- package/dist/components/TekWallet/components/views/ChangePasscodeView/index.js +14 -7
- package/dist/components/TekWallet/theme/mui/theme.js +1 -1
- package/dist/components/TekWallet/utils/sort.utils.d.ts +1 -0
- package/dist/components/TekWallet/utils/sort.utils.js +10 -0
- package/package.json +1 -1
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { GeneralProps } from "../../../types/ui";
|
|
2
2
|
export interface ChangePasscodeProps extends GeneralProps {
|
|
3
3
|
children: React.ReactNode;
|
|
4
|
-
isInitPasscode?: boolean;
|
|
5
4
|
}
|
|
6
|
-
export declare function ChangePasscode({ children,
|
|
5
|
+
export declare function ChangePasscode({ children, ...rest }: ChangePasscodeProps): import("react/jsx-runtime").JSX.Element;
|
|
7
6
|
export default ChangePasscode;
|
|
@@ -68,7 +68,7 @@ var material_1 = require("@mui/material");
|
|
|
68
68
|
var ChangePasscodeView_1 = __importDefault(require("../../views/ChangePasscodeView"));
|
|
69
69
|
var xhub_keyboard_1 = require("xhub-keyboard");
|
|
70
70
|
function ChangePasscode(_a) {
|
|
71
|
-
var children = _a.children,
|
|
71
|
+
var children = _a.children, rest = __rest(_a, ["children"]);
|
|
72
72
|
var getSeedPhraseViewRef = (0, react_1.useRef)(null);
|
|
73
73
|
var backAuthView = function () {
|
|
74
74
|
var _a;
|
|
@@ -80,6 +80,6 @@ function ChangePasscode(_a) {
|
|
|
80
80
|
setResetTrigger(function (prev) { return prev + "1"; });
|
|
81
81
|
}, 400);
|
|
82
82
|
};
|
|
83
|
-
return ((0, jsx_runtime_1.jsx)(RequireConnect_1.default, { children: (0, jsx_runtime_1.jsx)(DrawerComponent_1.default, { onClose: onClose, ref: getSeedPhraseViewRef, direction: DrawerComponent_1.DRAWER_DIRECTION.RIGHT, trigger: (0, jsx_runtime_1.jsx)(xhub_keyboard_1.Label, { autoFocus: true, useBrowserInput: false, htmlFor: "change-passcode-keyboard", children: (0, jsx_runtime_1.jsxs)(material_1.Box, __assign({}, rest, { sx: { position: "relative" }, children: [children, (0, jsx_runtime_1.jsx)(material_1.Box, { sx: { position: "absolute", inset: 0, zIndex: 10 } })] })) }), children: (0, jsx_runtime_1.jsx)(ChangePasscodeView_1.default, { onBack: backAuthView
|
|
83
|
+
return ((0, jsx_runtime_1.jsx)(RequireConnect_1.default, { children: (0, jsx_runtime_1.jsx)(DrawerComponent_1.default, { onClose: onClose, ref: getSeedPhraseViewRef, direction: DrawerComponent_1.DRAWER_DIRECTION.RIGHT, trigger: (0, jsx_runtime_1.jsx)(xhub_keyboard_1.Label, { autoFocus: true, useBrowserInput: false, htmlFor: "change-passcode-keyboard", children: (0, jsx_runtime_1.jsxs)(material_1.Box, __assign({}, rest, { sx: { position: "relative" }, children: [children, (0, jsx_runtime_1.jsx)(material_1.Box, { sx: { position: "absolute", inset: 0, zIndex: 10 } })] })) }), children: (0, jsx_runtime_1.jsx)(ChangePasscodeView_1.default, { onBack: backAuthView }, resetTrigger) }) }));
|
|
84
84
|
}
|
|
85
85
|
exports.default = ChangePasscode;
|
|
@@ -198,7 +198,7 @@ var ConfirmByPasscode = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
198
198
|
width: "100%",
|
|
199
199
|
maxWidth: "calc(100dvw - 2rem)",
|
|
200
200
|
display: "flex",
|
|
201
|
-
}, children: (0, jsx_runtime_1.jsx)(xhub_keyboard_1.Keyboard, { id: "confirm-passcode-keyboard", keyboardType: xhub_keyboard_1.KeyboardType.
|
|
201
|
+
}, children: (0, jsx_runtime_1.jsx)(xhub_keyboard_1.Keyboard, { id: "confirm-passcode-keyboard", value: otp, onChange: handleOtpChange, keyboardType: xhub_keyboard_1.KeyboardType.Text, layoutType: xhub_keyboard_1.LayoutType.Integer, children: (0, jsx_runtime_1.jsx)(LoadingLayout_1.default, { initLoading: false, ref: loadingRef, sx: {
|
|
202
202
|
backgroundColor: "transparent",
|
|
203
203
|
width: "100%",
|
|
204
204
|
}, children: (0, jsx_runtime_1.jsx)(ModalLayout_1.default, { title: "Enter Passcode", onClose: handleClose, sx: {
|
|
@@ -54,9 +54,8 @@ var jsx_runtime_1 = require("react/jsx-runtime");
|
|
|
54
54
|
var react_1 = require("react");
|
|
55
55
|
var material_1 = require("@mui/material");
|
|
56
56
|
var ThemeProvider_1 = require("../../../providers/ThemeProvider");
|
|
57
|
-
var Icon_1 = __importDefault(require("../Icon"));
|
|
58
|
-
var getIcon_1 = __importDefault(require("../../../utils/getIcon"));
|
|
59
57
|
var Text_1 = __importDefault(require("../Text"));
|
|
58
|
+
var SvgPath_1 = require("../SvgPath");
|
|
60
59
|
var CopyTextComponent = function (_a) {
|
|
61
60
|
var value = _a.value, iconSuccess = _a.iconSuccess, children = _a.children, hideTextMessage = _a.hideTextMessage, sx = _a.sx;
|
|
62
61
|
var theme = (0, ThemeProvider_1.useTheme)();
|
|
@@ -76,7 +75,7 @@ var CopyTextComponent = function (_a) {
|
|
|
76
75
|
setShowSuccess(true);
|
|
77
76
|
setTimeout(function () {
|
|
78
77
|
setShowSuccess(false);
|
|
79
|
-
},
|
|
78
|
+
}, 1000);
|
|
80
79
|
return [3 /*break*/, 3];
|
|
81
80
|
case 2:
|
|
82
81
|
err_1 = _a.sent();
|
|
@@ -99,13 +98,12 @@ var CopyTextComponent = function (_a) {
|
|
|
99
98
|
transformOrigin: "center bottom",
|
|
100
99
|
backgroundColor: theme.palette.background.black,
|
|
101
100
|
backdropFilter: "blur(12px)",
|
|
102
|
-
borderRadius:
|
|
101
|
+
borderRadius: 9999,
|
|
103
102
|
padding: "".concat(theme.mixins.customPadding.p8, " ").concat(theme.mixins.customPadding.p12),
|
|
104
|
-
transition:
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
} })), !hideTextMessage && ((0, jsx_runtime_1.jsx)(Text_1.default, { sx: {
|
|
103
|
+
transition: showSuccess
|
|
104
|
+
? "opacity 0.5s linear, transform 0.17s linear"
|
|
105
|
+
: "opacity 0.15s linear, transform 0.1s linear",
|
|
106
|
+
}, children: [iconSuccess || (0, jsx_runtime_1.jsx)(material_1.SvgIcon, { sx: { width: "1rem", height: "1rem" }, children: SvgPath_1.IC_SUCCESS }), !hideTextMessage && ((0, jsx_runtime_1.jsx)(Text_1.default, { sx: {
|
|
109
107
|
color: theme.palette.text.successStatus,
|
|
110
108
|
fontSize: theme.typography.fontSize14,
|
|
111
109
|
lineHeight: theme.typography.leading100,
|
|
@@ -26,7 +26,7 @@ var jsx_runtime_1 = require("react/jsx-runtime");
|
|
|
26
26
|
var material_1 = require("@mui/material");
|
|
27
27
|
var Icon = function (props) {
|
|
28
28
|
var _a, _b;
|
|
29
|
-
var src = props.src, alt = props.alt, onClick = props.onClick, width = props.width, height = props.height, sx = props.sx,
|
|
30
|
-
return ((0, jsx_runtime_1.jsx)(material_1.Box, __assign({ component: "img", src: src, alt: alt, onClick: onClick }, rest, { sx: __assign({ display: "block", width: ((_a = width !== null && width !== void 0 ? width : height) !== null && _a !== void 0 ? _a : false) ? "".concat((width || height || 0) / 16, "rem") : "auto", height: ((_b = height !== null && height !== void 0 ? height : width) !== null && _b !== void 0 ? _b : false) ? "".concat((height || width || 0) / 16, "rem") : "auto"
|
|
29
|
+
var src = props.src, alt = props.alt, onClick = props.onClick, width = props.width, height = props.height, sx = props.sx, rest = __rest(props, ["src", "alt", "onClick", "width", "height", "sx"]);
|
|
30
|
+
return ((0, jsx_runtime_1.jsx)(material_1.Box, __assign({ component: "img", src: src, alt: alt, onClick: onClick }, rest, { sx: __assign({ display: "block", width: ((_a = width !== null && width !== void 0 ? width : height) !== null && _a !== void 0 ? _a : false) ? "".concat((width || height || 0) / 16, "rem") : "auto", height: ((_b = height !== null && height !== void 0 ? height : width) !== null && _b !== void 0 ? _b : false) ? "".concat((height || width || 0) / 16, "rem") : "auto" }, sx) })));
|
|
31
31
|
};
|
|
32
32
|
exports.default = Icon;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { GeneralProps } from "../../../types/ui";
|
|
2
|
+
export interface InitPasscodeProps extends GeneralProps {
|
|
3
|
+
children: React.ReactNode;
|
|
4
|
+
}
|
|
5
|
+
export declare function InitPasscode({ children, ...rest }: InitPasscodeProps): import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
export default InitPasscode;
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
"use client";
|
|
3
|
+
var __assign = (this && this.__assign) || function () {
|
|
4
|
+
__assign = Object.assign || function(t) {
|
|
5
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
6
|
+
s = arguments[i];
|
|
7
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
8
|
+
t[p] = s[p];
|
|
9
|
+
}
|
|
10
|
+
return t;
|
|
11
|
+
};
|
|
12
|
+
return __assign.apply(this, arguments);
|
|
13
|
+
};
|
|
14
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
15
|
+
if (k2 === undefined) k2 = k;
|
|
16
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
17
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
18
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
19
|
+
}
|
|
20
|
+
Object.defineProperty(o, k2, desc);
|
|
21
|
+
}) : (function(o, m, k, k2) {
|
|
22
|
+
if (k2 === undefined) k2 = k;
|
|
23
|
+
o[k2] = m[k];
|
|
24
|
+
}));
|
|
25
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
26
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
27
|
+
}) : function(o, v) {
|
|
28
|
+
o["default"] = v;
|
|
29
|
+
});
|
|
30
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
31
|
+
var ownKeys = function(o) {
|
|
32
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
33
|
+
var ar = [];
|
|
34
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
35
|
+
return ar;
|
|
36
|
+
};
|
|
37
|
+
return ownKeys(o);
|
|
38
|
+
};
|
|
39
|
+
return function (mod) {
|
|
40
|
+
if (mod && mod.__esModule) return mod;
|
|
41
|
+
var result = {};
|
|
42
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
43
|
+
__setModuleDefault(result, mod);
|
|
44
|
+
return result;
|
|
45
|
+
};
|
|
46
|
+
})();
|
|
47
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
48
|
+
var t = {};
|
|
49
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
50
|
+
t[p] = s[p];
|
|
51
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
52
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
53
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
54
|
+
t[p[i]] = s[p[i]];
|
|
55
|
+
}
|
|
56
|
+
return t;
|
|
57
|
+
};
|
|
58
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
59
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
60
|
+
};
|
|
61
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
62
|
+
exports.InitPasscode = InitPasscode;
|
|
63
|
+
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
64
|
+
var DrawerComponent_1 = __importStar(require("../DrawerComponent"));
|
|
65
|
+
var react_1 = require("react");
|
|
66
|
+
var material_1 = require("@mui/material");
|
|
67
|
+
var ChangePasscodeView_1 = __importDefault(require("../../views/ChangePasscodeView"));
|
|
68
|
+
var xhub_keyboard_1 = require("xhub-keyboard");
|
|
69
|
+
function InitPasscode(_a) {
|
|
70
|
+
var children = _a.children, rest = __rest(_a, ["children"]);
|
|
71
|
+
var getSeedPhraseViewRef = (0, react_1.useRef)(null);
|
|
72
|
+
var backAuthView = function () {
|
|
73
|
+
var _a;
|
|
74
|
+
(_a = getSeedPhraseViewRef.current) === null || _a === void 0 ? void 0 : _a.close();
|
|
75
|
+
};
|
|
76
|
+
var _b = (0, react_1.useState)("1"), resetTrigger = _b[0], setResetTrigger = _b[1];
|
|
77
|
+
var onClose = function () {
|
|
78
|
+
setTimeout(function () {
|
|
79
|
+
setResetTrigger(function (prev) { return prev + "1"; });
|
|
80
|
+
}, 400);
|
|
81
|
+
};
|
|
82
|
+
return ((0, jsx_runtime_1.jsx)(DrawerComponent_1.default, { onClose: onClose, ref: getSeedPhraseViewRef, direction: DrawerComponent_1.DRAWER_DIRECTION.RIGHT, trigger: (0, jsx_runtime_1.jsx)(xhub_keyboard_1.Label, { autoFocus: true, useBrowserInput: false, htmlFor: "init-passcode-keyboard", children: (0, jsx_runtime_1.jsxs)(material_1.Box, __assign({}, rest, { sx: { position: "relative" }, children: [children, (0, jsx_runtime_1.jsx)(material_1.Box, { sx: { position: "absolute", inset: 0, zIndex: 10 } })] })) }), children: (0, jsx_runtime_1.jsx)(ChangePasscodeView_1.default, { onBack: backAuthView, isInitPasscode: true }, resetTrigger) }));
|
|
83
|
+
}
|
|
84
|
+
exports.default = InitPasscode;
|
|
@@ -3,7 +3,7 @@ import { ReactEventHandler } from "react";
|
|
|
3
3
|
export interface ListItemCustomProps extends Omit<ListItemButtonProps, "title"> {
|
|
4
4
|
title: React.ReactNode;
|
|
5
5
|
description: React.ReactNode;
|
|
6
|
-
icon:
|
|
6
|
+
icon: React.ReactNode;
|
|
7
7
|
onClick?: ReactEventHandler;
|
|
8
8
|
disabled?: boolean;
|
|
9
9
|
rightIcon?: React.ReactNode | boolean;
|
|
@@ -28,12 +28,13 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
28
28
|
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
29
29
|
var material_1 = require("@mui/material");
|
|
30
30
|
var ThemeProvider_1 = require("../../../providers/ThemeProvider");
|
|
31
|
-
var Icon_1 = __importDefault(require("../Icon"));
|
|
32
|
-
var getIcon_1 = __importDefault(require("../../../utils/getIcon"));
|
|
33
31
|
var Text_1 = __importDefault(require("../Text"));
|
|
32
|
+
var SvgPath_1 = require("../SvgPath");
|
|
34
33
|
function ListItemCustom(_a) {
|
|
35
34
|
var title = _a.title, description = _a.description, icon = _a.icon, rightIcon = _a.rightIcon, hideDefaultRightIcon = _a.hideDefaultRightIcon, sx = _a.sx, rest = __rest(_a, ["title", "description", "icon", "rightIcon", "hideDefaultRightIcon", "sx"]);
|
|
36
35
|
var theme = (0, ThemeProvider_1.useTheme)();
|
|
37
|
-
return ((0, jsx_runtime_1.jsxs)(material_1.ListItemButton, __assign({}, rest, { sx: __assign(__assign(__assign({}, theme.mixins.row), { gap: theme.mixins.gaps.g12, padding:
|
|
36
|
+
return ((0, jsx_runtime_1.jsxs)(material_1.ListItemButton, __assign({}, rest, { sx: __assign(__assign(__assign({}, theme.mixins.row), { gap: theme.mixins.gaps.g12, padding: theme.mixins.customPadding.p16, border: "1px solid ".concat(theme.palette.border.accent3), borderRadius: theme.mixins.customRadius.r12, backgroundColor: theme.palette.background.white }), sx), children: [icon, (0, jsx_runtime_1.jsxs)(material_1.Box, { sx: __assign(__assign({}, theme.mixins.column), { gap: theme.mixins.gaps.g4, alignItems: "start", flex: 1 }), children: [(0, jsx_runtime_1.jsx)(Text_1.default, { sx: __assign({}, theme.mixins.listTitle), children: title }), (0, jsx_runtime_1.jsx)(Text_1.default, { sx: __assign({}, theme.mixins.listDescription), children: description })] }), rightIcon !== null && rightIcon !== void 0 ? rightIcon : (!hideDefaultRightIcon && (
|
|
37
|
+
// <Icon width={10} src={getIcon("right_arrow")} sx={{ ml: "auto" }} />
|
|
38
|
+
(0, jsx_runtime_1.jsx)(material_1.SvgIcon, { sx: { width: "12px", height: "12px" }, children: SvgPath_1.IC_CHEVRON_RIGHT })))] })));
|
|
38
39
|
}
|
|
39
40
|
exports.default = ListItemCustom;
|
|
@@ -7,7 +7,6 @@ interface ModalLayoutProps extends GeneralProps {
|
|
|
7
7
|
overrideHeader?: ReactNode;
|
|
8
8
|
backgroundColor?: string;
|
|
9
9
|
fullScreen?: boolean;
|
|
10
|
-
overrideBorderRadius?: string;
|
|
11
10
|
}
|
|
12
11
|
declare const ModalLayout: (props: ModalLayoutProps) => import("react/jsx-runtime").JSX.Element;
|
|
13
12
|
export default ModalLayout;
|
|
@@ -21,7 +21,7 @@ var material_1 = require("@mui/material");
|
|
|
21
21
|
var ThemeProvider_1 = require("../../../providers/ThemeProvider");
|
|
22
22
|
var ModalLayout = function (props) {
|
|
23
23
|
var theme = (0, ThemeProvider_1.useTheme)();
|
|
24
|
-
return ((0, jsx_runtime_1.jsxs)(material_1.Box, { sx: __assign(__assign({ borderRadius:
|
|
24
|
+
return ((0, jsx_runtime_1.jsxs)(material_1.Box, { sx: __assign(__assign({ borderRadius: "1.5rem 1.5rem 0 0", maxHeight: "100dvh", backgroundColor: theme.palette.background.tertiary, display: "flex", flexDirection: "column", height: "fit-content" }, theme.mixins.pagePadding), props.sx), children: [!props.hideHeader && !props.overrideHeader && ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsxs)(material_1.Box, { sx: {
|
|
25
25
|
width: "100%",
|
|
26
26
|
position: "relative",
|
|
27
27
|
}, children: [(0, jsx_runtime_1.jsx)(ModalTitle_1.default, { children: props.title }), (0, jsx_runtime_1.jsx)(CloseModal_1.default, { sx: {
|
|
@@ -37,6 +37,6 @@ var NetworkSelection = function (props) {
|
|
|
37
37
|
var networkDataString = props.networkData, onClick = props.onClick, active = props.active, rest = __rest(props, ["networkData", "onClick", "active"]);
|
|
38
38
|
var theme = (0, ThemeProvider_1.useTheme)();
|
|
39
39
|
var networkData = (0, react_1.useMemo)(function () { return (0, parsePropsData_1.default)(networkDataString); }, [networkDataString]);
|
|
40
|
-
return ((0, jsx_runtime_1.jsxs)(material_1.Box, __assign({}, rest, { sx: __assign(__assign({}, theme.mixins.row), { backgroundColor: active ? "".concat(theme.palette.background.tertiary) : "".concat(theme.palette.background.white), padding:
|
|
40
|
+
return ((0, jsx_runtime_1.jsxs)(material_1.Box, __assign({}, rest, { sx: __assign(__assign({}, theme.mixins.row), { backgroundColor: active ? "".concat(theme.palette.background.tertiary) : "".concat(theme.palette.background.white), padding: theme.mixins.customPadding.p16, borderRadius: theme.mixins.customRadius.r12, border: "1px solid", borderColor: active ? "".concat(theme.palette.primary.main) : "".concat(theme.palette.border.accent3), gap: theme.mixins.gaps.g8, justifyContent: "space-between" }), onClick: function () { return onClick === null || onClick === void 0 ? void 0 : onClick(networkData); }, 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)(Icon_1.default, { src: networkData === null || networkData === void 0 ? void 0 : networkData.link, sx: { borderRadius: theme.mixins.customRadius.full }, width: 24 }), (0, jsx_runtime_1.jsxs)(material_1.Box, { sx: __assign(__assign({}, theme.mixins.column), { gap: theme.mixins.gaps.g2 }), children: [(0, jsx_runtime_1.jsx)(Text_1.default, { sx: __assign(__assign({}, theme.mixins.value), { color: "text.white", whiteSpace: "nowrap", textTransform: "capitalize" }), children: networkData === null || networkData === void 0 ? void 0 : networkData.name }), (0, jsx_runtime_1.jsxs)(Text_1.default, { sx: __assign(__assign({}, theme.mixins.activityDescription), { color: theme.palette.text.accent, fontSize: theme.typography.fontSize13, fontWeight: theme.typography.fontWeight400 }), children: ["Minimum Deposit: 0.0003 ", networkData === null || networkData === void 0 ? void 0 : networkData.name] })] })] }), (0, jsx_runtime_1.jsx)(material_1.Box, { children: (0, jsx_runtime_1.jsx)(Icon_1.default, { width: 20, height: 20, src: (0, getIcon_1.default)(active ? "circle_checked" : "circle_unchecked") }) })] })));
|
|
41
41
|
};
|
|
42
42
|
exports.default = NetworkSelection;
|
|
@@ -4,16 +4,15 @@ var jsx_runtime_1 = require("react/jsx-runtime");
|
|
|
4
4
|
var qrcode_react_1 = require("qrcode.react");
|
|
5
5
|
function QRCode(props) {
|
|
6
6
|
var value = props.value, _a = props.size, size = _a === void 0 ? 156 : _a, logo = props.logo, title = props.title, _b = props.bgColor, bgColor = _b === void 0 ? "#ffffff" : _b;
|
|
7
|
-
return ((0, jsx_runtime_1.jsx)(qrcode_react_1.QRCodeCanvas, { value: value, title: title, size: size, bgColor: bgColor, fgColor: "#1E4841",
|
|
8
|
-
// level={"H"}
|
|
9
|
-
minVersion: 8, marginSize: 4, imageSettings: {
|
|
7
|
+
return ((0, jsx_runtime_1.jsx)(qrcode_react_1.QRCodeCanvas, { value: value, title: title, size: size, bgColor: bgColor, fgColor: "#1E4841", level: "L", minVersion: 8, marginSize: 4, imageSettings: {
|
|
10
8
|
src: logo || "",
|
|
11
9
|
x: undefined,
|
|
12
10
|
y: undefined,
|
|
13
11
|
height: 24,
|
|
14
12
|
width: 24,
|
|
15
13
|
opacity: 1,
|
|
16
|
-
excavate:
|
|
14
|
+
excavate: false,
|
|
15
|
+
crossOrigin: "anonymous",
|
|
17
16
|
} }));
|
|
18
17
|
}
|
|
19
18
|
exports.default = QRCode;
|
package/dist/components/TekWallet/components/ui/ReceiveFunction/components/sortByBalance.d.ts
CHANGED
|
@@ -3,8 +3,9 @@ export declare enum SortBalance {
|
|
|
3
3
|
DESC = "desc"
|
|
4
4
|
}
|
|
5
5
|
interface SortByBalanceProps {
|
|
6
|
-
sortBalance
|
|
7
|
-
setSortBalance
|
|
6
|
+
sortBalance?: SortBalance;
|
|
7
|
+
setSortBalance?: (sortBalance: SortBalance) => void;
|
|
8
|
+
name: string;
|
|
8
9
|
}
|
|
9
10
|
export default function SortByBalance(props: SortByBalanceProps): import("react/jsx-runtime").JSX.Element;
|
|
10
11
|
export type { SortByBalanceProps };
|
|
@@ -27,16 +27,16 @@ var SortBalance;
|
|
|
27
27
|
SortBalance["DESC"] = "desc";
|
|
28
28
|
})(SortBalance || (exports.SortBalance = SortBalance = {}));
|
|
29
29
|
function SortByBalance(props) {
|
|
30
|
-
var sortBalance = props.sortBalance, setSortBalance = props.setSortBalance;
|
|
30
|
+
var sortBalance = props.sortBalance, setSortBalance = props.setSortBalance, name = props.name;
|
|
31
31
|
var theme = (0, ThemeProvider_1.useTheme)();
|
|
32
32
|
return ((0, jsx_runtime_1.jsxs)(material_1.Stack, { direction: "row", alignItems: "center", gap: 0.5, onClick: function () {
|
|
33
|
-
if (sortBalance === SortBalance.ASC) {
|
|
33
|
+
if (sortBalance === SortBalance.ASC && setSortBalance) {
|
|
34
34
|
setSortBalance(SortBalance.DESC);
|
|
35
35
|
}
|
|
36
|
-
else {
|
|
36
|
+
else if (sortBalance === SortBalance.DESC && setSortBalance) {
|
|
37
37
|
setSortBalance(SortBalance.ASC);
|
|
38
38
|
}
|
|
39
|
-
}, children: [(0, jsx_runtime_1.jsx)(Text_1.default, { sx: __assign(__assign({}, theme.mixins.valueDescription), { color: theme.palette.text.accent, fontWeight: theme.typography.fontWeight600 }), children:
|
|
39
|
+
}, children: [(0, jsx_runtime_1.jsx)(Text_1.default, { sx: __assign(__assign({}, theme.mixins.valueDescription), { color: theme.palette.text.accent, fontWeight: theme.typography.fontWeight600 }), children: name }), (0, jsx_runtime_1.jsxs)(material_1.Box, { className: "flex flex-col gap-[0.8px]", children: [(0, jsx_runtime_1.jsx)(material_1.SvgIcon, { inheritViewBox: true, sx: {
|
|
40
40
|
width: 8,
|
|
41
41
|
height: 5,
|
|
42
42
|
transition: "opacity 0.2s ease-in-out",
|
|
@@ -57,7 +57,6 @@ var SwiperControlled_1 = __importDefault(require("../SwiperControlled"));
|
|
|
57
57
|
var useWalletData_1 = __importDefault(require("../../../hooks/useWalletData"));
|
|
58
58
|
var ModalLayout_1 = __importDefault(require("../ModalLayout"));
|
|
59
59
|
var react_2 = require("swiper/react");
|
|
60
|
-
var BackHeader_1 = __importDefault(require("../BackHeader"));
|
|
61
60
|
var QRCode_1 = __importDefault(require("../QRCode"));
|
|
62
61
|
var Text_1 = __importDefault(require("../Text"));
|
|
63
62
|
var material_1 = require("@mui/material");
|
|
@@ -68,7 +67,6 @@ var getIcon_1 = __importDefault(require("../../../utils/getIcon"));
|
|
|
68
67
|
var Share_1 = __importDefault(require("../Share"));
|
|
69
68
|
var NetworkSelection_1 = __importDefault(require("../NetworkSelection"));
|
|
70
69
|
var TokenSelection_1 = __importDefault(require("../TokenSelection"));
|
|
71
|
-
var CloseModal_1 = __importDefault(require("../CloseModal"));
|
|
72
70
|
var useReceiveData_1 = __importDefault(require("../../../hooks/useReceiveData"));
|
|
73
71
|
var RequireConnect_1 = __importDefault(require("../RequireConnect"));
|
|
74
72
|
var WaitingData_1 = __importDefault(require("../WaitingData"));
|
|
@@ -81,7 +79,7 @@ var ThemeProvider_1 = require("../../../providers/ThemeProvider");
|
|
|
81
79
|
var ChildPageLayout_1 = __importDefault(require("../../layouts/ChildPageLayout"));
|
|
82
80
|
var LineValue_1 = __importDefault(require("../LineValue"));
|
|
83
81
|
var SvgPath_1 = require("../SvgPath");
|
|
84
|
-
var sortByBalance_1 =
|
|
82
|
+
var sortByBalance_1 = __importDefault(require("./components/sortByBalance"));
|
|
85
83
|
var ReceiveHistory_1 = __importDefault(require("../ReceiveHistory"));
|
|
86
84
|
var sort_utils_1 = require("../../../utils/sort.utils");
|
|
87
85
|
var PageHeader_1 = __importDefault(require("../PageHeader"));
|
|
@@ -112,17 +110,19 @@ exports.ReceiveFunction = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
112
110
|
var stepDrawerRef = (0, react_1.useRef)(null);
|
|
113
111
|
var stepSwiperRef = (0, react_1.useRef)(null);
|
|
114
112
|
var amountInputRef = (0, react_1.useRef)(null);
|
|
115
|
-
var _b = (0, react_1.useState)(
|
|
113
|
+
var _b = (0, react_1.useState)(false), isSharing = _b[0], setIsSharing = _b[1];
|
|
114
|
+
var _c = (0, react_1.useState)(), sortBalance = _c[0], setSortBalance = _c[1];
|
|
116
115
|
var historyRef = (0, react_1.useRef)(null);
|
|
117
116
|
var theme = (0, ThemeProvider_1.useTheme)();
|
|
118
|
-
var
|
|
119
|
-
var
|
|
120
|
-
var
|
|
121
|
-
var
|
|
122
|
-
var
|
|
123
|
-
var
|
|
124
|
-
var
|
|
125
|
-
|
|
117
|
+
var _d = (0, react_1.useState)(ReceiveStep.SELECT_METHOD), currentStep = _d[0], setCurrentStep = _d[1];
|
|
118
|
+
var _e = (0, react_1.useState)(), selectedToken = _e[0], setSelectedToken = _e[1];
|
|
119
|
+
var _f = (0, react_1.useState)(), selectedNetwork = _f[0], setSelectedNetwork = _f[1];
|
|
120
|
+
var _g = (0, useWalletData_1.default)(), isInitPasscode = _g.isInitPasscode, blockchainWallets = _g.blockchainWallets, masterWallet = _g.masterWallet;
|
|
121
|
+
var _h = (0, react_1.useState)(""), inputAmount = _h[0], setInputAmount = _h[1];
|
|
122
|
+
var _j = (0, react_1.useState)(""), amount = _j[0], setAmount = _j[1];
|
|
123
|
+
var _k = (0, react_1.useState)(""), amountError = _k[0], setAmountError = _k[1];
|
|
124
|
+
// const [receiveTokens, setReceiveTokens] = useState<ReceiveTokenType[]>([]);
|
|
125
|
+
var _l = (0, useReceiveData_1.default)(), receiveExternalTokens = _l.receiveExternalTokens, updateReceiveExternalToken = _l.updateReceiveExternalToken, receiveInternalTokens = _l.receiveInternalTokens, updateReceiveInternalToken = _l.updateReceiveInternalToken;
|
|
126
126
|
var receiveTokens = (0, react_1.useMemo)(function () {
|
|
127
127
|
if (selectedMethod === ReceiveMethods.RECEIVE_INTERNAL) {
|
|
128
128
|
return (0, sort_utils_1.sortByBalance)(receiveInternalTokens || [], sortBalance);
|
|
@@ -136,10 +136,10 @@ exports.ReceiveFunction = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
136
136
|
var newNetWorks = selectedToken.network_data;
|
|
137
137
|
var isSameNetwork = newNetWorks === null || newNetWorks === void 0 ? void 0 : newNetWorks.find(function (item) { return (item === null || item === void 0 ? void 0 : item.id) === (selectedNetwork === null || selectedNetwork === void 0 ? void 0 : selectedNetwork.id); });
|
|
138
138
|
if (!isSameNetwork) {
|
|
139
|
-
setSelectedNetwork(newNetWorks
|
|
139
|
+
// setSelectedNetwork(newNetWorks?.[0]);
|
|
140
140
|
}
|
|
141
141
|
return newNetWorks;
|
|
142
|
-
}, [selectedToken]);
|
|
142
|
+
}, [selectedNetwork === null || selectedNetwork === void 0 ? void 0 : selectedNetwork.id, selectedToken]);
|
|
143
143
|
var receiveAddress = (0, react_1.useMemo)(function () {
|
|
144
144
|
var _a;
|
|
145
145
|
if (!selectedToken) {
|
|
@@ -182,6 +182,12 @@ exports.ReceiveFunction = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
182
182
|
}
|
|
183
183
|
return null;
|
|
184
184
|
}, [selectedMethod, selectedToken, amount]);
|
|
185
|
+
var handleShareProgress = function () {
|
|
186
|
+
setIsSharing(true);
|
|
187
|
+
};
|
|
188
|
+
var handleShareFinish = function () {
|
|
189
|
+
setIsSharing(false);
|
|
190
|
+
};
|
|
185
191
|
var clearValues = function () {
|
|
186
192
|
setInputAmount("");
|
|
187
193
|
setAmount("");
|
|
@@ -189,6 +195,7 @@ exports.ReceiveFunction = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
189
195
|
setSelectedToken(undefined);
|
|
190
196
|
setSelectedNetwork(undefined);
|
|
191
197
|
setSelectedMethod(undefined);
|
|
198
|
+
handleShareFinish();
|
|
192
199
|
};
|
|
193
200
|
var open = function () {
|
|
194
201
|
var _a;
|
|
@@ -306,18 +313,9 @@ exports.ReceiveFunction = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
306
313
|
updateReceiveInternalToken();
|
|
307
314
|
}
|
|
308
315
|
}, [isInitPasscode, receiveExternalTokens, receiveInternalTokens]);
|
|
309
|
-
return ((0, jsx_runtime_1.jsx)(RequireConnect_1.default, { children: (0, jsx_runtime_1.jsx)(DrawerComponent_1.default, { ref: drawerRef, trigger: props.children, onOpen: props.onOpen, onClose: handleOnClose, children: (0, jsx_runtime_1.jsx)(ModalLayout_1.default, {
|
|
310
|
-
width: "100%",
|
|
311
|
-
display: "flex",
|
|
312
|
-
alignItems: "center",
|
|
313
|
-
mb: theme.mixins.customMargin.m20,
|
|
314
|
-
}, overrideBack: handleBack, hideBack: true, center: RECEIVE_STEP_NAME[ReceiveStep.SELECT_METHOD], children: (0, jsx_runtime_1.jsx)(CloseModal_1.default, { sx: { marginLeft: "auto" }, onClick: close }) }), children: (0, jsx_runtime_1.jsx)(DrawerComponent_1.default, { ref: stepDrawerRef, direction: DrawerComponent_1.DRAWER_DIRECTION.RIGHT, sx: {
|
|
316
|
+
return ((0, jsx_runtime_1.jsx)(RequireConnect_1.default, { children: (0, jsx_runtime_1.jsx)(DrawerComponent_1.default, { ref: drawerRef, trigger: props.children, onOpen: props.onOpen, onClose: handleOnClose, children: (0, jsx_runtime_1.jsx)(ModalLayout_1.default, { title: RECEIVE_STEP_NAME[ReceiveStep.SELECT_METHOD], onClose: close, children: (0, jsx_runtime_1.jsx)(DrawerComponent_1.default, { ref: stepDrawerRef, direction: DrawerComponent_1.DRAWER_DIRECTION.RIGHT, sx: {
|
|
315
317
|
width: "100%",
|
|
316
|
-
}, trigger: (0, jsx_runtime_1.
|
|
317
|
-
return ((0, jsx_runtime_1.jsxs)(react_1.Fragment, { children: [index !== 0 && (0, jsx_runtime_1.jsx)(material_1.Divider, {}), (0, jsx_runtime_1.jsx)(ListItemCustom_1.default, { title: item, description: item, icon: (0, getIcon_1.default)(item + "_icon"), onClick: function () { return handleSelectMethod(item); }, sx: {
|
|
318
|
-
py: theme.mixins.customPadding.p12,
|
|
319
|
-
} })] }, "method_".concat(item)));
|
|
320
|
-
}) }), children: (0, jsx_runtime_1.jsx)(ChildPageLayout_1.default, { sx: {
|
|
318
|
+
}, trigger: (0, jsx_runtime_1.jsxs)(material_1.Box, { sx: __assign(__assign({}, theme.mixins.column), { gap: theme.mixins.gaps.g12, height: "fit-content", width: "100%" }), children: [(0, jsx_runtime_1.jsx)(ListItemCustom_1.default, { title: "Top up via internal transfer", description: "Receive crypto from other Ting users", icon: (0, jsx_runtime_1.jsx)(material_1.SvgIcon, { sx: { width: 24, height: 24 }, children: SvgPath_1.IC_RECEIVE_INTERNAL }), onClick: function () { return handleSelectMethod(ReceiveMethods.RECEIVE_INTERNAL); } }), (0, jsx_runtime_1.jsx)(ListItemCustom_1.default, { title: "Top up via blockchain", description: "Deposit using a Web3 or an Exchange wallet", icon: (0, jsx_runtime_1.jsx)(material_1.SvgIcon, { sx: { width: 24, height: 24 }, children: SvgPath_1.IC_RECEIVE_EXTERNAL }), onClick: function () { return handleSelectMethod(ReceiveMethods.RECEIVE_EXTERNAL); } })] }), children: (0, jsx_runtime_1.jsx)(ChildPageLayout_1.default, { sx: {
|
|
321
319
|
position: "relative",
|
|
322
320
|
sx: "100dvh",
|
|
323
321
|
}, header: (0, jsx_runtime_1.jsx)(PageHeader_1.default, { title: RECEIVE_STEP_NAME[Math.max(currentStep, ReceiveStep.SELECT_TOKEN)], overrideBack: handleBack, rightAdornment: (0, jsx_runtime_1.jsxs)(material_1.Box, { sx: __assign(__assign({}, theme.mixins.row), { gap: theme.mixins.gaps.g4, marginLeft: "auto" }), children: [(0, jsx_runtime_1.jsx)(material_1.SvgIcon, { sx: { width: 18, height: 18 }, children: SvgPath_1.IC_HELP }), (0, jsx_runtime_1.jsx)(material_1.Divider, { orientation: "vertical", sx: {
|
|
@@ -328,17 +326,26 @@ exports.ReceiveFunction = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
328
326
|
marginRight: theme.mixins.customMargin.m4,
|
|
329
327
|
} }), (0, jsx_runtime_1.jsx)(DrawerComponent_1.default, { ref: historyRef, trigger: (0, jsx_runtime_1.jsx)(material_1.Box, { sx: {
|
|
330
328
|
marginBottom: theme.mixins.customMargin.m4,
|
|
331
|
-
}, children: (0, jsx_runtime_1.jsx)(material_1.SvgIcon, { sx: { width: 18, height: 18 }, children: SvgPath_1.IC_HISTORY }) }), direction: DrawerComponent_1.DRAWER_DIRECTION.RIGHT, children: (0, jsx_runtime_1.jsx)(ReceiveHistory_1.default, { onClose: closeHistory }) })] }) }), footer:
|
|
332
|
-
|
|
329
|
+
}, children: (0, jsx_runtime_1.jsx)(material_1.SvgIcon, { sx: { width: 18, height: 18 }, children: SvgPath_1.IC_HISTORY }) }), direction: DrawerComponent_1.DRAWER_DIRECTION.RIGHT, children: (0, jsx_runtime_1.jsx)(ReceiveHistory_1.default, { onClose: closeHistory }) })] }) }), footer: (0, jsx_runtime_1.jsx)(material_1.Box, { sx: {
|
|
330
|
+
maxHeight: currentStep === ReceiveStep.SHOW_QR_CODE ? "120px" : 0,
|
|
331
|
+
overflow: "hidden",
|
|
332
|
+
transition: currentStep === ReceiveStep.SHOW_QR_CODE ? "max-height 0.3s linear 0.3s" : "max-height 0s linear",
|
|
333
|
+
}, children: (0, jsx_runtime_1.jsx)(Share_1.default, { elementId: "share-receive-info", onProgress: handleShareProgress, onFinish: handleShareFinish, children: (0, jsx_runtime_1.jsx)(BottomActionLayout_1.default, { children: (0, jsx_runtime_1.jsx)(Button_1.default.Primary, { fullWidth: true, status: isSharing ? Button_1.BUTTON_STATUS.LOADING : undefined, children: "Share" }) }) }) }), children: (0, jsx_runtime_1.jsx)(material_1.Box, { sx: { padding: theme.mixins.pagePadding }, children: (0, jsx_runtime_1.jsxs)(SwiperControlled_1.default, { ref: stepSwiperRef, swiperProps: {
|
|
334
|
+
// autoHeight: true,
|
|
333
335
|
spaceBetween: 32,
|
|
334
|
-
}, disableSwipe: true,
|
|
336
|
+
}, disableSwipe: true,
|
|
337
|
+
// key={`step_${currentStep}`}
|
|
338
|
+
initialActiveTab: currentStep - 1, children: [(0, jsx_runtime_1.jsx)(react_2.SwiperSlide, { children: (0, jsx_runtime_1.jsxs)(material_1.Box, { sx: __assign(__assign({}, theme.mixins.column), { gap: theme.mixins.gaps.g12, height: "fit-content" }), children: [!receiveTokens && (0, jsx_runtime_1.jsx)(WaitingData_1.default, {}), (receiveTokens === null || receiveTokens === void 0 ? void 0 : receiveTokens.length) === 0 && (0, jsx_runtime_1.jsx)(EmptyData_1.default, {}), receiveTokens && (receiveTokens === null || receiveTokens === void 0 ? void 0 : receiveTokens.length) > 0 && ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(material_1.InputBase, { startAdornment: (0, jsx_runtime_1.jsx)(material_1.InputAdornment, { position: "start", children: (0, jsx_runtime_1.jsx)(material_1.SvgIcon, { sx: { width: 20, height: 20 }, children: SvgPath_1.IC_SEARCH }) }), placeholder: "Search", sx: {
|
|
335
339
|
borderRadius: theme.mixins.customRadius.r12,
|
|
336
340
|
border: "1px solid",
|
|
337
341
|
borderColor: theme.palette.border.accent3,
|
|
338
342
|
background: theme.palette.background.white,
|
|
339
343
|
color: theme.palette.text.black,
|
|
344
|
+
py: theme.mixins.customPadding.p6,
|
|
345
|
+
px: theme.mixins.customPadding.p12,
|
|
346
|
+
fontSize: theme.typography.fontSize16,
|
|
340
347
|
"input::placeholder": {
|
|
341
|
-
fontSize: theme.typography.
|
|
348
|
+
fontSize: theme.typography.fontSize12,
|
|
342
349
|
pl: theme.mixins.customPadding.p4,
|
|
343
350
|
fontWeight: theme.typography.fontWeight500,
|
|
344
351
|
color: theme.palette.text.black,
|
|
@@ -347,7 +354,9 @@ exports.ReceiveFunction = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
347
354
|
display: theme.mixins.row,
|
|
348
355
|
justifyContent: "space-between",
|
|
349
356
|
mt: theme.mixins.customMargin.m16,
|
|
350
|
-
}, children: [(0, jsx_runtime_1.
|
|
357
|
+
}, children: [(0, jsx_runtime_1.jsx)(sortByBalance_1.default, { name: "Token" }), (0, jsx_runtime_1.jsx)(sortByBalance_1.default, { name: "Balance",
|
|
358
|
+
// sortBalance={sortBalance}
|
|
359
|
+
setSortBalance: setSortBalance })] })] })), receiveTokens === null || receiveTokens === void 0 ? void 0 : receiveTokens.map(function (item, index) {
|
|
351
360
|
var stringifiedTokenData = JSON.stringify(item);
|
|
352
361
|
if (!item)
|
|
353
362
|
return null;
|
|
@@ -364,26 +373,29 @@ exports.ReceiveFunction = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
364
373
|
display: "flex",
|
|
365
374
|
flexDirection: "column",
|
|
366
375
|
gap: theme.mixins.gaps.g16,
|
|
367
|
-
}, children: [(0, jsx_runtime_1.jsxs)(material_1.Box, { sx: __assign(__assign({ width: "100%" }, theme.mixins.column), { gap: theme.mixins.gaps.g12, backgroundColor: theme.palette.background.tertiary, borderRadius: theme.mixins.customRadius.r16, padding: theme.mixins.customPadding.p16, paddingTop: "
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
376
|
+
}, children: [(0, jsx_runtime_1.jsx)("div", { id: "share-receive-info", children: (0, jsx_runtime_1.jsxs)(material_1.Box, { sx: __assign(__assign({ width: "100%" }, theme.mixins.column), { gap: theme.mixins.gaps.g12, backgroundColor: theme.palette.background.tertiary, borderRadius: theme.mixins.customRadius.r16, padding: theme.mixins.customPadding.p16, paddingTop: "5rem", alignItems: "flex-start", position: "relative", marginTop: "4.6875rem" }), children: [(0, jsx_runtime_1.jsx)(material_1.Divider, { sx: {
|
|
377
|
+
color: theme.palette.border.accent,
|
|
378
|
+
width: "100%",
|
|
379
|
+
} }), (0, jsx_runtime_1.jsx)(material_1.Box, { sx: __assign(__assign({}, theme.mixins.center), { top: 0, width: "fit-content", height: "fit-content", borderRadius: theme.mixins.customRadius.r12, padding: theme.mixins.customPadding.p8 }), children: (0, jsx_runtime_1.jsx)(QRCode_1.default, { value: qrCodeValue, logo: selectedNetwork === null || selectedNetwork === void 0 ? void 0 : selectedNetwork.link, bgColor: "transparent", size: 150 }) }), 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.jsx)(material_1.Box, { sx: __assign(__assign({}, theme.mixins.row), { justifyContent: "space-between" }), onClick: handleBack, children: (0, jsx_runtime_1.jsxs)(material_1.Box, { component: "button", sx: __assign(__assign({}, theme.mixins.row), { gap: theme.mixins.gaps.g4, cursor: "pointer", transition: "transform 0.3s ease-in-out", "&:active": {
|
|
371
380
|
transform: "translateX(0.5rem)",
|
|
372
|
-
} }), children: [(0, jsx_runtime_1.jsx)(Icon_1.default, {
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
width: "100%",
|
|
378
|
-
|
|
379
|
-
|
|
381
|
+
} }), children: [(0, jsx_runtime_1.jsx)(Icon_1.default, { width: 24, height: 24, sx: {
|
|
382
|
+
borderRadius: "9999px",
|
|
383
|
+
}, src: (selectedNetwork === null || selectedNetwork === void 0 ? void 0 : selectedNetwork.link) || (0, getIcon_1.default)("clock") }), (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.jsxs)(material_1.Box, { sx: __assign(__assign({}, theme.mixins.column), { gap: theme.mixins.gaps.g4 }), 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 ? "Internal address" : "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, { content: (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 External" }), " method instead."] }) }) }))] }), (0, jsx_runtime_1.jsxs)(CopyTextComponent_1.default, { sx: __assign(__assign({}, theme.mixins.row), { justifyContent: "space-between" }), value: receiveAddress || "", children: [(0, jsx_runtime_1.jsx)(Text_1.default, { sx: __assign(__assign({}, theme.mixins.value), { wordBreak: "break-all", maxWidth: "85%" }), children: receiveAddress }), (0, jsx_runtime_1.jsx)(material_1.SvgIcon, { sx: { width: 20, height: 20 }, children: SvgPath_1.IC_COPY })] })] }), (0, jsx_runtime_1.jsx)(material_1.Divider, { sx: {
|
|
384
|
+
color: theme.palette.border.accent,
|
|
385
|
+
width: "100%",
|
|
386
|
+
} }), (0, jsx_runtime_1.jsxs)(material_1.Box, { sx: __assign(__assign({ width: "100%" }, theme.mixins.column), { gap: theme.mixins.gaps.g12 }), children: [!!amount && ((0, jsx_runtime_1.jsx)(LineValue_1.default, { field: (0, jsx_runtime_1.jsx)(Text_1.default, { sx: __assign(__assign({}, theme.mixins.valueDescription), { color: theme.palette.text.accent, fontSize: theme.typography.fontSize13 }), children: "Amount" }), value: (0, jsx_runtime_1.jsxs)(Text_1.default, { sx: __assign(__assign({}, theme.mixins.activityTitle), { fontSize: theme.typography.fontSize13 }), children: [amount, " ", selectedToken === null || selectedToken === void 0 ? void 0 : selectedToken.name] }) })), (0, jsx_runtime_1.jsx)(LineValue_1.default, { field: (0, jsx_runtime_1.jsx)(Text_1.default, { sx: __assign(__assign({}, theme.mixins.valueDescription), { color: theme.palette.text.accent, fontSize: theme.typography.fontSize13 }), children: "Minimum Top Up" }), value: (0, jsx_runtime_1.jsxs)(Text_1.default, { sx: __assign(__assign({}, theme.mixins.activityTitle), { fontSize: theme.typography.fontSize13 }), children: ["0.003 ", selectedNetwork === null || selectedNetwork === void 0 ? void 0 : selectedNetwork.name] }) }), (0, jsx_runtime_1.jsx)(LineValue_1.default, { field: (0, jsx_runtime_1.jsx)(Text_1.default, { sx: __assign(__assign({}, theme.mixins.valueDescription), { color: theme.palette.text.accent, fontSize: theme.typography.fontSize13 }), children: "Top Up Arrival Time" }), value: (0, jsx_runtime_1.jsx)(Text_1.default, { sx: __assign(__assign({}, theme.mixins.activityTitle), { fontSize: theme.typography.fontSize13 }), children: "~ 7 Minutes" }) }), (0, jsx_runtime_1.jsx)(LineValue_1.default, { field: (0, jsx_runtime_1.jsx)(Text_1.default, { sx: __assign(__assign({}, theme.mixins.valueDescription), { color: theme.palette.text.accent, fontSize: theme.typography.fontSize13 }), children: "Withdrawal Arrival Time" }), value: (0, jsx_runtime_1.jsx)(Text_1.default, { sx: __assign(__assign({}, theme.mixins.activityTitle), { fontSize: theme.typography.fontSize13 }), children: "~ 20 Minutes" }) })] }), (0, jsx_runtime_1.jsx)(material_1.Divider, { sx: {
|
|
387
|
+
color: theme.palette.border.accent,
|
|
388
|
+
width: "100%",
|
|
389
|
+
mt: theme.mixins.customMargin.m12,
|
|
390
|
+
} }), !!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.customRadius.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: {
|
|
380
391
|
width: "100%",
|
|
381
392
|
display: "flex",
|
|
382
393
|
justifyContent: "center",
|
|
383
394
|
}, onOpen: handleAmountModalOpen, trigger: (0, jsx_runtime_1.jsx)(xhub_keyboard_1.Label, { htmlFor: "receive-amount", children: (0, jsx_runtime_1.jsxs)(Button_1.default.Text, { sx: {
|
|
384
|
-
fontSize: theme.typography.
|
|
395
|
+
fontSize: theme.typography.fontSize14,
|
|
385
396
|
textTransform: "none",
|
|
386
|
-
|
|
397
|
+
fontWeight: theme.typography.fontWeight500,
|
|
398
|
+
}, children: [amount ? "Edit" : "+ Set", " amount"] }) }), children: (0, jsx_runtime_1.jsx)(xhub_keyboard_1.Keyboard, { id: "receive-amount", onChange: handleChangeAmount, keyboardType: xhub_keyboard_1.KeyboardType.Double, value: inputAmount === null || inputAmount === void 0 ? void 0 : inputAmount.toString(), keyboardId: "amount-keyboard-id", children: (0, jsx_runtime_1.jsx)(ModalLayout_1.default, { onClose: function () { var _a; return (_a = amountDrawerRef.current) === null || _a === void 0 ? void 0 : _a.close(); }, title: (0, jsx_runtime_1.jsxs)(Text_1.default, { sx: __assign({}, theme.mixins.fieldTitle), children: [amount ? "Edit" : "Set", " ", selectedToken === null || selectedToken === void 0 ? void 0 : selectedToken.name, " amount"] }), 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)(xhub_keyboard_1.Label, { htmlFor: "receive-amount", children: (0, jsx_runtime_1.jsx)(xhub_keyboard_1.Input, { ref: amountInputRef, elementsAcceptIds: ["amount-keyboard-id"], value: inputAmount === null || inputAmount === void 0 ? void 0 : inputAmount.toString(), displayType: xhub_keyboard_1.DisplayType.Double, rightElement: (0, jsx_runtime_1.jsx)(Button_1.default.Secondary, { onClick: handleClickMaxAmount, sx: __assign({}, theme.mixins.smallButton), children: "Max" }) }) }), amountError && (0, jsx_runtime_1.jsx)(Text_1.default, { sx: __assign({}, theme.mixins.validationError), children: amountError }), (0, jsx_runtime_1.jsxs)(material_1.Box, { sx: __assign(__assign({}, theme.mixins.row), { width: "100%", mt: theme.mixins.customMargin.m8, gap: theme.mixins.gaps.g12 }), children: [!!amount && (0, jsx_runtime_1.jsx)(Button_1.default.Text, { onClick: handleUnset, children: "Unset" }), (0, jsx_runtime_1.jsx)(Button_1.default.Primary, { sx: { flex: 1 }, onClick: handleContinue, status: !!amountError ? Button_1.BUTTON_STATUS.DISABLED : Button_1.BUTTON_STATUS.ENABLED, children: "Continue" })] })] }) }) }) })] }) }, "slide_step_".concat(ReceiveStep.SHOW_QR_CODE))] }) }) }) }) }) }) }));
|
|
387
399
|
});
|
|
388
400
|
exports.ReceiveFunction.displayName = "ReceiveFunction";
|
|
389
401
|
exports.default = exports.ReceiveFunction;
|
|
@@ -56,7 +56,8 @@ var useWalletData_1 = __importDefault(require("../../../hooks/useWalletData"));
|
|
|
56
56
|
var react_1 = require("react");
|
|
57
57
|
var material_1 = require("@mui/material");
|
|
58
58
|
var AuthViewSignIn_1 = __importDefault(require("../../views/AuthViewSignIn"));
|
|
59
|
-
|
|
59
|
+
// import ChangePasscodeView from "../../views/ChangePasscodeView";
|
|
60
|
+
var InitPasscode_1 = __importDefault(require("../InitPasscode"));
|
|
60
61
|
function RequireConnect(_a) {
|
|
61
62
|
var children = _a.children, signIn = _a.signIn, component = _a.component, sx = _a.sx;
|
|
62
63
|
var authViewRef = (0, react_1.useRef)(null);
|
|
@@ -77,7 +78,7 @@ function RequireConnect(_a) {
|
|
|
77
78
|
return ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: (0, jsx_runtime_1.jsxs)(material_1.Box, { sx: __assign({ position: "relative" }, sx), component: component || "div", children: [children, (0, jsx_runtime_1.jsx)(material_1.Box, { sx: { position: "absolute", inset: 0, zIndex: 10 }, onClick: handleOpenAuthView, children: (0, jsx_runtime_1.jsxs)(DrawerComponent_1.default, { ref: authViewRef, direction: DrawerComponent_1.DRAWER_DIRECTION.RIGHT, onClick: stopPropagation, children: [isSSO && (0, jsx_runtime_1.jsx)(AuthViewSignIn_1.default, { onBack: backAuthView, onSignIn: signIn }), !isSSO && (0, jsx_runtime_1.jsx)(AuthView_1.default, { onBack: backAuthView })] }) })] }) }));
|
|
78
79
|
}
|
|
79
80
|
if (!isInitPasscode) {
|
|
80
|
-
return (
|
|
81
|
+
return (0, jsx_runtime_1.jsx)(InitPasscode_1.default, { children: children });
|
|
81
82
|
}
|
|
82
83
|
return (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: children });
|
|
83
84
|
}
|
|
@@ -6,6 +6,8 @@ interface SharePropsType extends GeneralProps {
|
|
|
6
6
|
backupMessage?: string;
|
|
7
7
|
shareTitle?: string;
|
|
8
8
|
message?: string;
|
|
9
|
+
onProgress?: () => void;
|
|
10
|
+
onFinish?: () => void;
|
|
9
11
|
}
|
|
10
|
-
declare function Share({ children, elementId, backgroundColor, skipFonts, message, shareTitle, }: SharePropsType): import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
declare function Share({ children, elementId, backgroundColor, skipFonts, message, shareTitle, onProgress, onFinish, }: SharePropsType): import("react/jsx-runtime").JSX.Element;
|
|
11
13
|
export default Share;
|
|
@@ -35,19 +35,13 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
35
35
|
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
36
36
|
}
|
|
37
37
|
};
|
|
38
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
39
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
40
|
-
};
|
|
41
38
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
42
39
|
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
43
40
|
var html_to_image_1 = require("html-to-image");
|
|
44
|
-
var react_1 = require("react");
|
|
45
|
-
var CircularProgress_1 = __importDefault(require("@mui/material/CircularProgress"));
|
|
46
41
|
var material_1 = require("@mui/material");
|
|
47
42
|
function Share(_a) {
|
|
48
43
|
var _this = this;
|
|
49
|
-
var children = _a.children, elementId = _a.elementId,
|
|
50
|
-
var _d = (0, react_1.useState)(false), isRepairing = _d[0], setIsRepairing = _d[1];
|
|
44
|
+
var children = _a.children, elementId = _a.elementId, _b = _a.backgroundColor, backgroundColor = _b === void 0 ? "#FFFFFF" : _b, _c = _a.skipFonts, skipFonts = _c === void 0 ? true : _c, _d = _a.message, message = _d === void 0 ? "" : _d, _e = _a.shareTitle, shareTitle = _e === void 0 ? "Shared Image" : _e, onProgress = _a.onProgress, onFinish = _a.onFinish;
|
|
51
45
|
var handleShareImage = function () { return __awaiter(_this, void 0, void 0, function () {
|
|
52
46
|
var el, blob, file, error_1, error_2;
|
|
53
47
|
return __generator(this, function (_a) {
|
|
@@ -58,14 +52,12 @@ function Share(_a) {
|
|
|
58
52
|
_a.label = 1;
|
|
59
53
|
case 1:
|
|
60
54
|
_a.trys.push([1, 7, , 8]);
|
|
61
|
-
// Check if the Web Share API is available
|
|
62
55
|
if (!navigator.share) {
|
|
63
|
-
// noti?.error(translate("Sharing is not supported on your device or browser"));
|
|
64
56
|
throw new Error("Sharing is not supported on your device or browser");
|
|
65
57
|
}
|
|
66
|
-
|
|
58
|
+
onProgress === null || onProgress === void 0 ? void 0 : onProgress();
|
|
67
59
|
return [4 /*yield*/, (0, html_to_image_1.toBlob)(el, {
|
|
68
|
-
quality:
|
|
60
|
+
quality: 0.8,
|
|
69
61
|
cacheBust: true,
|
|
70
62
|
skipFonts: skipFonts,
|
|
71
63
|
backgroundColor: backgroundColor,
|
|
@@ -87,38 +79,23 @@ function Share(_a) {
|
|
|
87
79
|
})];
|
|
88
80
|
case 4:
|
|
89
81
|
_a.sent();
|
|
90
|
-
|
|
82
|
+
onFinish === null || onFinish === void 0 ? void 0 : onFinish();
|
|
91
83
|
return [3 /*break*/, 6];
|
|
92
84
|
case 5:
|
|
93
85
|
error_1 = _a.sent();
|
|
94
86
|
console.error("🚀 ~ handleShareImage ~ error:", error_1);
|
|
87
|
+
onFinish === null || onFinish === void 0 ? void 0 : onFinish();
|
|
95
88
|
return [2 /*return*/];
|
|
96
89
|
case 6: return [3 /*break*/, 8];
|
|
97
90
|
case 7:
|
|
98
91
|
error_2 = _a.sent();
|
|
99
|
-
|
|
92
|
+
onFinish === null || onFinish === void 0 ? void 0 : onFinish();
|
|
100
93
|
console.error("Error capturing image:", error_2);
|
|
101
94
|
return [2 /*return*/];
|
|
102
95
|
case 8: return [2 /*return*/];
|
|
103
96
|
}
|
|
104
97
|
});
|
|
105
98
|
}); };
|
|
106
|
-
return ((0, jsx_runtime_1.
|
|
107
|
-
position: "absolute",
|
|
108
|
-
left: "50%",
|
|
109
|
-
top: "50%",
|
|
110
|
-
transform: "translate(-50%, -50%)",
|
|
111
|
-
minHeight: "100%",
|
|
112
|
-
minWidth: "100%",
|
|
113
|
-
backgroundColor: "background.black",
|
|
114
|
-
borderRadius: "50%",
|
|
115
|
-
display: "flex",
|
|
116
|
-
alignItems: "center",
|
|
117
|
-
justifyContent: "center",
|
|
118
|
-
textAlign: "center",
|
|
119
|
-
fontSize: "0.8em",
|
|
120
|
-
color: "text.secondary.main",
|
|
121
|
-
whiteSpace: "nowrap",
|
|
122
|
-
}, children: [(0, jsx_runtime_1.jsx)(CircularProgress_1.default, { size: "0.75rem" }), "preparing"] }))] }));
|
|
99
|
+
return ((0, jsx_runtime_1.jsx)(material_1.Box, { onClick: handleShareImage, sx: { position: "relative" }, children: children }));
|
|
123
100
|
}
|
|
124
101
|
exports.default = Share;
|
|
@@ -18,3 +18,7 @@ export declare const IC_CHEVRON_LEFT: import("react/jsx-runtime").JSX.Element;
|
|
|
18
18
|
export declare const IC_CHEVRON_RIGHT: import("react/jsx-runtime").JSX.Element;
|
|
19
19
|
export declare const IC_SUCCESS: import("react/jsx-runtime").JSX.Element;
|
|
20
20
|
export declare const IC_ERROR: import("react/jsx-runtime").JSX.Element;
|
|
21
|
+
export declare const IC_RECEIVE_INTERNAL: import("react/jsx-runtime").JSX.Element;
|
|
22
|
+
export declare const IC_RECEIVE_EXTERNAL: import("react/jsx-runtime").JSX.Element;
|
|
23
|
+
export declare const IC_ARROW_DROP_UP: import("react/jsx-runtime").JSX.Element;
|
|
24
|
+
export declare const IC_ARROW_DROP_DOWN: import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.IC_ERROR = exports.IC_SUCCESS = exports.IC_CHEVRON_RIGHT = exports.IC_CHEVRON_LEFT = exports.IC_TRASH = exports.IC_ARROW_BLACK_DROP = exports.IC_SWAP = exports.IC_HELP = exports.IC_PASSCODE = exports.IC_FACE_ID = exports.IC_COPY = exports.IC_TIMELINE_DOT = exports.IC_CLOSE = exports.IC_SEARCH = exports.IC_DOCUMENTS = exports.IC_SCAN = exports.IC_TUTORIAL = exports.IC_HISTORY = exports.ARROW_DROP_DOWN = exports.ARROW_DROP_UP = void 0;
|
|
3
|
+
exports.IC_ARROW_DROP_DOWN = exports.IC_ARROW_DROP_UP = exports.IC_RECEIVE_EXTERNAL = exports.IC_RECEIVE_INTERNAL = exports.IC_ERROR = exports.IC_SUCCESS = exports.IC_CHEVRON_RIGHT = exports.IC_CHEVRON_LEFT = exports.IC_TRASH = exports.IC_ARROW_BLACK_DROP = exports.IC_SWAP = exports.IC_HELP = exports.IC_PASSCODE = exports.IC_FACE_ID = exports.IC_COPY = exports.IC_TIMELINE_DOT = exports.IC_CLOSE = exports.IC_SEARCH = exports.IC_DOCUMENTS = exports.IC_SCAN = exports.IC_TUTORIAL = exports.IC_HISTORY = exports.ARROW_DROP_DOWN = exports.ARROW_DROP_UP = void 0;
|
|
4
4
|
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
5
|
exports.ARROW_DROP_UP = ((0, jsx_runtime_1.jsx)("svg", { width: "8", height: "5", viewBox: "0 0 8 5", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: (0, jsx_runtime_1.jsx)("path", { d: "M0 4.5L4 0.5L8 4.5H0Z", fill: "#000" }) }));
|
|
6
6
|
exports.ARROW_DROP_DOWN = ((0, jsx_runtime_1.jsx)("svg", { width: "8", height: "5", viewBox: "0 0 8 5", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: (0, jsx_runtime_1.jsx)("path", { d: "M8 0.5L4 4.5L0 0.5L8 0.5Z", fill: "#000" }) }));
|
|
@@ -22,3 +22,7 @@ exports.IC_CHEVRON_LEFT = ((0, jsx_runtime_1.jsx)("svg", { xmlns: "http://www.w3
|
|
|
22
22
|
exports.IC_CHEVRON_RIGHT = ((0, jsx_runtime_1.jsx)("svg", { xmlns: "http://www.w3.org/2000/svg", fill: "#000000", width: "800px", height: "800px", viewBox: "0 0 52 52", enableBackground: "new 0 0 52 52", xmlSpace: "preserve", children: (0, jsx_runtime_1.jsx)("g", { children: (0, jsx_runtime_1.jsx)("path", { d: "M17.9,4.4l20.7,20.5c0.6,0.6,0.6,1.6,0,2.2L17.9,47.6c-0.6,0.6-1.6,0.6-2.2,0l-2.2-2.2 c-0.6-0.6-0.6-1.6,0-2.2l16.3-16.1c0.6-0.6,0.6-1.6,0-2.2L13.6,8.8c-0.6-0.6-0.6-1.6,0-2.2l2.2-2.2C16.4,3.9,17.3,3.9,17.9,4.4z" }) }) }));
|
|
23
23
|
exports.IC_SUCCESS = ((0, jsx_runtime_1.jsx)("svg", { xmlns: "http://www.w3.org/2000/svg", height: "24px", viewBox: "0 -960 960 960", width: "24px", fill: "#01FF00", children: (0, jsx_runtime_1.jsx)("path", { d: "M480-80q-83 0-156-31.5T197-197q-54-54-85.5-127T80-480q0-83 31.5-156T197-763q54-54 127-85.5T480-880q65 0 123 19t107 53l-58 59q-38-24-81-37.5T480-800q-133 0-226.5 93.5T160-480q0 133 93.5 226.5T480-160q133 0 226.5-93.5T800-480q0-18-2-36t-6-35l65-65q11 32 17 66t6 70q0 83-31.5 156T763-197q-54 54-127 85.5T480-80Zm-56-216L254-466l56-56 114 114 400-401 56 56-456 457Z" }) }));
|
|
24
24
|
exports.IC_ERROR = ((0, jsx_runtime_1.jsx)("svg", { xmlns: "http://www.w3.org/2000/svg", height: "24px", viewBox: "0 -960 960 960", width: "24px", fill: "#FF434E", children: (0, jsx_runtime_1.jsx)("path", { d: "M480-280q17 0 28.5-11.5T520-320q0-17-11.5-28.5T480-360q-17 0-28.5 11.5T440-320q0 17 11.5 28.5T480-280Zm-40-160h80v-240h-80v240Zm40 360q-83 0-156-31.5T197-197q-54-54-85.5-127T80-480q0-83 31.5-156T197-763q54-54 127-85.5T480-880q83 0 156 31.5T763-763q54 54 85.5 127T880-480q0 83-31.5 156T763-197q-54 54-127 85.5T480-80Zm0-80q134 0 227-93t93-227q0-134-93-227t-227-93q-134 0-227 93t-93 227q0 134 93 227t227 93Zm0-320Z" }) }));
|
|
25
|
+
exports.IC_RECEIVE_INTERNAL = ((0, jsx_runtime_1.jsx)("svg", { width: "20", height: "20", viewBox: "0 0 20 20", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: (0, jsx_runtime_1.jsx)("path", { d: "M17.5 10C17.5 9.50272 17.3025 9.02581 16.9508 8.67417C16.5992 8.32254 16.1223 8.125 15.625 8.125H12.5C12.5 8.78804 12.2366 9.42393 11.7678 9.89277C11.2989 10.3616 10.663 10.625 10 10.625C9.33696 10.625 8.70107 10.3616 8.23223 9.89277C7.76339 9.42393 7.5 8.78804 7.5 8.125H4.375C3.87772 8.125 3.40081 8.32254 3.04917 8.67417C2.69754 9.02581 2.5 9.50272 2.5 10M17.5 10V15C17.5 15.4973 17.3025 15.9742 16.9508 16.3258C16.5992 16.6775 16.1223 16.875 15.625 16.875H4.375C3.87772 16.875 3.40081 16.6775 3.04917 16.3258C2.69754 15.9742 2.5 15.4973 2.5 15V10M17.5 10V7.5M2.5 10V7.5M17.5 7.5C17.5 7.00272 17.3025 6.52581 16.9508 6.17417C16.5992 5.82254 16.1223 5.625 15.625 5.625H4.375C3.87772 5.625 3.40081 5.82254 3.04917 6.17417C2.69754 6.52581 2.5 7.00272 2.5 7.5M17.5 7.5V5C17.5 4.50272 17.3025 4.02581 16.9508 3.67417C16.5992 3.32254 16.1223 3.125 15.625 3.125H4.375C3.87772 3.125 3.40081 3.32254 3.04917 3.67417C2.69754 4.02581 2.5 4.50272 2.5 5V7.5", stroke: "#1E4841", "stroke-width": "1.25", "stroke-linecap": "round", "stroke-linejoin": "round" }) }));
|
|
26
|
+
exports.IC_RECEIVE_EXTERNAL = ((0, jsx_runtime_1.jsx)("svg", { width: "20", height: "20", viewBox: "0 0 20 20", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: (0, jsx_runtime_1.jsx)("path", { d: "M10 5V15M7.5 12.6517L8.2325 13.2008C9.20833 13.9333 10.7908 13.9333 11.7675 13.2008C12.7442 12.4683 12.7442 11.2817 11.7675 10.5492C11.28 10.1825 10.64 10 10 10C9.39583 10 8.79167 9.81667 8.33083 9.45083C7.40917 8.71833 7.40917 7.53167 8.33083 6.79917C9.2525 6.06667 10.7475 6.06667 11.6692 6.79917L12.015 7.07417M17.5 10C17.5 10.9849 17.306 11.9602 16.9291 12.8701C16.5522 13.7801 15.9997 14.6069 15.3033 15.3033C14.6069 15.9997 13.7801 16.5522 12.8701 16.9291C11.9602 17.306 10.9849 17.5 10 17.5C9.01509 17.5 8.03982 17.306 7.12987 16.9291C6.21993 16.5522 5.39314 15.9997 4.6967 15.3033C4.00026 14.6069 3.44781 13.7801 3.0709 12.8701C2.69399 11.9602 2.5 10.9849 2.5 10C2.5 8.01088 3.29018 6.10322 4.6967 4.6967C6.10322 3.29018 8.01088 2.5 10 2.5C11.9891 2.5 13.8968 3.29018 15.3033 4.6967C16.7098 6.10322 17.5 8.01088 17.5 10Z", stroke: "#1E4841", "stroke-width": "1.25", "stroke-linecap": "round", "stroke-linejoin": "round" }) }));
|
|
27
|
+
exports.IC_ARROW_DROP_UP = ((0, jsx_runtime_1.jsx)("svg", { width: "8", height: "5", viewBox: "0 0 8 5", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: (0, jsx_runtime_1.jsx)("path", { d: "M0 4.5L4 0.5L8 4.5H0Z", fill: "#121212" }) }));
|
|
28
|
+
exports.IC_ARROW_DROP_DOWN = ((0, jsx_runtime_1.jsx)("svg", { width: "8", height: "5", viewBox: "0 0 8 5", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: (0, jsx_runtime_1.jsx)("path", { d: "M8 0.5L4 4.5L0 0.5L8 0.5Z", fill: "#A3A3A3" }) }));
|
|
@@ -45,8 +45,8 @@ var TokenSelection = function (props) {
|
|
|
45
45
|
var _a;
|
|
46
46
|
return balance * +((_a = tokenData === null || tokenData === void 0 ? void 0 : tokenData.usd_rate) !== null && _a !== void 0 ? _a : 0);
|
|
47
47
|
}, [balance, tokenData]);
|
|
48
|
-
return ((0, jsx_runtime_1.jsxs)(material_1.Box, __assign({ onClick: function () { return onClick === null || onClick === void 0 ? void 0 : onClick(tokenData); }, sx: __assign({ backgroundColor: active ? "".concat(theme.palette.background.tertiary) : "".concat(theme.palette.background.white), border: "1px solid", borderColor: active ? "".concat(theme.palette.primary.main) : "".concat(theme.palette.border.accent3), borderRadius: theme.mixins.customRadius.r16, padding: theme.mixins.customPadding.
|
|
48
|
+
return ((0, jsx_runtime_1.jsxs)(material_1.Box, __assign({ onClick: function () { return onClick === null || onClick === void 0 ? void 0 : onClick(tokenData); }, sx: __assign({ backgroundColor: active ? "".concat(theme.palette.background.tertiary) : "".concat(theme.palette.background.white), border: "1px solid", borderColor: active ? "".concat(theme.palette.primary.main) : "".concat(theme.palette.border.accent3), borderRadius: theme.mixins.customRadius.r16, padding: theme.mixins.customPadding.p16, display: "flex", alignItems: "center", cursor: "pointer" }, sx) }, rest, { children: [(0, jsx_runtime_1.jsxs)(material_1.Box, { sx: __assign(__assign({}, theme.mixins.row), { gap: theme.mixins.gaps.g12 }), children: [(0, jsx_runtime_1.jsx)(Icon_1.default, { width: 20, src: tokenData === null || tokenData === void 0 ? void 0 : tokenData.link, sx: {
|
|
49
49
|
borderRadius: theme.mixins.customRadius.full,
|
|
50
|
-
} }), (0, jsx_runtime_1.jsxs)(material_1.Box, { sx: __assign({}, theme.mixins.column), children: [(0, jsx_runtime_1.jsx)(Text_1.default, { sx: theme.mixins.value, children: tokenData === null || tokenData === void 0 ? void 0 : tokenData.name }), (0, jsx_runtime_1.jsx)(Text_1.default, { sx: theme.mixins.valueDescription, children: tokenData === null || tokenData === void 0 ? void 0 : tokenData.full_name })] })] }), (0, jsx_runtime_1.jsxs)(material_1.Box, { sx: __assign(__assign({}, theme.mixins.column), { marginLeft: "auto", alignItems: "end" }), children: [(0, jsx_runtime_1.jsx)(Text_1.default, { sx: theme.mixins.value, children: (0, jsx_runtime_1.jsx)(Formatter_1.default, { value: balance }) }), (0, jsx_runtime_1.jsx)(Text_1.default, { sx: __assign(__assign({}, theme.mixins.valueDescription), { color: theme.palette.text.accent }), children: (0, jsx_runtime_1.jsx)(Formatter_1.default, { value: balanceInUSD, start: "~ $" }) })] })] })));
|
|
50
|
+
} }), (0, jsx_runtime_1.jsxs)(material_1.Box, { sx: __assign(__assign({}, theme.mixins.column), { gap: theme.mixins.gaps.g2 }), children: [(0, jsx_runtime_1.jsx)(Text_1.default, { sx: theme.mixins.value, children: tokenData === null || tokenData === void 0 ? void 0 : tokenData.name }), (0, jsx_runtime_1.jsx)(Text_1.default, { sx: theme.mixins.valueDescription, children: tokenData === null || tokenData === void 0 ? void 0 : tokenData.full_name })] })] }), (0, jsx_runtime_1.jsxs)(material_1.Box, { sx: __assign(__assign({}, theme.mixins.column), { marginLeft: "auto", alignItems: "end" }), children: [(0, jsx_runtime_1.jsx)(Text_1.default, { sx: theme.mixins.value, children: (0, jsx_runtime_1.jsx)(Formatter_1.default, { value: balance }) }), (0, jsx_runtime_1.jsx)(Text_1.default, { sx: __assign(__assign({}, theme.mixins.valueDescription), { color: theme.palette.text.accent }), children: (0, jsx_runtime_1.jsx)(Formatter_1.default, { value: balanceInUSD, start: "~ $" }) })] })] })));
|
|
51
51
|
};
|
|
52
52
|
exports.default = TokenSelection;
|
|
@@ -235,7 +235,7 @@ exports.TransferInternal = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
235
235
|
updateSendInternalToken();
|
|
236
236
|
}
|
|
237
237
|
}, [sendInternalTokens, updateSendInternalToken, isInitPasscode]);
|
|
238
|
-
return ((0, jsx_runtime_1.jsx)(RequireConnect_1.default, { children: (0, jsx_runtime_1.jsxs)(ConfirmLayout_1.default, { ref: confirmLayoutDrawerRef, action: props.titleHeader, trigger: props.children, onOpen: validateAll, confirmAction: (0, jsx_runtime_1.jsx)(ConfirmByPasscode_1.default, { action: type_1.TransactionSlug.TransferInternal, onConfirmSuccess: handleSendInternalToken,
|
|
238
|
+
return ((0, jsx_runtime_1.jsx)(RequireConnect_1.default, { children: (0, jsx_runtime_1.jsxs)(ConfirmLayout_1.default, { ref: confirmLayoutDrawerRef, action: props.titleHeader, trigger: props.children, onOpen: validateAll, confirmAction: (0, jsx_runtime_1.jsx)(ConfirmByPasscode_1.default, { action: type_1.TransactionSlug.TransferInternal, onConfirmSuccess: handleSendInternalToken, children: (0, jsx_runtime_1.jsx)(Button_1.default.Primary, { sx: {
|
|
239
239
|
width: "100%",
|
|
240
240
|
}, status: !!error || isValidatingAddress || errorAddress ? Button_1.BUTTON_STATUS.DISABLED : buttonStatus, fullWidth: true, children: "Confirm" }) }), children: [transferContent, !!error && ((0, jsx_runtime_1.jsxs)(Text_1.default, { sx: __assign(__assign({}, theme.mixins.validationError), { mt: (_a = theme.mixins.gaps) === null || _a === void 0 ? void 0 : _a.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) })] }))] }) }));
|
|
241
241
|
});
|
|
@@ -492,7 +492,7 @@ var WithdrawFunction = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
492
492
|
(0, react_1.useEffect)(function () {
|
|
493
493
|
getEstimateFee();
|
|
494
494
|
}, [getEstimateFee]);
|
|
495
|
-
return ((0, jsx_runtime_1.jsx)(RequireConnect_1.default, { children: (0, jsx_runtime_1.jsx)(DrawerComponent_1.default, { ref: drawerRef, trigger: props.children, onOpen: props.onOpen, onClose: handleOnClose, children: (0, jsx_runtime_1.jsxs)(ModalLayout_1.default, {
|
|
495
|
+
return ((0, jsx_runtime_1.jsx)(RequireConnect_1.default, { children: (0, jsx_runtime_1.jsx)(DrawerComponent_1.default, { ref: drawerRef, trigger: props.children, onOpen: props.onOpen, onClose: handleOnClose, children: (0, jsx_runtime_1.jsxs)(ModalLayout_1.default, { sx: { height: "100dvh", borderRadius: "0" }, overrideHeader: (0, jsx_runtime_1.jsx)(BackHeader_1.default, { sx: {
|
|
496
496
|
width: "100%",
|
|
497
497
|
display: "flex",
|
|
498
498
|
alignItems: "center",
|
|
@@ -166,7 +166,9 @@ var ChangePasscodeView = function (props) {
|
|
|
166
166
|
return __generator(this, function (_c) {
|
|
167
167
|
switch (_c.label) {
|
|
168
168
|
case 0:
|
|
169
|
-
|
|
169
|
+
if (value.length < passcodeLength) {
|
|
170
|
+
setOldPasscode(value);
|
|
171
|
+
}
|
|
170
172
|
setError(null);
|
|
171
173
|
if (!(value.length === passcodeLength)) return [3 /*break*/, 2];
|
|
172
174
|
(_a = childPageLayoutRef.current) === null || _a === void 0 ? void 0 : _a.showLoading();
|
|
@@ -189,7 +191,9 @@ var ChangePasscodeView = function (props) {
|
|
|
189
191
|
}); };
|
|
190
192
|
var handleNewPasscodeChange = function (value) { return __awaiter(void 0, void 0, void 0, function () {
|
|
191
193
|
return __generator(this, function (_a) {
|
|
192
|
-
|
|
194
|
+
if (value.length < passcodeLength) {
|
|
195
|
+
setNewPasscode(value);
|
|
196
|
+
}
|
|
193
197
|
setError(null);
|
|
194
198
|
/**
|
|
195
199
|
* validate otp here
|
|
@@ -269,7 +273,9 @@ var ChangePasscodeView = function (props) {
|
|
|
269
273
|
var updatePasscode = isInitPasscode ? handleInitPasscode : handleChangePasscode;
|
|
270
274
|
var handleConfirmPasscodeChange = function (value) { return __awaiter(void 0, void 0, void 0, function () {
|
|
271
275
|
return __generator(this, function (_a) {
|
|
272
|
-
|
|
276
|
+
if (value.length < passcodeLength) {
|
|
277
|
+
setConfirmPasscode(value);
|
|
278
|
+
}
|
|
273
279
|
setError(null);
|
|
274
280
|
/**
|
|
275
281
|
* validate otp here
|
|
@@ -298,7 +304,8 @@ var ChangePasscodeView = function (props) {
|
|
|
298
304
|
}
|
|
299
305
|
};
|
|
300
306
|
var _g = getValueAndHandlerByStep(currentStep), value = _g.value, onChange = _g.onChange;
|
|
301
|
-
|
|
307
|
+
var keyboardId = (0, react_2.useMemo)(function () { return (isInitPasscode ? "init-passcode-keyboard" : "change-passcode-keyboard"); }, [isInitPasscode]);
|
|
308
|
+
return ((0, jsx_runtime_1.jsx)(xhub_keyboard_1.Keyboard, { id: keyboardId, keyboardType: xhub_keyboard_1.KeyboardType.Text, layoutType: xhub_keyboard_1.LayoutType.Integer, value: value, onChange: onChange, viewFullHeight: true, children: (0, jsx_runtime_1.jsx)(ChildPageLayout_1.default, { ref: childPageLayoutRef, header: (0, jsx_runtime_1.jsx)(PageHeader_1.default, { overrideBack: handleBack, title: pageTitle, renderBack: function (Back) { return ((0, jsx_runtime_1.jsx)(xhub_keyboard_1.Label, { useBrowserInput: false, htmlFor: keyboardId, children: Back })); } }), children: (0, jsx_runtime_1.jsx)(DefaultPageLayout_1.default, { sx: __assign({ display: "flex", flexDirection: "column", gap: "1rem", height: "100%" }, props.sx), children: (0, jsx_runtime_1.jsxs)(SwiperControlled_1.default, { ref: swiperControlledRef, disableSwipe: true, initialActiveTab: currentStep, sx: { height: "100%" }, swiperStyle: {
|
|
302
309
|
flex: 1,
|
|
303
310
|
}, children: [(0, jsx_runtime_1.jsx)(react_1.SwiperSlide, { children: (0, jsx_runtime_1.jsxs)(material_1.Box, { sx: {
|
|
304
311
|
display: "flex",
|
|
@@ -307,21 +314,21 @@ var ChangePasscodeView = function (props) {
|
|
|
307
314
|
alignItems: "center",
|
|
308
315
|
gap: "1rem",
|
|
309
316
|
height: "100%",
|
|
310
|
-
}, children: [(0, jsx_runtime_1.jsx)(Text_1.default, { sx: __assign({}, theme.mixins.sessionTitle), children: stepsContent[type_1.ChangePasscodeViewStep.ENTER_OLD_PASSCODE].title }), (0, jsx_runtime_1.jsx)(xhub_keyboard_1.Label, {
|
|
317
|
+
}, children: [(0, jsx_runtime_1.jsx)(Text_1.default, { sx: __assign({}, theme.mixins.sessionTitle), children: stepsContent[type_1.ChangePasscodeViewStep.ENTER_OLD_PASSCODE].title }), (0, jsx_runtime_1.jsx)(xhub_keyboard_1.Label, { useBrowserInput: false, htmlFor: keyboardId, children: (0, jsx_runtime_1.jsx)(OTP_1.default, { value: oldPasscode, numInputs: passcodeLength, otpInputType: OTP_1.OtpInputType.PASSWORD, readOnly: true }) }), error && (0, jsx_runtime_1.jsx)(Text_1.default, { sx: __assign(__assign({}, theme.mixins.validationError), { alignSelf: "left" }), children: error }), (0, jsx_runtime_1.jsx)(Text_1.default, { sx: __assign({}, theme.mixins.sessionDescription), children: stepsContent[type_1.ChangePasscodeViewStep.ENTER_OLD_PASSCODE].description })] }) }), (0, jsx_runtime_1.jsx)(react_1.SwiperSlide, { children: (0, jsx_runtime_1.jsxs)(material_1.Box, { sx: {
|
|
311
318
|
display: "flex",
|
|
312
319
|
flexDirection: "column",
|
|
313
320
|
justifyContent: "center",
|
|
314
321
|
alignItems: "center",
|
|
315
322
|
height: "100%",
|
|
316
323
|
gap: "1rem",
|
|
317
|
-
}, children: [(0, jsx_runtime_1.jsx)(Text_1.default, { sx: __assign({}, theme.mixins.sessionTitle), children: stepsContent[type_1.ChangePasscodeViewStep.ENTER_NEW_PASSCODE].title }), (0, jsx_runtime_1.jsx)(xhub_keyboard_1.Label, {
|
|
324
|
+
}, children: [(0, jsx_runtime_1.jsx)(Text_1.default, { sx: __assign({}, theme.mixins.sessionTitle), children: stepsContent[type_1.ChangePasscodeViewStep.ENTER_NEW_PASSCODE].title }), (0, jsx_runtime_1.jsx)(xhub_keyboard_1.Label, { useBrowserInput: false, htmlFor: keyboardId, children: (0, jsx_runtime_1.jsx)(OTP_1.default, { value: newPasscode, onChange: handleNewPasscodeChange, numInputs: passcodeLength, otpInputType: OTP_1.OtpInputType.PASSWORD, readOnly: true }) }), (0, jsx_runtime_1.jsx)(Text_1.default, { sx: __assign({}, theme.mixins.sessionDescription), children: stepsContent[type_1.ChangePasscodeViewStep.ENTER_NEW_PASSCODE].description })] }) }), (0, jsx_runtime_1.jsx)(react_1.SwiperSlide, { children: (0, jsx_runtime_1.jsxs)(material_1.Box, { sx: {
|
|
318
325
|
display: "flex",
|
|
319
326
|
flexDirection: "column",
|
|
320
327
|
alignItems: "center",
|
|
321
328
|
justifyContent: "center",
|
|
322
329
|
height: "100%",
|
|
323
330
|
gap: "1rem",
|
|
324
|
-
}, children: [(0, jsx_runtime_1.jsx)(Text_1.default, { sx: __assign({}, theme.mixins.sessionTitle), children: stepsContent[type_1.ChangePasscodeViewStep.CONFIRM_NEW_PASSCODE].title }), (0, jsx_runtime_1.jsx)(xhub_keyboard_1.Label, {
|
|
331
|
+
}, children: [(0, jsx_runtime_1.jsx)(Text_1.default, { sx: __assign({}, theme.mixins.sessionTitle), children: stepsContent[type_1.ChangePasscodeViewStep.CONFIRM_NEW_PASSCODE].title }), (0, jsx_runtime_1.jsx)(xhub_keyboard_1.Label, { useBrowserInput: false, htmlFor: keyboardId, children: (0, jsx_runtime_1.jsx)(OTP_1.default, { value: confirmPasscode, onChange: handleConfirmPasscodeChange, numInputs: passcodeLength, otpInputType: OTP_1.OtpInputType.PASSWORD, readOnly: true }) }), error && (0, jsx_runtime_1.jsx)(Text_1.default, { sx: __assign({}, theme.mixins.validationError), children: error }), (0, jsx_runtime_1.jsx)(Text_1.default, { sx: __assign({}, theme.mixins.sessionDescription), children: stepsContent[type_1.ChangePasscodeViewStep.CONFIRM_NEW_PASSCODE].description })] }) })] }) }) }) }));
|
|
325
332
|
};
|
|
326
333
|
exports.ChangePasscodeView = ChangePasscodeView;
|
|
327
334
|
exports.default = exports.ChangePasscodeView;
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
4
|
exports.sortByBalance = sortByBalance;
|
|
5
|
+
exports.sortByName = sortByName;
|
|
5
6
|
var WithdrawFunction_1 = require("../components/ui/WithdrawFunction");
|
|
6
7
|
function sortByBalance(list, sortBalance) {
|
|
7
8
|
if (sortBalance === void 0) { sortBalance = WithdrawFunction_1.SortBalance.ASC; }
|
|
@@ -12,3 +13,12 @@ function sortByBalance(list, sortBalance) {
|
|
|
12
13
|
return list === null || list === void 0 ? void 0 : list.sort(function (a, b) { return Number(b === null || b === void 0 ? void 0 : b.balance) - Number(a === null || a === void 0 ? void 0 : a.balance); });
|
|
13
14
|
}
|
|
14
15
|
}
|
|
16
|
+
function sortByName(list, sortName) {
|
|
17
|
+
if (sortName === void 0) { sortName = WithdrawFunction_1.SortBalance.ASC; }
|
|
18
|
+
if (sortName === WithdrawFunction_1.SortBalance.ASC) {
|
|
19
|
+
return list === null || list === void 0 ? void 0 : list.sort(function (a, b) { var _a; return (_a = a === null || a === void 0 ? void 0 : a.name) === null || _a === void 0 ? void 0 : _a.localeCompare(b === null || b === void 0 ? void 0 : b.name); });
|
|
20
|
+
}
|
|
21
|
+
else {
|
|
22
|
+
return list === null || list === void 0 ? void 0 : list.sort(function (a, b) { var _a; return (_a = b === null || b === void 0 ? void 0 : b.name) === null || _a === void 0 ? void 0 : _a.localeCompare(a === null || a === void 0 ? void 0 : a.name); });
|
|
23
|
+
}
|
|
24
|
+
}
|