tek-wallet 0.0.805 → 0.0.807
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 +2 -1
- package/dist/components/TekWallet/components/index.js +2 -1
- package/dist/components/TekWallet/components/layouts/ChildPageLayout/index.js +3 -3
- package/dist/components/TekWallet/components/layouts/DefaultPageLayout/index.js +3 -3
- package/dist/components/TekWallet/components/ui/ActivitiesTypeSlice/index.js +12 -8
- package/dist/components/TekWallet/components/ui/ActivityDetail/index.js +17 -19
- package/dist/components/TekWallet/components/ui/ActivityItem/index.js +13 -13
- package/dist/components/TekWallet/components/ui/AmountGroupAndChart/index.js +3 -3
- package/dist/components/TekWallet/components/ui/AnalyticGroup/index.js +20 -20
- package/dist/components/TekWallet/components/ui/AnalyticGroupCenter/index.js +9 -8
- package/dist/components/TekWallet/components/ui/AppBackDrop/index.js +3 -3
- package/dist/components/TekWallet/components/ui/AppDialog/index.js +3 -3
- package/dist/components/TekWallet/components/ui/AssetViewHeader/index.js +9 -8
- package/dist/components/TekWallet/components/ui/BackHeader/index.js +6 -6
- package/dist/components/TekWallet/components/ui/BottomActionLayout/index.js +3 -3
- package/dist/components/TekWallet/components/ui/Button/index.js +4 -4
- package/dist/components/TekWallet/components/ui/CardToken/index.js +8 -8
- package/dist/components/TekWallet/components/ui/Column/index.js +3 -3
- package/dist/components/TekWallet/components/ui/ConfirmByPasscode/index.js +6 -4
- package/dist/components/TekWallet/components/ui/ConfirmLayout/index.js +3 -3
- package/dist/components/TekWallet/components/ui/ConfirmSwapToken/Result.js +17 -17
- package/dist/components/TekWallet/components/ui/ConfirmTransfer/index.js +3 -3
- package/dist/components/TekWallet/components/ui/CopyTextComponent/index.js +6 -6
- package/dist/components/TekWallet/components/ui/CustomTooltip/index.js +4 -2
- package/dist/components/TekWallet/components/ui/DetailSwap/index.js +9 -9
- package/dist/components/TekWallet/components/ui/DialogContentLayout/index.js +6 -6
- package/dist/components/TekWallet/components/ui/DrawerDrag/index.js +3 -3
- package/dist/components/TekWallet/components/ui/EmptyData/index.js +3 -3
- package/dist/components/TekWallet/components/ui/Fees/index.js +25 -25
- package/dist/components/TekWallet/components/ui/FeesAutoDebounce/index.js +24 -25
- package/dist/components/TekWallet/components/ui/FiatDeposit/components/shareAction.js +4 -6
- package/dist/components/TekWallet/components/ui/FiatDeposit/components/shareDrawer.js +2 -5
- package/dist/components/TekWallet/components/ui/FiatDeposit/components/shareImage.js +1 -2
- package/dist/components/TekWallet/components/ui/FiatDeposit/index.js +28 -26
- package/dist/components/TekWallet/components/ui/Formatter/index.js +3 -0
- package/dist/components/TekWallet/components/ui/FunctionItem/index.js +4 -5
- package/dist/components/TekWallet/components/ui/Icon/index.js +1 -1
- package/dist/components/TekWallet/components/ui/IconText/index.js +3 -3
- package/dist/components/TekWallet/components/ui/IncomeWallet/components/AnalyticGroup.js +19 -20
- package/dist/components/TekWallet/components/ui/IncomeWallet/components/BalanceChart.js +5 -5
- package/dist/components/TekWallet/components/ui/IncomeWallet/components/FunctionItem.js +3 -3
- package/dist/components/TekWallet/components/ui/IncomeWallet/components/HistoryItem.js +3 -3
- package/dist/components/TekWallet/components/ui/IncomeWallet/components/WealthDeposit.js +3 -1
- package/dist/components/TekWallet/components/ui/IncomeWallet/components/WealthWithdraw.js +3 -1
- package/dist/components/TekWallet/components/ui/IncomeWallet/components/history/index.js +3 -3
- package/dist/components/TekWallet/components/ui/IncomeWallet/index.js +10 -10
- package/dist/components/TekWallet/components/ui/InlineTitleValue/index.js +3 -3
- package/dist/components/TekWallet/components/ui/Input/index.js +5 -5
- package/dist/components/TekWallet/components/ui/LineValue/index.js +3 -3
- package/dist/components/TekWallet/components/ui/ListItemCustom/index.js +8 -6
- package/dist/components/TekWallet/components/ui/LoadingLayout/index.js +3 -3
- package/dist/components/TekWallet/components/ui/LockToken/index.js +4 -4
- package/dist/components/TekWallet/components/ui/ModalCheckboxToken/index.js +22 -22
- package/dist/components/TekWallet/components/ui/ModalDateFilter/index.js +11 -11
- package/dist/components/TekWallet/components/ui/ModalLayout/index.js +3 -3
- package/dist/components/TekWallet/components/ui/ModalSelectToken/index.js +12 -12
- package/dist/components/TekWallet/components/ui/ModalStatusFilter/index.js +16 -16
- package/dist/components/TekWallet/components/ui/ModalTitle/index.js +3 -3
- package/dist/components/TekWallet/components/ui/NeonLineChart/index.js +4 -4
- package/dist/components/TekWallet/components/ui/NetworkSelection/index.js +5 -5
- package/dist/components/TekWallet/components/ui/OTP/index.js +24 -18
- package/dist/components/TekWallet/components/ui/PageHeader/index.js +3 -3
- package/dist/components/TekWallet/components/ui/QRCode/index.js +3 -1
- package/dist/components/TekWallet/components/ui/QrCodeReader/index.js +2 -3
- package/dist/components/TekWallet/components/ui/ReceiveDirectly/index.d.ts +26 -0
- package/dist/components/TekWallet/components/ui/ReceiveDirectly/index.js +365 -0
- package/dist/components/TekWallet/components/ui/ReceiveFunction/components/HelpView.js +4 -4
- package/dist/components/TekWallet/components/ui/ReceiveFunction/components/SortGroup.js +4 -4
- package/dist/components/TekWallet/components/ui/ReceiveFunction/components/SortTool.js +7 -12
- package/dist/components/TekWallet/components/ui/ReceiveFunction/index.js +39 -56
- package/dist/components/TekWallet/components/ui/ReceiveHistory/ReceiveCardHistory.js +13 -13
- package/dist/components/TekWallet/components/ui/ReceiveHistory/ReceiveHistoryDetails.js +22 -29
- package/dist/components/TekWallet/components/ui/ReceiveHistory/index.js +19 -19
- package/dist/components/TekWallet/components/ui/Row/index.js +3 -3
- package/dist/components/TekWallet/components/ui/ScanQRToSend/index.js +7 -7
- package/dist/components/TekWallet/components/ui/SearchBar.d.ts +10 -0
- package/dist/components/TekWallet/components/ui/SearchBar.js +42 -0
- package/dist/components/TekWallet/components/ui/SendExternalToken/index.js +7 -7
- package/dist/components/TekWallet/components/ui/SendInternalToken/index.js +5 -5
- package/dist/components/TekWallet/components/ui/SmartList/index.js +3 -3
- package/dist/components/TekWallet/components/ui/StatusDisplay/index.js +7 -7
- package/dist/components/TekWallet/components/ui/SvgPath/index.js +27 -27
- package/dist/components/TekWallet/components/ui/SwiperControlled/index.js +1 -3
- package/dist/components/TekWallet/components/ui/TimeFilter/index.js +9 -8
- package/dist/components/TekWallet/components/ui/TimeText/index.js +1 -1
- package/dist/components/TekWallet/components/ui/TokenItem/index.js +7 -15
- package/dist/components/TekWallet/components/ui/TokenSelection/index.js +5 -5
- package/dist/components/TekWallet/components/ui/TokensBoard/index.js +12 -12
- package/dist/components/TekWallet/components/ui/TransferConfirmation/index.js +3 -3
- package/dist/components/TekWallet/components/ui/TransferInternal/index.js +3 -3
- package/dist/components/TekWallet/components/ui/UpdateLockToken/index.js +4 -4
- package/dist/components/TekWallet/components/ui/UserInfo/index.js +4 -4
- package/dist/components/TekWallet/components/ui/WaitingData/index.js +13 -12
- package/dist/components/TekWallet/components/ui/WithdrawFunction/components/selectToken.js +11 -11
- package/dist/components/TekWallet/components/ui/WithdrawFunction/components/sendForm.js +30 -30
- package/dist/components/TekWallet/components/ui/WithdrawFunction/components/sortByBalance.js +3 -3
- package/dist/components/TekWallet/components/ui/WithdrawFunction/components/sortByToken.js +3 -3
- package/dist/components/TekWallet/components/ui/WithdrawFunction/components/summary/infoSummary.js +8 -8
- package/dist/components/TekWallet/components/ui/WithdrawFunction/index.js +9 -9
- package/dist/components/TekWallet/components/views/ActivityView/index.js +4 -4
- package/dist/components/TekWallet/components/views/AssetView/Menu.js +3 -3
- package/dist/components/TekWallet/components/views/AssetView/index.js +12 -12
- package/dist/components/TekWallet/components/views/AuthView/index.js +4 -4
- package/dist/components/TekWallet/components/views/AuthViewSignIn/index.js +4 -4
- package/dist/components/TekWallet/components/views/ChangePasscodeView/index.js +8 -6
- package/dist/components/TekWallet/components/views/CreateWalletView/index.js +4 -4
- package/dist/components/TekWallet/components/views/DetailActivityView/LoadingView.js +4 -4
- package/dist/components/TekWallet/components/views/GetSeedPhraseWalletView/index.js +7 -7
- package/dist/components/TekWallet/components/views/ImportWalletView/index.js +4 -7
- package/dist/components/TekWallet/components/views/SendExternalView/components/Form.js +32 -37
- package/dist/components/TekWallet/components/views/SendExternalView/components/Result.js +16 -16
- package/dist/components/TekWallet/components/views/SendExternalView/components/SelectNetwork.js +3 -3
- package/dist/components/TekWallet/components/views/SendExternalView/components/SelectToken.js +7 -32
- package/dist/components/TekWallet/components/views/SendExternalView/components/Summary.js +12 -12
- package/dist/components/TekWallet/components/views/SendExternalView/index.js +3 -3
- package/dist/components/TekWallet/components/views/SendInternalView/components/AmountForm.js +26 -24
- package/dist/components/TekWallet/components/views/SendInternalView/components/Form.js +27 -33
- package/dist/components/TekWallet/components/views/SendInternalView/components/Result.js +14 -14
- package/dist/components/TekWallet/components/views/SendInternalView/components/SelectToken.js +7 -32
- package/dist/components/TekWallet/components/views/SendInternalView/components/Summary.js +10 -10
- package/dist/components/TekWallet/components/views/SendInternalView/index.js +3 -3
- package/dist/components/TekWallet/components/views/SettingView/index.js +4 -13
- package/dist/components/TekWallet/components/views/SwapView/components/FromCard/FromCardSkeleton.js +7 -8
- package/dist/components/TekWallet/components/views/SwapView/components/FromCard/index.js +20 -25
- package/dist/components/TekWallet/components/views/SwapView/components/SelectToken.js +7 -32
- package/dist/components/TekWallet/components/views/SwapView/components/Summary.js +36 -39
- package/dist/components/TekWallet/components/views/SwapView/components/ToCard/index.js +7 -7
- package/dist/components/TekWallet/components/views/SwapView/index.js +12 -10
- package/dist/components/TekWallet/hooks/useEventHandler.d.ts +1 -0
- package/dist/components/TekWallet/hooks/useEventHandler.js +9 -7
- package/dist/components/TekWallet/hooks/useRefetchOnWindowFocused.d.ts +7 -0
- package/dist/components/TekWallet/hooks/useRefetchOnWindowFocused.js +144 -0
- package/dist/components/TekWallet/hooks/useValidateAmount.js +3 -3
- package/dist/components/TekWallet/hooks/useWarningWrongPasscode.js +5 -5
- package/dist/components/TekWallet/index.d.ts +2 -0
- package/dist/components/TekWallet/index.js +2 -12
- package/dist/components/TekWallet/layouts/ChildPageLayout/index.js +3 -3
- package/dist/components/TekWallet/providers/ActivitiesProvider/index.js +28 -0
- package/dist/components/TekWallet/providers/ActivitiesProvider/type.d.ts +1 -0
- package/dist/components/TekWallet/providers/EventHandlerProvider/index.js +11 -1
- package/dist/components/TekWallet/providers/RealtimeProvider/index.js +15 -13
- package/dist/components/TekWallet/providers/TekWalletProvider/index.d.ts +9 -1
- package/dist/components/TekWallet/providers/TekWalletProvider/index.js +11 -4
- package/dist/components/TekWallet/providers/index.d.ts +0 -1
- package/dist/components/TekWallet/providers/index.js +0 -1
- package/dist/components/TekWallet/theme/mui/components/index.d.ts +133 -0
- package/dist/components/TekWallet/theme/mui/components/index.js +14 -0
- package/dist/components/TekWallet/theme/mui/components/overrides/Button.d.ts +142 -0
- package/dist/components/TekWallet/theme/mui/components/overrides/Button.js +84 -0
- package/dist/components/TekWallet/theme/mui/components/overrides/Drawer.d.ts +4 -0
- package/dist/components/TekWallet/theme/mui/components/overrides/Drawer.js +9 -0
- package/dist/components/TekWallet/theme/mui/components/overrides/Paper.d.ts +3 -0
- package/dist/components/TekWallet/theme/mui/components/overrides/Paper.js +15 -0
- package/dist/components/TekWallet/theme/mui/components/overrides/SnackBar.d.ts +3 -0
- package/dist/components/TekWallet/theme/mui/components/overrides/SnackBar.js +32 -0
- package/dist/components/TekWallet/theme/mui/fixed-mixins.d.ts +2 -0
- package/dist/components/TekWallet/theme/mui/fixed-mixins.js +218 -0
- package/dist/components/TekWallet/theme/mui/index.d.ts +3 -3
- package/dist/components/TekWallet/theme/mui/index.js +16 -32
- package/dist/components/TekWallet/theme/mui/palette.d.ts +34 -0
- package/dist/components/TekWallet/theme/mui/palette.js +133 -0
- package/dist/components/TekWallet/theme/mui/shadows/index.d.ts +3 -0
- package/dist/components/TekWallet/theme/mui/shadows/index.js +64 -0
- package/dist/components/TekWallet/theme/mui/spacing.d.ts +1 -0
- package/dist/components/TekWallet/theme/mui/spacing.js +5 -0
- package/dist/components/TekWallet/theme/mui/theme.d.ts +9 -442
- package/dist/components/TekWallet/theme/mui/theme.js +38 -415
- package/dist/components/TekWallet/theme/mui/type.d.ts +5 -0
- package/dist/components/TekWallet/theme/mui/type.js +9 -0
- package/dist/components/TekWallet/theme/mui/typography.d.ts +27 -0
- package/dist/components/TekWallet/theme/mui/typography.js +30 -0
- package/dist/components/TekWallet/theme/mui/utils/deepMergeTheme.d.ts +2 -0
- package/dist/components/TekWallet/theme/mui/utils/deepMergeTheme.js +7 -0
- package/dist/components/TekWallet/utils/getContractColor.d.ts +1 -0
- package/dist/components/TekWallet/utils/getContractColor.js +30 -0
- package/package.json +1 -1
- package/dist/components/TekWallet/components/ui/CardHistorySwap/index.d.ts +0 -12
- package/dist/components/TekWallet/components/ui/CardHistorySwap/index.js +0 -75
- package/dist/components/TekWallet/components/ui/DetailSwapResult/index.d.ts +0 -8
- package/dist/components/TekWallet/components/ui/DetailSwapResult/index.js +0 -122
- package/dist/components/TekWallet/components/ui/HistorySwap/index.d.ts +0 -16
- package/dist/components/TekWallet/components/ui/HistorySwap/index.js +0 -434
- package/dist/components/TekWallet/components/ui/SwapFunction/index.d.ts +0 -16
- package/dist/components/TekWallet/components/ui/SwapFunction/index.js +0 -271
- package/dist/components/TekWallet/components/ui/SwapToken/index.d.ts +0 -31
- package/dist/components/TekWallet/components/ui/SwapToken/index.js +0 -293
- package/dist/components/TekWallet/providers/ThemeProvider/index.d.ts +0 -8
- package/dist/components/TekWallet/providers/ThemeProvider/index.js +0 -43
- package/dist/components/TekWallet/theme/mui/deposit-fiat-theme/components.d.ts +0 -3
- package/dist/components/TekWallet/theme/mui/deposit-fiat-theme/components.js +0 -158
- package/dist/components/TekWallet/theme/mui/deposit-fiat-theme/palette.d.ts +0 -55
- package/dist/components/TekWallet/theme/mui/deposit-fiat-theme/palette.js +0 -45
- package/dist/components/TekWallet/theme/mui/deposit-fiat-theme/theme.d.ts +0 -2
- package/dist/components/TekWallet/theme/mui/deposit-fiat-theme/theme.js +0 -13
- package/dist/components/TekWallet/theme/mui/deposit-fiat-theme/typography.d.ts +0 -39
- package/dist/components/TekWallet/theme/mui/deposit-fiat-theme/typography.js +0 -65
|
@@ -0,0 +1,365 @@
|
|
|
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 __rest = (this && this.__rest) || function (s, e) {
|
|
15
|
+
var t = {};
|
|
16
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
17
|
+
t[p] = s[p];
|
|
18
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
19
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
20
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
21
|
+
t[p[i]] = s[p[i]];
|
|
22
|
+
}
|
|
23
|
+
return t;
|
|
24
|
+
};
|
|
25
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
26
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
|
+
};
|
|
28
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
+
exports.ReceiveDirectly = exports.ReceiveDirectlyMethod = void 0;
|
|
30
|
+
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
31
|
+
var react_1 = require("react");
|
|
32
|
+
var DrawerComponent_1 = __importDefault(require("../DrawerComponent"));
|
|
33
|
+
var SwiperControlled_1 = __importDefault(require("../SwiperControlled"));
|
|
34
|
+
var react_2 = require("swiper/react");
|
|
35
|
+
var useWalletData_1 = __importDefault(require("../../../hooks/useWalletData"));
|
|
36
|
+
var ModalLayout_1 = __importDefault(require("../ModalLayout"));
|
|
37
|
+
var QRCode_1 = __importDefault(require("../QRCode"));
|
|
38
|
+
var Text_1 = __importDefault(require("../Text"));
|
|
39
|
+
var material_1 = require("@mui/material");
|
|
40
|
+
var CopyTextComponent_1 = __importDefault(require("../CopyTextComponent"));
|
|
41
|
+
var Button_1 = __importDefault(require("../Button"));
|
|
42
|
+
var Icon_1 = __importDefault(require("../Icon"));
|
|
43
|
+
var NetworkSelection_1 = __importDefault(require("../NetworkSelection"));
|
|
44
|
+
var WaitingData_1 = __importDefault(require("../WaitingData"));
|
|
45
|
+
var EmptyData_1 = __importDefault(require("../EmptyData"));
|
|
46
|
+
var Formatter_1 = __importDefault(require("../Formatter"));
|
|
47
|
+
var CustomTooltip_1 = __importDefault(require("../CustomTooltip"));
|
|
48
|
+
var DialogContentLayout_1 = __importDefault(require("../DialogContentLayout"));
|
|
49
|
+
var mui_1 = require("../../../theme/mui");
|
|
50
|
+
var ChildPageLayout_1 = __importDefault(require("../../layouts/ChildPageLayout"));
|
|
51
|
+
var LineValue_1 = __importDefault(require("../LineValue"));
|
|
52
|
+
var SvgPath_1 = require("../SvgPath");
|
|
53
|
+
var useReceiveData_1 = __importDefault(require("../../../hooks/useReceiveData"));
|
|
54
|
+
var ReceiveDirectlyMethod;
|
|
55
|
+
(function (ReceiveDirectlyMethod) {
|
|
56
|
+
ReceiveDirectlyMethod["RECEIVE_INTERNAL"] = "Internal Transfer";
|
|
57
|
+
ReceiveDirectlyMethod["RECEIVE_EXTERNAL"] = "Blockchain Deposit";
|
|
58
|
+
})(ReceiveDirectlyMethod || (exports.ReceiveDirectlyMethod = ReceiveDirectlyMethod = {}));
|
|
59
|
+
var ReceiveDirectlyStep;
|
|
60
|
+
(function (ReceiveDirectlyStep) {
|
|
61
|
+
ReceiveDirectlyStep[ReceiveDirectlyStep["SELECT_NETWORK"] = 0] = "SELECT_NETWORK";
|
|
62
|
+
ReceiveDirectlyStep[ReceiveDirectlyStep["SHOW_QR_CODE"] = 1] = "SHOW_QR_CODE";
|
|
63
|
+
})(ReceiveDirectlyStep || (ReceiveDirectlyStep = {}));
|
|
64
|
+
exports.ReceiveDirectly = (0, react_1.forwardRef)(function (_a, ref) {
|
|
65
|
+
var tokenSlug = _a.tokenSlug, method = _a.method, networkSlug = _a.networkSlug, amount = _a.amount, userInfo = _a.userInfo, props = __rest(_a, ["tokenSlug", "method", "networkSlug", "amount", "userInfo"]);
|
|
66
|
+
var drawerRef = (0, react_1.useRef)(null);
|
|
67
|
+
var isInitPasscode = (0, useWalletData_1.default)().isInitPasscode;
|
|
68
|
+
var _b = (0, useReceiveData_1.default)(), receiveExternalTokens = _b.receiveExternalTokens, updateReceiveExternalToken = _b.updateReceiveExternalToken, receiveInternalTokens = _b.receiveInternalTokens, updateReceiveInternalToken = _b.updateReceiveInternalToken;
|
|
69
|
+
var swiperRef = (0, react_1.useRef)(null);
|
|
70
|
+
var learnMoreDrawerRef = (0, react_1.useRef)(null);
|
|
71
|
+
var theme = (0, mui_1.useTheme)();
|
|
72
|
+
var _c = (0, react_1.useState)(), selectedToken = _c[0], setSelectedToken = _c[1];
|
|
73
|
+
var _d = (0, react_1.useState)(), selectedNetwork = _d[0], setSelectedNetwork = _d[1];
|
|
74
|
+
var _e = (0, react_1.useState)(false), hasTokenError = _e[0], setHasTokenError = _e[1];
|
|
75
|
+
var _f = (0, react_1.useState)(false), hasNetworkError = _f[0], setHasNetworkError = _f[1];
|
|
76
|
+
var _g = (0, react_1.useState)(true), isLoading = _g[0], setIsLoading = _g[1];
|
|
77
|
+
var _h = (0, react_1.useState)(ReceiveDirectlyStep.SELECT_NETWORK), currentStep = _h[0], setCurrentStep = _h[1];
|
|
78
|
+
var _j = (0, react_1.useState)(true), shouldReinitialize = _j[0], setShouldReinitialize = _j[1];
|
|
79
|
+
var _k = (0, useWalletData_1.default)(), blockchainWallets = _k.blockchainWallets, masterWallet = _k.masterWallet;
|
|
80
|
+
var isInternal = (0, react_1.useMemo)(function () {
|
|
81
|
+
return method === ReceiveDirectlyMethod.RECEIVE_INTERNAL;
|
|
82
|
+
}, [method]);
|
|
83
|
+
var isExternal = (0, react_1.useMemo)(function () {
|
|
84
|
+
return method === ReceiveDirectlyMethod.RECEIVE_EXTERNAL;
|
|
85
|
+
}, [method]);
|
|
86
|
+
var receiveTokens = (0, react_1.useMemo)(function () {
|
|
87
|
+
if (isInternal) {
|
|
88
|
+
return receiveInternalTokens;
|
|
89
|
+
}
|
|
90
|
+
return receiveExternalTokens;
|
|
91
|
+
}, [isInternal, receiveExternalTokens, receiveInternalTokens]);
|
|
92
|
+
var networks = (0, react_1.useMemo)(function () {
|
|
93
|
+
if (!selectedToken) {
|
|
94
|
+
return [];
|
|
95
|
+
}
|
|
96
|
+
return selectedToken.network_data || [];
|
|
97
|
+
}, [selectedToken]);
|
|
98
|
+
var receiveAddress = (0, react_1.useMemo)(function () {
|
|
99
|
+
var _a;
|
|
100
|
+
if (!selectedToken) {
|
|
101
|
+
return undefined;
|
|
102
|
+
}
|
|
103
|
+
if (isInternal) {
|
|
104
|
+
return masterWallet;
|
|
105
|
+
}
|
|
106
|
+
return (_a = blockchainWallets === null || blockchainWallets === void 0 ? void 0 : blockchainWallets.find(function (item) { return item.networkSlug === (selectedNetwork === null || selectedNetwork === void 0 ? void 0 : selectedNetwork.slug); })) === null || _a === void 0 ? void 0 : _a.blockchainAddress;
|
|
107
|
+
}, [selectedToken, isInternal, blockchainWallets, masterWallet, selectedNetwork === null || selectedNetwork === void 0 ? void 0 : selectedNetwork.slug]);
|
|
108
|
+
var qrCodeValue = (0, react_1.useMemo)(function () {
|
|
109
|
+
var _a, _b, _c;
|
|
110
|
+
if (!receiveAddress || !selectedToken) {
|
|
111
|
+
return "";
|
|
112
|
+
}
|
|
113
|
+
if (isInternal) {
|
|
114
|
+
var tonTransferParamInternal = {
|
|
115
|
+
address: receiveAddress,
|
|
116
|
+
amount: +(amount || 0) * Math.pow(10, ((_a = selectedToken === null || selectedToken === void 0 ? void 0 : selectedToken.decimal) !== null && _a !== void 0 ? _a : 0)),
|
|
117
|
+
jetton: (_c = (_b = selectedToken === null || selectedToken === void 0 ? void 0 : selectedToken.network_data) === null || _b === void 0 ? void 0 : _b[0]) === null || _c === void 0 ? void 0 : _c.address,
|
|
118
|
+
isTekWalletReceiveInternal: true,
|
|
119
|
+
text: "",
|
|
120
|
+
bin: "",
|
|
121
|
+
init: "",
|
|
122
|
+
isDeepLinkFormat: false,
|
|
123
|
+
};
|
|
124
|
+
return JSON.stringify(tonTransferParamInternal);
|
|
125
|
+
}
|
|
126
|
+
return "".concat(receiveAddress);
|
|
127
|
+
}, [receiveAddress, selectedToken, isInternal, amount]);
|
|
128
|
+
var warningMessage = (0, react_1.useMemo)(function () {
|
|
129
|
+
if (isExternal && !amount) {
|
|
130
|
+
return ((0, jsx_runtime_1.jsxs)("div", { className: "w-full inline-block", children: ["Please send an amount between", " ", (0, jsx_runtime_1.jsxs)("strong", { style: { color: theme.palette.primary.main }, children: [(0, jsx_runtime_1.jsx)(Formatter_1.default, { value: selectedNetwork === null || selectedNetwork === void 0 ? void 0 : selectedNetwork.min_value }), " and", " ", (0, jsx_runtime_1.jsx)(Formatter_1.default, { value: selectedNetwork === null || selectedNetwork === void 0 ? void 0 : selectedNetwork.max_value, unit: " ".concat(selectedToken === null || selectedToken === void 0 ? void 0 : selectedToken.name) }), " "] }), " ", "and ensure you", " ", (0, jsx_runtime_1.jsx)("strong", { style: { color: theme.palette.primary.main }, children: "select the correct network" }), ", or your assets may be lost."] }));
|
|
131
|
+
}
|
|
132
|
+
if (isExternal && !!amount) {
|
|
133
|
+
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: ["Please ensure you", " ", (0, jsx_runtime_1.jsx)("strong", { style: { color: theme.palette.primary.main }, children: "select the correct network" }), ", or your assets may be lost."] }));
|
|
134
|
+
}
|
|
135
|
+
return null;
|
|
136
|
+
}, [
|
|
137
|
+
isExternal,
|
|
138
|
+
amount,
|
|
139
|
+
theme.palette.primary.main,
|
|
140
|
+
selectedNetwork === null || selectedNetwork === void 0 ? void 0 : selectedNetwork.min_value,
|
|
141
|
+
selectedNetwork === null || selectedNetwork === void 0 ? void 0 : selectedNetwork.max_value,
|
|
142
|
+
selectedToken === null || selectedToken === void 0 ? void 0 : selectedToken.name,
|
|
143
|
+
]);
|
|
144
|
+
var resetState = (0, react_1.useCallback)(function () {
|
|
145
|
+
setSelectedToken(undefined);
|
|
146
|
+
setSelectedNetwork(undefined);
|
|
147
|
+
setHasTokenError(false);
|
|
148
|
+
setHasNetworkError(false);
|
|
149
|
+
setIsLoading(true);
|
|
150
|
+
setCurrentStep(ReceiveDirectlyStep.SELECT_NETWORK);
|
|
151
|
+
setShouldReinitialize(true);
|
|
152
|
+
}, []);
|
|
153
|
+
var open = (0, react_1.useCallback)(function () {
|
|
154
|
+
var _a;
|
|
155
|
+
setShouldReinitialize(true);
|
|
156
|
+
(_a = drawerRef.current) === null || _a === void 0 ? void 0 : _a.open();
|
|
157
|
+
}, []);
|
|
158
|
+
var close = (0, react_1.useCallback)(function () {
|
|
159
|
+
var _a;
|
|
160
|
+
(_a = drawerRef.current) === null || _a === void 0 ? void 0 : _a.close();
|
|
161
|
+
}, []);
|
|
162
|
+
var handleClose = (0, react_1.useCallback)(function () {
|
|
163
|
+
resetState();
|
|
164
|
+
}, [resetState]);
|
|
165
|
+
(0, react_1.useImperativeHandle)(ref, function () { return ({
|
|
166
|
+
open: open,
|
|
167
|
+
close: close,
|
|
168
|
+
}); });
|
|
169
|
+
(0, react_1.useEffect)(function () {
|
|
170
|
+
if (isInitPasscode && !receiveExternalTokens) {
|
|
171
|
+
updateReceiveExternalToken();
|
|
172
|
+
}
|
|
173
|
+
if (isInitPasscode && !receiveInternalTokens) {
|
|
174
|
+
updateReceiveInternalToken();
|
|
175
|
+
}
|
|
176
|
+
}, [
|
|
177
|
+
isInitPasscode,
|
|
178
|
+
receiveExternalTokens,
|
|
179
|
+
receiveInternalTokens,
|
|
180
|
+
updateReceiveExternalToken,
|
|
181
|
+
updateReceiveInternalToken,
|
|
182
|
+
]);
|
|
183
|
+
var gotoStep = (0, react_1.useCallback)(function (step) {
|
|
184
|
+
var _a;
|
|
185
|
+
setCurrentStep(step);
|
|
186
|
+
(_a = swiperRef.current) === null || _a === void 0 ? void 0 : _a.slideTo(step);
|
|
187
|
+
}, []);
|
|
188
|
+
var handleSelectNetwork = (0, react_1.useCallback)(function (network) {
|
|
189
|
+
setSelectedNetwork(network);
|
|
190
|
+
gotoStep(ReceiveDirectlyStep.SHOW_QR_CODE);
|
|
191
|
+
}, [gotoStep]);
|
|
192
|
+
// Validate and load token when component mounts or data changes
|
|
193
|
+
(0, react_1.useEffect)(function () {
|
|
194
|
+
// Only run when shouldReinitialize is true
|
|
195
|
+
if (!shouldReinitialize) {
|
|
196
|
+
return;
|
|
197
|
+
}
|
|
198
|
+
if (!receiveTokens) {
|
|
199
|
+
setIsLoading(true);
|
|
200
|
+
// Don't reset shouldReinitialize here, wait for data to come
|
|
201
|
+
return;
|
|
202
|
+
}
|
|
203
|
+
setIsLoading(false);
|
|
204
|
+
// Find token by slug
|
|
205
|
+
var foundToken = receiveTokens === null || receiveTokens === void 0 ? void 0 : receiveTokens.find(function (item) { return item.slug === tokenSlug; });
|
|
206
|
+
if (!foundToken) {
|
|
207
|
+
// Token not found - show error
|
|
208
|
+
setHasTokenError(true);
|
|
209
|
+
setHasNetworkError(false);
|
|
210
|
+
setSelectedToken(undefined);
|
|
211
|
+
setShouldReinitialize(false);
|
|
212
|
+
return;
|
|
213
|
+
}
|
|
214
|
+
// Token found - set it
|
|
215
|
+
setSelectedToken(foundToken);
|
|
216
|
+
setHasTokenError(false);
|
|
217
|
+
// For internal method, no need to check network
|
|
218
|
+
if (isInternal) {
|
|
219
|
+
setHasNetworkError(false);
|
|
220
|
+
gotoStep(ReceiveDirectlyStep.SHOW_QR_CODE);
|
|
221
|
+
setShouldReinitialize(false);
|
|
222
|
+
return;
|
|
223
|
+
}
|
|
224
|
+
// For external method, check networks
|
|
225
|
+
var tokenNetworks = foundToken.network_data;
|
|
226
|
+
if (!tokenNetworks || tokenNetworks.length === 0) {
|
|
227
|
+
// No networks available - show error
|
|
228
|
+
setHasNetworkError(true);
|
|
229
|
+
gotoStep(ReceiveDirectlyStep.SHOW_QR_CODE);
|
|
230
|
+
setShouldReinitialize(false);
|
|
231
|
+
return;
|
|
232
|
+
}
|
|
233
|
+
// Find network by slug or use first available
|
|
234
|
+
if (networkSlug) {
|
|
235
|
+
var foundNetwork = tokenNetworks.find(function (item) { return item.slug === networkSlug; });
|
|
236
|
+
if (foundNetwork) {
|
|
237
|
+
setSelectedNetwork(foundNetwork);
|
|
238
|
+
setHasNetworkError(false);
|
|
239
|
+
gotoStep(ReceiveDirectlyStep.SHOW_QR_CODE);
|
|
240
|
+
}
|
|
241
|
+
else {
|
|
242
|
+
// Network slug provided but not found
|
|
243
|
+
setHasNetworkError(true);
|
|
244
|
+
gotoStep(ReceiveDirectlyStep.SHOW_QR_CODE);
|
|
245
|
+
}
|
|
246
|
+
}
|
|
247
|
+
else {
|
|
248
|
+
// No network slug provided - show network selection first
|
|
249
|
+
setHasNetworkError(false);
|
|
250
|
+
setSelectedNetwork(undefined);
|
|
251
|
+
gotoStep(ReceiveDirectlyStep.SELECT_NETWORK);
|
|
252
|
+
}
|
|
253
|
+
setShouldReinitialize(false);
|
|
254
|
+
}, [tokenSlug, networkSlug, isInternal, receiveTokens, gotoStep, shouldReinitialize]);
|
|
255
|
+
var renderContent = function () {
|
|
256
|
+
// Loading state
|
|
257
|
+
if (isLoading) {
|
|
258
|
+
return ((0, jsx_runtime_1.jsx)(material_1.Box, { sx: {
|
|
259
|
+
display: "flex",
|
|
260
|
+
flexDirection: "column",
|
|
261
|
+
alignItems: "center",
|
|
262
|
+
justifyContent: "center",
|
|
263
|
+
minHeight: "400px",
|
|
264
|
+
}, children: (0, jsx_runtime_1.jsx)(WaitingData_1.default, {}) }));
|
|
265
|
+
}
|
|
266
|
+
// Error states
|
|
267
|
+
if (hasTokenError) {
|
|
268
|
+
return ((0, jsx_runtime_1.jsx)(material_1.Box, { sx: {
|
|
269
|
+
display: "flex",
|
|
270
|
+
flexDirection: "column",
|
|
271
|
+
alignItems: "center",
|
|
272
|
+
justifyContent: "center",
|
|
273
|
+
minHeight: "400px",
|
|
274
|
+
gap: theme.styleMixins.gaps.g16,
|
|
275
|
+
}, children: (0, jsx_runtime_1.jsx)(EmptyData_1.default, { title: "Invalid Token", description: "Token \"".concat(tokenSlug, "\" does not exist or is not supported for ").concat(isInternal ? "internal transfer" : "blockchain deposit", " method.") }) }));
|
|
276
|
+
}
|
|
277
|
+
if (hasNetworkError) {
|
|
278
|
+
return ((0, jsx_runtime_1.jsx)(material_1.Box, { sx: {
|
|
279
|
+
display: "flex",
|
|
280
|
+
flexDirection: "column",
|
|
281
|
+
alignItems: "center",
|
|
282
|
+
justifyContent: "center",
|
|
283
|
+
minHeight: "400px",
|
|
284
|
+
gap: theme.styleMixins.gaps.g16,
|
|
285
|
+
}, children: (0, jsx_runtime_1.jsx)(EmptyData_1.default, { title: "Network Unavailable", description: "Token \"".concat(selectedToken === null || selectedToken === void 0 ? void 0 : selectedToken.name, "\" has no available networks").concat(networkSlug ? " or network \"".concat(networkSlug, "\" is not supported") : "", ".") }) }));
|
|
286
|
+
}
|
|
287
|
+
// Success - Show QR code
|
|
288
|
+
return ((0, jsx_runtime_1.jsx)(material_1.Box, { sx: {
|
|
289
|
+
display: "flex",
|
|
290
|
+
flexDirection: "column",
|
|
291
|
+
gap: theme.styleMixins.gaps.g16,
|
|
292
|
+
}, 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.styleMixins.column), { gap: theme.styleMixins.gaps.g12, backgroundColor: theme.palette.background.tertiary, borderRadius: theme.styleMixins.customRadius.r16, padding: theme.styleMixins.customPadding.p16, paddingTop: "5rem", alignItems: "flex-start", position: "relative", marginTop: "4.6875rem" }), children: [(0, jsx_runtime_1.jsx)(material_1.Divider, { sx: {
|
|
293
|
+
color: theme.palette.divider,
|
|
294
|
+
width: "100%",
|
|
295
|
+
} }), (0, jsx_runtime_1.jsxs)(material_1.Box, { sx: __assign(__assign({}, theme.styleMixins.center), { top: 0, width: "fit-content", height: "fit-content", borderRadius: theme.styleMixins.customRadius.r12, padding: theme.styleMixins.customPadding.p8 }), children: [(0, jsx_runtime_1.jsx)(QRCode_1.default, { value: qrCodeValue, logo: selectedToken === null || selectedToken === void 0 ? void 0 : selectedToken.link, bgColor: "transparent", size: 150 }), (0, jsx_runtime_1.jsx)(material_1.Box, { sx: __assign(__assign({}, theme.styleMixins.center), { padding: theme.styleMixins.customPadding.p4, borderRadius: 9999, backgroundColor: theme.palette.background.default }), children: (0, jsx_runtime_1.jsx)(Icon_1.default, { crossOrigin: "anonymous", src: selectedToken === null || selectedToken === void 0 ? void 0 : selectedToken.link, sx: {
|
|
296
|
+
borderRadius: 9999,
|
|
297
|
+
width: 24,
|
|
298
|
+
height: 24,
|
|
299
|
+
} }) })] }), isExternal && ((0, jsx_runtime_1.jsxs)(material_1.Box, { sx: __assign(__assign({}, theme.styleMixins.column), { gap: theme.styleMixins.gaps.g4 }), children: [(0, jsx_runtime_1.jsx)(Text_1.default, { sx: __assign({}, theme.styleMixins.valueDescription), children: "Network" }), (0, jsx_runtime_1.jsxs)(material_1.Box, { sx: __assign({}, theme.styleMixins.row), onClick: function () { return gotoStep(ReceiveDirectlyStep.SELECT_NETWORK); }, children: [(0, jsx_runtime_1.jsxs)(material_1.Box, { component: "button", sx: __assign(__assign({}, theme.styleMixins.row), { gap: theme.styleMixins.gaps.g4, cursor: "pointer", transition: "transform 0.3s ease-in-out", "&:active": {
|
|
300
|
+
transform: "translateX(0.5rem)",
|
|
301
|
+
} }), children: [(0, jsx_runtime_1.jsx)(Icon_1.default, { width: 24, height: 24, sx: {
|
|
302
|
+
borderRadius: "9999px",
|
|
303
|
+
}, src: selectedNetwork === null || selectedNetwork === void 0 ? void 0 : selectedNetwork.link }), (0, jsx_runtime_1.jsx)(Text_1.default, { sx: __assign({}, theme.styleMixins.value), children: selectedNetwork === null || selectedNetwork === void 0 ? void 0 : selectedNetwork.name })] }), (0, jsx_runtime_1.jsx)(material_1.SvgIcon, { sx: {
|
|
304
|
+
width: 12,
|
|
305
|
+
height: 12,
|
|
306
|
+
ml: "auto",
|
|
307
|
+
transform: "rotate(90deg)",
|
|
308
|
+
}, children: SvgPath_1.IC_CHEVRON_RIGHT })] })] })), (0, jsx_runtime_1.jsxs)(material_1.Box, { sx: __assign(__assign({}, theme.styleMixins.column), { gap: theme.styleMixins.gaps.g4 }), children: [(0, jsx_runtime_1.jsxs)(material_1.Box, { sx: __assign(__assign({}, theme.styleMixins.row), { gap: theme.styleMixins.gaps.g4, color: theme.palette.text.secondary }), children: [(0, jsx_runtime_1.jsx)(Text_1.default, { sx: __assign(__assign({}, theme.styleMixins.valueDescription), { color: "inherit" }), children: isInternal ? "Internal Address" : "Address" }), isInternal && ((0, jsx_runtime_1.jsx)(CustomTooltip_1.default, { trigger: (0, jsx_runtime_1.jsx)(material_1.SvgIcon, { sx: { width: 16, height: 16, mb: "3px" }, children: SvgPath_1.IC_TOOLTIP }), children: (0, jsx_runtime_1.jsx)(DialogContentLayout_1.default, { content: (0, jsx_runtime_1.jsxs)(Text_1.default, { sx: __assign({}, theme.styleMixins.warning), children: ["This address is used to receive tokens via internal transfer. You cannot use it for blockchain transactions. If you want to receive tokens via blockchain, please select the ", (0, jsx_runtime_1.jsx)("strong", { children: "Blockchain Deposit" }), " method instead."] }) }) }))] }), (0, jsx_runtime_1.jsxs)(CopyTextComponent_1.default, { sx: __assign(__assign({}, theme.styleMixins.row), { justifyContent: "space-between" }), value: receiveAddress || "", children: [(0, jsx_runtime_1.jsx)(Text_1.default, { sx: __assign(__assign({}, theme.styleMixins.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 })] })] }), (!!userInfo || !!amount || isExternal || !!warningMessage) && ((0, jsx_runtime_1.jsx)(material_1.Divider, { sx: {
|
|
309
|
+
color: theme.palette.divider,
|
|
310
|
+
width: "100%",
|
|
311
|
+
} })), (0, jsx_runtime_1.jsxs)(material_1.Box, { sx: __assign(__assign({ width: "100%" }, theme.styleMixins.column), { gap: theme.styleMixins.gaps.g12 }), children: [!!userInfo && ((0, jsx_runtime_1.jsx)(LineValue_1.default, { sx: {
|
|
312
|
+
alignItems: "start",
|
|
313
|
+
}, field: (0, jsx_runtime_1.jsx)(Text_1.default, { sx: __assign(__assign({}, theme.styleMixins.valueDescription), { color: theme.palette.text.secondary, fontSize: theme.typography.fontSize13 }), children: "Recipient" }), value: (0, jsx_runtime_1.jsxs)(material_1.Box, { sx: __assign(__assign({}, theme.styleMixins.row), { gap: theme.styleMixins.gaps.g4 }), children: [(0, jsx_runtime_1.jsx)(Icon_1.default, { width: 16, height: 16, src: userInfo === null || userInfo === void 0 ? void 0 : userInfo.avatar, sx: {
|
|
314
|
+
borderRadius: "9999px",
|
|
315
|
+
} }), (0, jsx_runtime_1.jsx)(material_1.Box, { sx: __assign(__assign({}, theme.styleMixins.column), { gap: theme.styleMixins.gaps.g2 }), children: (0, jsx_runtime_1.jsxs)(Text_1.default, { children: [userInfo === null || userInfo === void 0 ? void 0 : userInfo.nickname, " "] }) })] }), valueDescription: (0, jsx_runtime_1.jsx)(Text_1.default, { children: userInfo === null || userInfo === void 0 ? void 0 : userInfo.username }) })), !!amount && ((0, jsx_runtime_1.jsx)(LineValue_1.default, { field: (0, jsx_runtime_1.jsx)(Text_1.default, { sx: __assign(__assign({}, theme.styleMixins.valueDescription), { color: theme.palette.text.secondary, fontSize: theme.typography.fontSize13 }), children: "Amount" }), value: (0, jsx_runtime_1.jsx)(Text_1.default, { sx: __assign(__assign({}, theme.styleMixins.value), { fontSize: theme.typography.fontSize13 }), children: (0, jsx_runtime_1.jsx)(Formatter_1.default, { value: amount, unit: " ".concat(selectedToken === null || selectedToken === void 0 ? void 0 : selectedToken.name) }) }) })), isExternal && ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(LineValue_1.default, { field: (0, jsx_runtime_1.jsx)(Text_1.default, { sx: __assign(__assign({}, theme.styleMixins.valueDescription), { color: theme.palette.text.secondary, fontSize: theme.typography.fontSize13 }), children: "Deposit Time" }), value: (0, jsx_runtime_1.jsx)(Text_1.default, { sx: __assign(__assign({}, theme.styleMixins.value), { fontSize: theme.typography.fontSize13 }), children: "~ 2 Minutes" }) }), (0, jsx_runtime_1.jsx)(LineValue_1.default, { field: (0, jsx_runtime_1.jsx)(Text_1.default, { sx: __assign(__assign({}, theme.styleMixins.valueDescription), { color: theme.palette.text.secondary, fontSize: theme.typography.fontSize13 }), children: "Withdrawal Time" }), value: (0, jsx_runtime_1.jsx)(Text_1.default, { sx: __assign(__assign({}, theme.styleMixins.value), { fontSize: theme.typography.fontSize13 }), children: "~ 4 Minutes" }) })] }))] }), !!warningMessage && ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(material_1.Divider, { sx: {
|
|
316
|
+
color: theme.palette.divider,
|
|
317
|
+
width: "100%",
|
|
318
|
+
mt: theme.styleMixins.customMargin.m12,
|
|
319
|
+
} }), (0, jsx_runtime_1.jsx)(Text_1.default, { sx: __assign({}, theme.styleMixins.valueDescription), children: warningMessage })] }))] }) }) }));
|
|
320
|
+
};
|
|
321
|
+
return ((0, jsx_runtime_1.jsx)(DrawerComponent_1.default, { ref: drawerRef, trigger: props.children, sx: props.sx, onDone: handleClose, children: (0, jsx_runtime_1.jsx)(ModalLayout_1.default, { title: "Receive ".concat((selectedToken === null || selectedToken === void 0 ? void 0 : selectedToken.name) || "Token"), onClose: close, children: (0, jsx_runtime_1.jsx)(ChildPageLayout_1.default, { footer: (0, jsx_runtime_1.jsx)(material_1.Box, { sx: {
|
|
322
|
+
maxHeight: currentStep === ReceiveDirectlyStep.SHOW_QR_CODE ? "120px" : 0,
|
|
323
|
+
overflow: "hidden",
|
|
324
|
+
transition: currentStep === ReceiveDirectlyStep.SHOW_QR_CODE
|
|
325
|
+
? "max-height 0.3s linear 0.3s"
|
|
326
|
+
: "max-height 0s linear",
|
|
327
|
+
}, children: !hasTokenError && !hasNetworkError && selectedNetwork && ((0, jsx_runtime_1.jsx)(Button_1.default.Primary, { onClick: close, fullWidth: true, sx: { mt: theme.styleMixins.customMargin.m16 }, children: "Done" })) }), children: (0, jsx_runtime_1.jsxs)(SwiperControlled_1.default, { ref: swiperRef, swiperProps: {
|
|
328
|
+
spaceBetween: 32,
|
|
329
|
+
}, disableSwipe: true, initialActiveTab: currentStep, sx: {
|
|
330
|
+
height: "100%",
|
|
331
|
+
}, swiperStyle: {
|
|
332
|
+
height: "100%",
|
|
333
|
+
overflowY: "hidden",
|
|
334
|
+
}, children: [(0, jsx_runtime_1.jsx)(react_2.SwiperSlide, { style: {
|
|
335
|
+
height: "100%",
|
|
336
|
+
overflow: "hidden",
|
|
337
|
+
}, children: (0, jsx_runtime_1.jsx)(ChildPageLayout_1.default, { children: (0, jsx_runtime_1.jsxs)(material_1.Box, { sx: __assign(__assign({}, theme.styleMixins.column), { gap: theme.styleMixins.gaps.g12 }), children: [(isLoading || !selectedToken) && ((0, jsx_runtime_1.jsx)(WaitingData_1.default, { numberOfSkeleton: 3, sx: {
|
|
338
|
+
py: theme.styleMixins.customPadding.p16,
|
|
339
|
+
} })), !isLoading && selectedToken && (networks === null || networks === void 0 ? void 0 : networks.length) > 0 && ((0, jsx_runtime_1.jsxs)(material_1.Box, { sx: __assign(__assign({}, theme.styleMixins.paper), { borderRadius: theme.styleMixins.customRadius.r16, background: theme.palette.background.secondary, gap: theme.styleMixins.gaps.g2 }), children: [(0, jsx_runtime_1.jsx)(Text_1.default, { sx: __assign(__assign({}, theme.styleMixins.fieldTitle), { fontWeight: theme.typography.fontWeight700, color: theme.palette.text.primary }), children: "Choosing a network? Let us help!" }), (0, jsx_runtime_1.jsx)(Text_1.default, { sx: __assign(__assign({}, theme.styleMixins.activityDescription), { color: theme.palette.text.secondary, fontWeight: theme.typography.fontWeight500 }), children: "Select the network used by your sending platform." }), (0, jsx_runtime_1.jsx)(DrawerComponent_1.default, { ref: learnMoreDrawerRef, sx: {
|
|
340
|
+
mt: 0.25,
|
|
341
|
+
}, trigger: (0, jsx_runtime_1.jsxs)(material_1.Stack, { direction: "row", gap: 0.125, alignItems: "center", sx: { color: theme.palette.primary.main, width: "fit-content" }, children: [(0, jsx_runtime_1.jsx)(Text_1.default, { component: "div", sx: {
|
|
342
|
+
fontWeight: theme.typography.fontWeight600,
|
|
343
|
+
fontSize: theme.typography.fontSize10,
|
|
344
|
+
lineHeight: "100%",
|
|
345
|
+
}, children: "Learn more" }), (0, jsx_runtime_1.jsx)(material_1.SvgIcon, { sx: { width: 6, height: 6, mt: "4px" }, children: (0, jsx_runtime_1.jsx)("svg", { width: "4", height: "6", viewBox: "0 0 4 6", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: (0, jsx_runtime_1.jsx)("path", { d: "M3.7 3L0.7 6L0 5.3L2.3 3L0 0.7L0.7 0L3.7 3Z", fill: "currentColor" }) }) })] }), children: (0, jsx_runtime_1.jsx)(ModalLayout_1.default, { title: "How to choose my deposit network?", onClose: function () { var _a; return (_a = learnMoreDrawerRef.current) === null || _a === void 0 ? void 0 : _a.close(); }, 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.jsx)(Text_1.default, { component: "div", sx: __assign(__assign({}, theme.styleMixins.listDescription), { color: theme.palette.text.primary }), children: "When depositing, choose the same network as the one used on the sending platform. For example, if transferring funds using BSC network, select BSC for deposit. Otherwise, you may risk losing your assets." }), (0, jsx_runtime_1.jsx)(Text_1.default, { component: "div", sx: __assign(__assign({}, theme.styleMixins.listDescription), { color: theme.palette.text.primary }), children: "If unsure, test with a small amount and confirm it arrives safely before depositing the rest." })] }) }) })] })), !isLoading &&
|
|
346
|
+
selectedToken &&
|
|
347
|
+
(networks === null || networks === void 0 ? void 0 : networks.map(function (item, index) {
|
|
348
|
+
if (!item)
|
|
349
|
+
return null;
|
|
350
|
+
return ((0, jsx_runtime_1.jsx)(NetworkSelection_1.default, { onClick: handleSelectNetwork, networkData: JSON.stringify(item), active: (selectedNetwork === null || selectedNetwork === void 0 ? void 0 : selectedNetwork.id) === item.id, token: selectedToken }, "network_".concat(item.id, "_").concat(index)));
|
|
351
|
+
}))] }) }) }, "slide_step_".concat(ReceiveDirectlyStep.SELECT_NETWORK)), (0, jsx_runtime_1.jsx)(react_2.SwiperSlide, { style: {
|
|
352
|
+
height: "100%",
|
|
353
|
+
overflow: "hidden",
|
|
354
|
+
}, children: (0, jsx_runtime_1.jsx)(ChildPageLayout_1.default
|
|
355
|
+
// header={
|
|
356
|
+
// isExternal &&
|
|
357
|
+
// !networkSlug &&
|
|
358
|
+
// currentStep === ReceiveDirectlyStep.SHOW_QR_CODE && (
|
|
359
|
+
// <PageHeader title="" overrideBack={handleBack} />
|
|
360
|
+
// )
|
|
361
|
+
// }
|
|
362
|
+
, { children: renderContent() }) }, "slide_step_".concat(ReceiveDirectlyStep.SHOW_QR_CODE))] }) }) }) }));
|
|
363
|
+
});
|
|
364
|
+
exports.ReceiveDirectly.displayName = "ReceiveDirectly";
|
|
365
|
+
exports.default = exports.ReceiveDirectly;
|
|
@@ -25,7 +25,7 @@ var Text_1 = __importDefault(require("../../Text"));
|
|
|
25
25
|
var ChildPageLayout_1 = __importDefault(require("../../../layouts/ChildPageLayout"));
|
|
26
26
|
var PageHeader_1 = __importDefault(require("../../PageHeader"));
|
|
27
27
|
var DefaultPageLayout_1 = __importDefault(require("../../../layouts/DefaultPageLayout"));
|
|
28
|
-
var
|
|
28
|
+
var mui_1 = require("../../../../theme/mui");
|
|
29
29
|
var accordionData = [
|
|
30
30
|
{
|
|
31
31
|
id: "panel1",
|
|
@@ -50,7 +50,7 @@ var HelpView = function (_a) {
|
|
|
50
50
|
onBack === null || onBack === void 0 ? void 0 : onBack();
|
|
51
51
|
handleChange("panel1");
|
|
52
52
|
};
|
|
53
|
-
var theme = (0,
|
|
53
|
+
var theme = (0, mui_1.useTheme)();
|
|
54
54
|
return ((0, jsx_runtime_1.jsx)(ChildPageLayout_1.default, { header: (0, jsx_runtime_1.jsx)(PageHeader_1.default, { title: "Help", overrideBack: handleBack }), children: (0, jsx_runtime_1.jsx)(DefaultPageLayout_1.default, { sx: { paddingTop: "0px" }, children: (0, jsx_runtime_1.jsx)(material_1.Box, { children: accordionData.map(function (_a, index) {
|
|
55
55
|
var id = _a.id, title = _a.title;
|
|
56
56
|
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [index !== 0 && (0, jsx_runtime_1.jsx)(material_1.Divider, {}, "divider-".concat(id)), (0, jsx_runtime_1.jsxs)(Accordion_1.default, { expanded: expanded === id, onChange: handleChange(id), sx: {
|
|
@@ -66,7 +66,7 @@ var HelpView = function (_a) {
|
|
|
66
66
|
},
|
|
67
67
|
}, children: [(0, jsx_runtime_1.jsx)(AccordionSummary_1.default, { sx: {
|
|
68
68
|
padding: "0px",
|
|
69
|
-
py: theme.
|
|
69
|
+
py: theme.styleMixins.customPadding.p16,
|
|
70
70
|
minHeight: "0 !important",
|
|
71
71
|
"&.Mui-expanded": {
|
|
72
72
|
minHeight: "0 !important",
|
|
@@ -74,7 +74,7 @@ var HelpView = function (_a) {
|
|
|
74
74
|
"& .MuiAccordionSummary-content": {
|
|
75
75
|
my: "0 !important",
|
|
76
76
|
},
|
|
77
|
-
}, expandIcon: (0, jsx_runtime_1.jsx)(material_1.SvgIcon, { sx: { width: 10, height: "auto" }, children: (0, jsx_runtime_1.jsx)("svg", { width: "6", height: "4", viewBox: "0 0 6 4", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: (0, jsx_runtime_1.jsx)("path", { d: "M3 3.85039L0 0.850391L0.7 0.150391L3 2.45039L5.3 0.150391L6 0.850391L3 3.85039Z", fill: "#121212" }) }) }), children: (0, jsx_runtime_1.jsx)(Text_1.default, { component: "p", color: "contrast", children: title }) }), (0, jsx_runtime_1.jsx)(AccordionDetails_1.default, { sx: { padding: "0px", my: "0px" }, children: (0, jsx_runtime_1.jsxs)(Text_1.default, { sx: __assign({}, theme.
|
|
77
|
+
}, expandIcon: (0, jsx_runtime_1.jsx)(material_1.SvgIcon, { sx: { width: 10, height: "auto" }, children: (0, jsx_runtime_1.jsx)("svg", { width: "6", height: "4", viewBox: "0 0 6 4", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: (0, jsx_runtime_1.jsx)("path", { d: "M3 3.85039L0 0.850391L0.7 0.150391L3 2.45039L5.3 0.150391L6 0.850391L3 3.85039Z", fill: "#121212" }) }) }), children: (0, jsx_runtime_1.jsx)(Text_1.default, { component: "p", color: "contrast", children: title }) }), (0, jsx_runtime_1.jsx)(AccordionDetails_1.default, { sx: { padding: "0px", my: "0px" }, children: (0, jsx_runtime_1.jsxs)(Text_1.default, { sx: __assign({}, theme.styleMixins.listDescription), children: [(0, jsx_runtime_1.jsx)("p", { children: "Lorem ipsum dolor sit amet consectetur. Vitae faucibus ornare lectus arcu sit sed et. Eu integer pharetra posuere lobortis varius dapibus risus. Eget viverra quis facilisis velit mattis. Risus sed egestas vitae ridiculus odio sit eu adipiscing." }), (0, jsx_runtime_1.jsx)("p", { children: "Id pulvinar aliquam quam ut sed ut pharetra turpis ipsum. Condimentum eget a interdum neque sagittis lobortis proin nisi." })] }) })] }, id)] }));
|
|
78
78
|
}) }) }) }));
|
|
79
79
|
};
|
|
80
80
|
exports.default = HelpView;
|
|
@@ -37,8 +37,8 @@ exports.SortByType = void 0;
|
|
|
37
37
|
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
38
38
|
var material_1 = require("@mui/material");
|
|
39
39
|
var SortTool_1 = __importStar(require("./SortTool"));
|
|
40
|
-
var providers_1 = require("../../../../providers");
|
|
41
40
|
var react_1 = require("react");
|
|
41
|
+
var mui_1 = require("../../../../theme/mui");
|
|
42
42
|
var SortByType;
|
|
43
43
|
(function (SortByType) {
|
|
44
44
|
SortByType["Name"] = "Name";
|
|
@@ -46,7 +46,7 @@ var SortByType;
|
|
|
46
46
|
})(SortByType || (exports.SortByType = SortByType = {}));
|
|
47
47
|
function SortGroup(props) {
|
|
48
48
|
var onChange = props.onChange;
|
|
49
|
-
var theme = (0,
|
|
49
|
+
var theme = (0, mui_1.useTheme)();
|
|
50
50
|
var _a = (0, react_1.useState)(SortByType.Name), sortBy = _a[0], setSortBy = _a[1];
|
|
51
51
|
var _b = (0, react_1.useState)(SortTool_1.SortOrder.ASC), sortOrder = _b[0], setSortOrder = _b[1];
|
|
52
52
|
var handleChangeSortBy = function (sortBy, sortOrder) {
|
|
@@ -56,9 +56,9 @@ function SortGroup(props) {
|
|
|
56
56
|
onChange === null || onChange === void 0 ? void 0 : onChange(sortByValue, sortOrder);
|
|
57
57
|
};
|
|
58
58
|
return ((0, jsx_runtime_1.jsx)(material_1.Box, { sx: {
|
|
59
|
-
display: theme.
|
|
59
|
+
display: theme.styleMixins.row,
|
|
60
60
|
justifyContent: "space-between",
|
|
61
|
-
mt: theme.
|
|
61
|
+
mt: theme.styleMixins.customMargin.m16,
|
|
62
62
|
}, children: Object.values(SortByType).map(function (type) { return ((0, jsx_runtime_1.jsx)(SortTool_1.default, { name: type, onChange: handleChangeSortBy, value: sortBy === type ? sortOrder : undefined }, type)); }) }));
|
|
63
63
|
}
|
|
64
64
|
exports.default = SortGroup;
|
|
@@ -19,8 +19,8 @@ exports.default = SortTool;
|
|
|
19
19
|
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
20
20
|
var material_1 = require("@mui/material");
|
|
21
21
|
var Text_1 = __importDefault(require("../../Text"));
|
|
22
|
-
var
|
|
23
|
-
var
|
|
22
|
+
var mui_1 = require("../../../../theme/mui");
|
|
23
|
+
var Icon_1 = __importDefault(require("../../Icon"));
|
|
24
24
|
var SortOrder;
|
|
25
25
|
(function (SortOrder) {
|
|
26
26
|
SortOrder["ASC"] = "asc";
|
|
@@ -28,7 +28,7 @@ var SortOrder;
|
|
|
28
28
|
})(SortOrder || (exports.SortOrder = SortOrder = {}));
|
|
29
29
|
function SortTool(props) {
|
|
30
30
|
var value = props.value, onChange = props.onChange, name = props.name;
|
|
31
|
-
var theme = (0,
|
|
31
|
+
var theme = (0, mui_1.useTheme)();
|
|
32
32
|
var handleChangeSortOrder = function () {
|
|
33
33
|
if (value === SortOrder.ASC) {
|
|
34
34
|
onChange === null || onChange === void 0 ? void 0 : onChange(name, SortOrder.DESC);
|
|
@@ -37,15 +37,10 @@ function SortTool(props) {
|
|
|
37
37
|
onChange === null || onChange === void 0 ? void 0 : onChange(name, SortOrder.ASC);
|
|
38
38
|
}
|
|
39
39
|
};
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
height: 5,
|
|
43
|
-
transition: "opacity 0.2s ease-in-out",
|
|
40
|
+
var isUsed = value === SortOrder.ASC || value === SortOrder.DESC;
|
|
41
|
+
return ((0, jsx_runtime_1.jsxs)(material_1.Stack, { direction: "row", alignItems: "center", gap: 0.5, onClick: handleChangeSortOrder, sx: { color: isUsed ? theme.palette.action.active : theme.palette.action.disabled }, children: [(0, jsx_runtime_1.jsx)(Text_1.default, { sx: __assign(__assign({}, theme.styleMixins.valueDescription), { color: "inherit", fontWeight: theme.typography.fontWeight600 }), children: name }), (0, jsx_runtime_1.jsxs)(material_1.Box, { className: "flex flex-col gap-[0.8px] text-inherit", children: [(0, jsx_runtime_1.jsx)(Icon_1.default, { width: 8, height: 5, iconKey: "ARROW_DROP_UP", sx: {
|
|
44
42
|
opacity: value === SortOrder.ASC ? 0.8 : 0.5,
|
|
45
|
-
}
|
|
46
|
-
width: 8,
|
|
47
|
-
height: 5,
|
|
48
|
-
transition: "opacity 0.2s ease-in-out",
|
|
43
|
+
} }), (0, jsx_runtime_1.jsx)(Icon_1.default, { width: 8, height: 5, iconKey: "ARROW_DROP_DOWN", sx: {
|
|
49
44
|
opacity: value === SortOrder.DESC ? 0.8 : 0.5,
|
|
50
|
-
}
|
|
45
|
+
} })] })] }));
|
|
51
46
|
}
|