tek-wallet 0.0.737 → 0.0.738
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/Button/index.js +1 -1
- package/dist/components/TekWallet/components/ui/ConfirmByPasscode/index.js +23 -31
- package/dist/components/TekWallet/components/ui/EmptyData/index.js +1 -2
- package/dist/components/TekWallet/components/ui/FiatDeposit/components/shareAction.d.ts +8 -0
- package/dist/components/TekWallet/components/ui/FiatDeposit/components/shareAction.js +149 -0
- package/dist/components/TekWallet/components/ui/FiatDeposit/components/shareDrawer.d.ts +8 -0
- package/dist/components/TekWallet/components/ui/FiatDeposit/components/shareDrawer.js +21 -0
- package/dist/components/TekWallet/components/ui/FiatDeposit/components/shareImage.d.ts +9 -0
- package/dist/components/TekWallet/components/ui/FiatDeposit/components/shareImage.js +125 -0
- package/dist/components/TekWallet/components/ui/FiatDeposit/index.d.ts +5 -0
- package/dist/components/TekWallet/components/ui/FiatDeposit/index.js +254 -0
- package/dist/components/TekWallet/components/ui/Formatter/index.js +9 -8
- package/dist/components/TekWallet/components/ui/HistorySwap/index.js +2 -3
- package/dist/components/TekWallet/components/ui/ListItemCustom/index.d.ts +2 -1
- package/dist/components/TekWallet/components/ui/ListItemCustom/index.js +9 -2
- package/dist/components/TekWallet/components/ui/LoadingLayout/index.d.ts +2 -0
- package/dist/components/TekWallet/components/ui/LoadingLayout/index.js +3 -3
- package/dist/components/TekWallet/components/ui/OTP/index.d.ts +1 -0
- package/dist/components/TekWallet/components/ui/OTP/index.js +3 -1
- package/dist/components/TekWallet/components/ui/PageHeader/index.js +1 -1
- package/dist/components/TekWallet/components/ui/QRCode/index.js +1 -1
- package/dist/components/TekWallet/components/ui/QrCodeReader/index.js +4 -1
- package/dist/components/TekWallet/components/ui/ReceiveFunction/components/HelpButton.d.ts +2 -0
- package/dist/components/TekWallet/components/ui/ReceiveFunction/components/HelpButton.js +53 -0
- package/dist/components/TekWallet/components/ui/ReceiveFunction/components/HelpView.d.ts +5 -0
- package/dist/components/TekWallet/components/ui/ReceiveFunction/components/HelpView.js +80 -0
- package/dist/components/TekWallet/components/ui/ReceiveFunction/components/SortGroup.d.ts +10 -0
- package/dist/components/TekWallet/components/ui/ReceiveFunction/components/SortGroup.js +64 -0
- package/dist/components/TekWallet/components/ui/ReceiveFunction/components/SortTool.d.ts +11 -0
- package/dist/components/TekWallet/components/ui/ReceiveFunction/components/{sortByBalance.js → SortTool.js} +20 -19
- package/dist/components/TekWallet/components/ui/ReceiveFunction/index.d.ts +9 -1
- package/dist/components/TekWallet/components/ui/ReceiveFunction/index.js +198 -86
- package/dist/components/TekWallet/components/ui/ReceiveHistory/index.js +3 -4
- package/dist/components/TekWallet/components/ui/SvgPath/index.d.ts +4 -0
- package/dist/components/TekWallet/components/ui/SvgPath/index.js +7 -3
- package/dist/components/TekWallet/components/ui/TimeText/index.d.ts +5 -0
- package/dist/components/TekWallet/components/ui/TimeText/index.js +22 -0
- package/dist/components/TekWallet/components/views/ChangePasscodeView/index.js +24 -10
- package/dist/components/TekWallet/hooks/useConvertTime.d.ts +3 -0
- package/dist/components/TekWallet/hooks/useConvertTime.js +25 -0
- package/dist/components/TekWallet/hooks/useEventHandler.js +7 -10
- package/dist/components/TekWallet/hooks/useFormatter.d.ts +2 -0
- package/dist/components/TekWallet/hooks/useFormatter.js +2 -0
- package/dist/components/TekWallet/hooks/useWarningWrongPasscode.d.ts +14 -0
- package/dist/components/TekWallet/hooks/useWarningWrongPasscode.js +153 -0
- package/dist/components/TekWallet/providers/WalletDataProviderNoImport/index.js +5 -2
- package/dist/components/TekWallet/services/axios/authentication-by-passcode-service/index.d.ts +1 -1
- package/dist/components/TekWallet/services/axios/authentication-by-passcode-service/index.js +9 -19
- package/dist/components/TekWallet/services/axios/authentication-by-passcode-service/type.d.ts +14 -0
- package/dist/components/TekWallet/services/axios/get-deposit-fiat-info-service/getDepositFiatInfoService.d.ts +13 -0
- package/dist/components/TekWallet/services/axios/get-deposit-fiat-info-service/getDepositFiatInfoService.js +55 -0
- package/dist/components/TekWallet/theme/mui/deposit-fiat-theme/components.d.ts +3 -0
- package/dist/components/TekWallet/theme/mui/deposit-fiat-theme/components.js +158 -0
- package/dist/components/TekWallet/theme/mui/deposit-fiat-theme/palette.d.ts +55 -0
- package/dist/components/TekWallet/theme/mui/deposit-fiat-theme/palette.js +45 -0
- package/dist/components/TekWallet/theme/mui/deposit-fiat-theme/theme.d.ts +2 -0
- package/dist/components/TekWallet/theme/mui/deposit-fiat-theme/theme.js +13 -0
- package/dist/components/TekWallet/theme/mui/deposit-fiat-theme/typography.d.ts +39 -0
- package/dist/components/TekWallet/theme/mui/deposit-fiat-theme/typography.js +65 -0
- package/dist/components/TekWallet/theme/mui/theme.js +6 -6
- package/dist/components/TekWallet/types/expose-type.d.ts +49 -0
- package/dist/components/TekWallet/utils/cn.d.ts +2 -0
- package/dist/components/TekWallet/utils/cn.js +12 -0
- package/dist/components/TekWallet/utils/formatDate.d.ts +9 -6
- package/dist/components/TekWallet/utils/formatDate.js +410 -91
- package/package.json +5 -2
- package/dist/components/TekWallet/components/ui/ReceiveFunction/components/sortByBalance.d.ts +0 -11
|
@@ -0,0 +1,254 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __assign = (this && this.__assign) || function () {
|
|
3
|
+
__assign = Object.assign || function(t) {
|
|
4
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
+
s = arguments[i];
|
|
6
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
+
t[p] = s[p];
|
|
8
|
+
}
|
|
9
|
+
return t;
|
|
10
|
+
};
|
|
11
|
+
return __assign.apply(this, arguments);
|
|
12
|
+
};
|
|
13
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
14
|
+
if (k2 === undefined) k2 = k;
|
|
15
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
16
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
17
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
18
|
+
}
|
|
19
|
+
Object.defineProperty(o, k2, desc);
|
|
20
|
+
}) : (function(o, m, k, k2) {
|
|
21
|
+
if (k2 === undefined) k2 = k;
|
|
22
|
+
o[k2] = m[k];
|
|
23
|
+
}));
|
|
24
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
25
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
26
|
+
}) : function(o, v) {
|
|
27
|
+
o["default"] = v;
|
|
28
|
+
});
|
|
29
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
30
|
+
var ownKeys = function(o) {
|
|
31
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
32
|
+
var ar = [];
|
|
33
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
34
|
+
return ar;
|
|
35
|
+
};
|
|
36
|
+
return ownKeys(o);
|
|
37
|
+
};
|
|
38
|
+
return function (mod) {
|
|
39
|
+
if (mod && mod.__esModule) return mod;
|
|
40
|
+
var result = {};
|
|
41
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
42
|
+
__setModuleDefault(result, mod);
|
|
43
|
+
return result;
|
|
44
|
+
};
|
|
45
|
+
})();
|
|
46
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
47
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
48
|
+
};
|
|
49
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
50
|
+
exports.CopyIcon = void 0;
|
|
51
|
+
exports.default = FiatDeposit;
|
|
52
|
+
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
53
|
+
var material_1 = require("@mui/material");
|
|
54
|
+
var react_1 = require("react");
|
|
55
|
+
var SvgPath_1 = require("../SvgPath");
|
|
56
|
+
var ReceiveHistory_1 = __importDefault(require("../ReceiveHistory"));
|
|
57
|
+
var xhub_keyboard_1 = require("xhub-keyboard");
|
|
58
|
+
var useUniqueId_1 = require("../../../hooks/useUniqueId");
|
|
59
|
+
var getDepositFiatInfoService_1 = __importDefault(require("../../../services/axios/get-deposit-fiat-info-service/getDepositFiatInfoService"));
|
|
60
|
+
var useWallet_1 = __importDefault(require("../../../hooks/useWallet"));
|
|
61
|
+
var image_1 = __importDefault(require("next/image"));
|
|
62
|
+
var usehooks_ts_1 = require("usehooks-ts");
|
|
63
|
+
var TimeText_1 = __importDefault(require("../TimeText"));
|
|
64
|
+
var formatter_1 = __importDefault(require("../Formatter/functions/formatter"));
|
|
65
|
+
var shareDrawer_1 = __importDefault(require("./components/shareDrawer"));
|
|
66
|
+
var link_1 = __importDefault(require("next/link"));
|
|
67
|
+
var DrawerComponent_1 = __importStar(require("../DrawerComponent"));
|
|
68
|
+
var theme_1 = __importDefault(require("../../../theme/mui/deposit-fiat-theme/theme"));
|
|
69
|
+
// Because PageHeader component don't work
|
|
70
|
+
var BackArrow = function (props) {
|
|
71
|
+
return ((0, jsx_runtime_1.jsxs)("svg", __assign({ xmlns: "http://www.w3.org/2000/svg", width: "24", height: "24", viewBox: "0 0 24 24", fill: "none" }, props, { children: [(0, jsx_runtime_1.jsx)("mask", { id: "mask0_6061_2295", style: { maskType: "alpha" }, maskUnits: "userSpaceOnUse", x: "0", y: "0", width: "24", height: "24", children: (0, jsx_runtime_1.jsx)("rect", { width: "24", height: "24", fill: "#D9D9D9" }) }), (0, jsx_runtime_1.jsx)("g", { mask: "url(#mask0_6061_2295)", children: (0, jsx_runtime_1.jsx)("path", { d: "M14 17.6538L8.34619 12L14 6.34619L15.0538 7.40002L10.4538 12L15.0538 16.6L14 17.6538Z", fill: "#121212" }) })] })));
|
|
72
|
+
};
|
|
73
|
+
var Header = function (_a) {
|
|
74
|
+
var handleBack = _a.handleBack;
|
|
75
|
+
var historyRef = (0, react_1.useRef)(null);
|
|
76
|
+
return ((0, jsx_runtime_1.jsxs)(material_1.Grid2, { display: "grid", py: "0.75rem", px: "1rem", container: true, sx: {
|
|
77
|
+
gridTemplateColumns: "1fr 1fr 1fr",
|
|
78
|
+
gridTemplateRows: "1fr",
|
|
79
|
+
alignItems: "center",
|
|
80
|
+
}, children: [(0, jsx_runtime_1.jsx)(material_1.Grid2, { children: (0, jsx_runtime_1.jsx)(BackArrow, { onClick: handleBack }) }), (0, jsx_runtime_1.jsx)(material_1.Grid2, { display: "flex", children: (0, jsx_runtime_1.jsx)(material_1.Typography, { variant: "title01", sx: { width: "100%", textAlign: "center" }, children: "Top up" }) }), (0, jsx_runtime_1.jsx)(material_1.Grid2, { children: (0, jsx_runtime_1.jsxs)(material_1.Box, { display: "flex", alignItems: "center", justifyContent: "end", gap: ".5rem", children: [(0, jsx_runtime_1.jsx)(material_1.SvgIcon, { sx: { width: 20, height: 20 }, children: SvgPath_1.IC_HELP }), (0, jsx_runtime_1.jsx)(material_1.Divider, { flexItem: true, sx: { width: "1px" } }), (0, jsx_runtime_1.jsx)(DrawerComponent_1.default, { ref: historyRef, trigger: (0, jsx_runtime_1.jsx)(material_1.SvgIcon, { sx: { width: 20, height: 20, display: "block" }, children: SvgPath_1.IC_HISTORY }), direction: DrawerComponent_1.DRAWER_DIRECTION.RIGHT, children: (0, jsx_runtime_1.jsx)(ReceiveHistory_1.default, { onClose: function () { var _a; return (_a = historyRef.current) === null || _a === void 0 ? void 0 : _a.close(); } }) })] }) })] }));
|
|
81
|
+
};
|
|
82
|
+
var CopyIcon = function () {
|
|
83
|
+
return ((0, jsx_runtime_1.jsx)("svg", { xmlns: "http://www.w3.org/2000/svg", width: "17", height: "16", viewBox: "0 0 17 16", fill: "none", children: (0, jsx_runtime_1.jsx)("path", { d: "M11 11.5V13.75C11 14.164 10.664 14.5 10.25 14.5H3.75C3.55109 14.5 3.36032 14.421 3.21967 14.2803C3.07902 14.1397 3 13.9489 3 13.75V5.25C3 4.836 3.336 4.5 3.75 4.5H5C5.33505 4.49977 5.66954 4.52742 6 4.58267M11 11.5H13.25C13.664 11.5 14 11.164 14 10.75V7.5C14 4.52667 11.838 2.05933 9 1.58267C8.66954 1.52742 8.33505 1.49977 8 1.5H6.75C6.336 1.5 6 1.836 6 2.25V4.58267M11 11.5H6.75C6.55109 11.5 6.36032 11.421 6.21967 11.2803C6.07902 11.1397 6 10.9489 6 10.75V4.58267M14 9V7.75C14 7.15326 13.7629 6.58097 13.341 6.15901C12.919 5.73705 12.3467 5.5 11.75 5.5H10.75C10.5511 5.5 10.3603 5.42098 10.2197 5.28033C10.079 5.13968 10 4.94891 10 4.75V3.75C10 3.45453 9.9418 3.16195 9.82873 2.88896C9.71566 2.61598 9.54992 2.36794 9.34099 2.15901C9.13206 1.95008 8.88402 1.78435 8.61104 1.67127C8.33806 1.5582 8.04547 1.5 7.75 1.5H7", stroke: "#1E4841", strokeWidth: "1.25", strokeLinecap: "round", strokeLinejoin: "round" }) }));
|
|
84
|
+
};
|
|
85
|
+
exports.CopyIcon = CopyIcon;
|
|
86
|
+
function FiatDeposit(_a) {
|
|
87
|
+
var _b, _c, _d, _e, _f;
|
|
88
|
+
var children = _a.children;
|
|
89
|
+
var amountInputRef = (0, react_1.useRef)(null);
|
|
90
|
+
var _g = (0, useWallet_1.default)(), masterWallet = _g.masterWallet, transaction = _g.transaction, updateActivities = _g.updateActivities, receiveExternalTokens = _g.receiveExternalTokens, tokens = _g.tokens, pushNotification = _g.pushNotification;
|
|
91
|
+
var _h = (0, react_1.useState)(false), open = _h[0], setOpen = _h[1];
|
|
92
|
+
var _j = (0, react_1.useState)(false), openQR = _j[0], setOpenQR = _j[1];
|
|
93
|
+
var _k = (0, react_1.useState)(false), openShare = _k[0], setOpenShare = _k[1];
|
|
94
|
+
var keyboardId = (0, useUniqueId_1.useUniqueId)("receive-function-keyboard");
|
|
95
|
+
var _l = (0, react_1.useState)(""), inputAmount = _l[0], setInputAmount = _l[1];
|
|
96
|
+
var _m = (0, react_1.useState)(null), depositData = _m[0], setDepositData = _m[1];
|
|
97
|
+
var _o = (0, react_1.useState)(false), loading = _o[0], setLoading = _o[1];
|
|
98
|
+
var _p = (0, react_1.useState)(null), error = _p[0], setError = _p[1];
|
|
99
|
+
var _q = (0, react_1.useState)(false), copySuccess = _q[0], setCopySuccess = _q[1];
|
|
100
|
+
var _r = (0, usehooks_ts_1.useCountdown)({
|
|
101
|
+
countStart: 600,
|
|
102
|
+
}), count = _r[0], _s = _r[1], startCountdown = _s.startCountdown, resetCountdown = _s.resetCountdown;
|
|
103
|
+
var handleChangeAmount = function (value) {
|
|
104
|
+
var amountNumber = Number(value);
|
|
105
|
+
if (isNaN(amountNumber)) {
|
|
106
|
+
return;
|
|
107
|
+
}
|
|
108
|
+
setInputAmount(value);
|
|
109
|
+
};
|
|
110
|
+
var validateInput = function (input) {
|
|
111
|
+
var token = receiveExternalTokens === null || receiveExternalTokens === void 0 ? void 0 : receiveExternalTokens.find(function (item) { return item.slug.toLocaleLowerCase() === "vnd"; });
|
|
112
|
+
if (!token) {
|
|
113
|
+
setError("Token not found");
|
|
114
|
+
return false;
|
|
115
|
+
}
|
|
116
|
+
if (+input <= token.min_value) {
|
|
117
|
+
setError("Minimum deposit amount is ".concat((0, formatter_1.default)(token.min_value, false, false)));
|
|
118
|
+
return false;
|
|
119
|
+
}
|
|
120
|
+
if (+input > token.max_value) {
|
|
121
|
+
setError("Maximum deposit amount is ".concat((0, formatter_1.default)(token.max_value, false, false)));
|
|
122
|
+
return false;
|
|
123
|
+
}
|
|
124
|
+
return true;
|
|
125
|
+
};
|
|
126
|
+
var handleClick = function () {
|
|
127
|
+
if (loading)
|
|
128
|
+
return;
|
|
129
|
+
if (!validateInput(inputAmount.toString())) {
|
|
130
|
+
setLoading(false);
|
|
131
|
+
return;
|
|
132
|
+
}
|
|
133
|
+
setLoading(true);
|
|
134
|
+
(0, getDepositFiatInfoService_1.default)({
|
|
135
|
+
amount: +inputAmount,
|
|
136
|
+
to_address: masterWallet !== null && masterWallet !== void 0 ? masterWallet : "",
|
|
137
|
+
currency_slug: "vnd",
|
|
138
|
+
network: "ton",
|
|
139
|
+
network_address: "vnd",
|
|
140
|
+
await_completion: false,
|
|
141
|
+
orderInfo: "test",
|
|
142
|
+
email: "test@gmail.com",
|
|
143
|
+
})
|
|
144
|
+
.then(function (res) {
|
|
145
|
+
setDepositData(res);
|
|
146
|
+
setOpenQR(true);
|
|
147
|
+
resetCountdown();
|
|
148
|
+
startCountdown();
|
|
149
|
+
})
|
|
150
|
+
.finally(function () {
|
|
151
|
+
setLoading(false);
|
|
152
|
+
});
|
|
153
|
+
};
|
|
154
|
+
(0, react_1.useEffect)(function () {
|
|
155
|
+
if (copySuccess) {
|
|
156
|
+
var timeout_1 = setTimeout(function () { return setCopySuccess(false); }, 2000);
|
|
157
|
+
return function () { return clearTimeout(timeout_1); };
|
|
158
|
+
}
|
|
159
|
+
}, [copySuccess]);
|
|
160
|
+
var handleCopyLink = function (text) {
|
|
161
|
+
if (!(depositData === null || depositData === void 0 ? void 0 : depositData.id) || copySuccess)
|
|
162
|
+
return;
|
|
163
|
+
navigator.clipboard
|
|
164
|
+
.writeText(text)
|
|
165
|
+
.then(function () {
|
|
166
|
+
setCopySuccess(true);
|
|
167
|
+
})
|
|
168
|
+
.catch(function (err) {
|
|
169
|
+
console.error("Failed to copy link:", err);
|
|
170
|
+
});
|
|
171
|
+
};
|
|
172
|
+
(0, react_1.useEffect)(function () {
|
|
173
|
+
if ((transaction === null || transaction === void 0 ? void 0 : transaction.transaction_status) === "success") {
|
|
174
|
+
updateActivities();
|
|
175
|
+
setOpen(false);
|
|
176
|
+
setOpenQR(false);
|
|
177
|
+
setOpenShare(false);
|
|
178
|
+
setInputAmount("");
|
|
179
|
+
pushNotification({
|
|
180
|
+
message: "Deposit successful!",
|
|
181
|
+
type: "success",
|
|
182
|
+
id: "deposit-fiat-success",
|
|
183
|
+
});
|
|
184
|
+
}
|
|
185
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
186
|
+
}, [transaction]);
|
|
187
|
+
(0, react_1.useEffect)(function () {
|
|
188
|
+
if (inputAmount && !isNaN(Number(inputAmount)) && validateInput(inputAmount.toString())) {
|
|
189
|
+
setError(null);
|
|
190
|
+
}
|
|
191
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
192
|
+
}, [inputAmount]);
|
|
193
|
+
return ((0, jsx_runtime_1.jsxs)(material_1.ThemeProvider, { theme: theme_1.default, children: [(0, jsx_runtime_1.jsx)("span", { onClick: function (e) {
|
|
194
|
+
e.stopPropagation();
|
|
195
|
+
setOpen(true);
|
|
196
|
+
}, children: children }), (0, jsx_runtime_1.jsxs)(material_1.Drawer, { open: open, onClose: function () {
|
|
197
|
+
setOpen(false);
|
|
198
|
+
setInputAmount("");
|
|
199
|
+
}, anchor: "right", keepMounted: false, onClick: function (e) { return e.stopPropagation(); }, children: [(0, jsx_runtime_1.jsx)(Header, { handleBack: function () {
|
|
200
|
+
setOpen(false);
|
|
201
|
+
setInputAmount("");
|
|
202
|
+
} }), (0, jsx_runtime_1.jsx)(xhub_keyboard_1.Keyboard, { id: keyboardId, onChange: handleChangeAmount, keyboardType: xhub_keyboard_1.KeyboardType.Double, value: inputAmount === null || inputAmount === void 0 ? void 0 : inputAmount.toString(), keyboardId: "amount-keyboard-id", classNames: {
|
|
203
|
+
children: "fc",
|
|
204
|
+
}, styles: {
|
|
205
|
+
container: {
|
|
206
|
+
height: "100%",
|
|
207
|
+
},
|
|
208
|
+
}, children: (0, jsx_runtime_1.jsxs)(material_1.Stack, { height: "100%", flexDirection: "column", children: [(0, jsx_runtime_1.jsx)(material_1.Stack, { height: 0, flex: 1, p: "1rem", children: (0, jsx_runtime_1.jsxs)(material_1.Stack, { flexDirection: "column", p: "1rem", sx: {
|
|
209
|
+
backgroundColor: theme_1.default.palette.tertiary.main,
|
|
210
|
+
border: "1px solid",
|
|
211
|
+
borderColor: theme_1.default.palette.accent3.main,
|
|
212
|
+
borderRadius: "1rem",
|
|
213
|
+
gap: "0.5rem",
|
|
214
|
+
}, children: [(0, jsx_runtime_1.jsx)(material_1.Typography, { variant: "title02", color: "positive", children: "You Pay" }), (0, jsx_runtime_1.jsx)(xhub_keyboard_1.Label, { htmlFor: keyboardId, children: (0, jsx_runtime_1.jsx)(xhub_keyboard_1.Input, { autoFocus: true, alwaysFocus: true, ref: amountInputRef, elementsAcceptIds: ["amount-keyboard-id"], value: inputAmount === null || inputAmount === void 0 ? void 0 : inputAmount.toString(), displayType: xhub_keyboard_1.DisplayType.Double, styles: {
|
|
215
|
+
container: {
|
|
216
|
+
border: "1px solid ".concat(error ? theme_1.default.palette.error.main : theme_1.default.palette.primary.main),
|
|
217
|
+
},
|
|
218
|
+
}, rightElement: (0, jsx_runtime_1.jsxs)(material_1.Stack, { flexDirection: "row", alignItems: "center", gap: "4px", flexShrink: 0, pl: "1rem", children: [(0, jsx_runtime_1.jsx)(image_1.default, { alt: "", width: 16, height: 16, src: (_c = (_b = tokens === null || tokens === void 0 ? void 0 : tokens.find(function (item) { return item.currency_slug.toLocaleLowerCase() === "vnd"; })) === null || _b === void 0 ? void 0 : _b.currency.link) !== null && _c !== void 0 ? _c : "/" }), (0, jsx_runtime_1.jsx)(material_1.Typography, { variant: "content01", color: "accent2", children: "VND" })] }) }) }), error && ((0, jsx_runtime_1.jsxs)(material_1.Typography, { variant: "content02", color: "error", display: "flex", alignItems: "center", gap: "4px", children: [(0, jsx_runtime_1.jsx)("svg", { xmlns: "http://www.w3.org/2000/svg", width: "14", height: "14", viewBox: "0 0 14 14", fill: "none", children: (0, jsx_runtime_1.jsx)("path", { d: "M7 5.25V7.4375M12.25 7C12.25 7.68944 12.1142 8.37213 11.8504 9.00909C11.5865 9.64605 11.1998 10.2248 10.7123 10.7123C10.2248 11.1998 9.64605 11.5865 9.00909 11.8504C8.37213 12.1142 7.68944 12.25 7 12.25C6.31056 12.25 5.62787 12.1142 4.99091 11.8504C4.35395 11.5865 3.7752 11.1998 3.28769 10.7123C2.80018 10.2248 2.41347 9.64605 2.14963 9.00909C1.8858 8.37213 1.75 7.68944 1.75 7C1.75 5.60761 2.30312 4.27226 3.28769 3.28769C4.27226 2.30312 5.60761 1.75 7 1.75C8.39239 1.75 9.72774 2.30312 10.7123 3.28769C11.6969 4.27226 12.25 5.60761 12.25 7ZM7 9.1875H7.00467V9.19217H7V9.1875Z", stroke: "currentColor", strokeLinecap: "round", strokeLinejoin: "round" }) }), error] }))] }) }), (0, jsx_runtime_1.jsx)(material_1.Stack, { pt: "12px", id: "input-amount-action", children: (0, jsx_runtime_1.jsx)(material_1.Box, { px: "1rem", pb: "1.5rem", children: (0, jsx_runtime_1.jsx)(material_1.Button, { loading: loading, disabled: loading || !!error, onClick: handleClick, fullWidth: true, children: "Continue" }) }) })] }) })] }), (0, jsx_runtime_1.jsxs)(material_1.Drawer, { open: openQR, onClose: function () { return setOpenQR(false); }, anchor: "right", keepMounted: false, onClick: function (e) { return e.stopPropagation(); }, children: [(0, jsx_runtime_1.jsx)(Header, { handleBack: function () {
|
|
219
|
+
setOpen(false);
|
|
220
|
+
setOpenQR(false);
|
|
221
|
+
setInputAmount("");
|
|
222
|
+
} }), (0, jsx_runtime_1.jsxs)(material_1.Stack, { height: "100%", p: "1rem", pt: "26%", children: [(0, jsx_runtime_1.jsx)(material_1.Stack, { height: 0, flex: 1, width: "100%", children: (0, jsx_runtime_1.jsxs)(material_1.Stack, { alignItems: "center", p: "1rem", sx: {
|
|
223
|
+
backgroundColor: theme_1.default.palette.tertiary.main,
|
|
224
|
+
border: "1px solid",
|
|
225
|
+
borderColor: theme_1.default.palette.accent3.main,
|
|
226
|
+
borderRadius: "1rem",
|
|
227
|
+
gap: "0.75rem",
|
|
228
|
+
}, children: [(0, jsx_runtime_1.jsxs)(material_1.Box, { position: "relative", width: "45%", mt: "-25%", sx: { aspectRatio: "1 / 1" }, children: [(0, jsx_runtime_1.jsx)(image_1.default, { alt: "", fill: true, src: (_d = depositData === null || depositData === void 0 ? void 0 : depositData.qr_code) !== null && _d !== void 0 ? _d : "/", style: { filter: count === 0 ? "blur(6px)" : "none" } }), count === 0 && ((0, jsx_runtime_1.jsx)(material_1.Stack, { direction: "row", position: "absolute", alignItems: "center", justifyContent: "center", sx: {
|
|
229
|
+
background: "transparent",
|
|
230
|
+
inset: 0,
|
|
231
|
+
}, onClick: handleClick, children: (0, jsx_runtime_1.jsx)("svg", { xmlns: "http://www.w3.org/2000/svg", width: "24", height: "24", viewBox: "0 0 24 24", fill: "none", children: (0, jsx_runtime_1.jsx)("path", { d: "M16.0234 9.34794H21.0154L17.8344 6.16494C16.8103 5.14081 15.5346 4.40433 14.1356 4.02955C12.7366 3.65476 11.2636 3.65487 9.86464 4.02986C8.4657 4.40486 7.19014 5.14153 6.16617 6.16581C5.14221 7.19009 4.40594 8.46588 4.03138 9.86494M2.98537 19.6439V14.6519M2.98537 14.6519H7.97738M2.98537 14.6519L6.16537 17.8349C7.18949 18.8591 8.46517 19.5955 9.86416 19.9703C11.2632 20.3451 12.7362 20.345 14.1351 19.97C15.534 19.595 16.8096 18.8584 17.8336 17.8341C18.8575 16.8098 19.5938 15.534 19.9684 14.1349M21.0154 4.35594V9.34594", stroke: "#1E4841", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }) }) }))] }), (0, jsx_runtime_1.jsxs)(material_1.Typography, { variant: "title01", sx: {
|
|
232
|
+
fontSize: "1.5rem",
|
|
233
|
+
fontWeight: 600,
|
|
234
|
+
lineHeight: "140%",
|
|
235
|
+
display: "flex",
|
|
236
|
+
alignItems: "center",
|
|
237
|
+
flexDirection: "column",
|
|
238
|
+
}, color: "primary", children: [(0, formatter_1.default)((_e = depositData === null || depositData === void 0 ? void 0 : depositData.amount) !== null && _e !== void 0 ? _e : 0, false, false) || "--", (0, jsx_runtime_1.jsx)(material_1.Typography, { variant: "title01", sx: {
|
|
239
|
+
fontSize: "0.938rem",
|
|
240
|
+
fontWeight: 500,
|
|
241
|
+
lineHeight: "140%",
|
|
242
|
+
}, color: "accent2", children: "VND" })] }), (0, jsx_runtime_1.jsxs)(material_1.Typography, { display: "flex", alignItems: "center", gap: "0.375rem", variant: "title03", color: "accent2", children: ["Top up time left", (0, jsx_runtime_1.jsx)(TimeText_1.default, { seconds: count }), (0, jsx_runtime_1.jsx)("svg", { xmlns: "http://www.w3.org/2000/svg", width: "14", height: "14", viewBox: "0 0 14 14", fill: "none", children: (0, jsx_runtime_1.jsx)("path", { d: "M7 5V7.5M13 7C13 7.78793 12.8448 8.56815 12.5433 9.2961C12.2417 10.0241 11.7998 10.6855 11.2426 11.2426C10.6855 11.7998 10.0241 12.2417 9.2961 12.5433C8.56815 12.8448 7.78793 13 7 13C6.21207 13 5.43185 12.8448 4.7039 12.5433C3.97595 12.2417 3.31451 11.7998 2.75736 11.2426C2.20021 10.6855 1.75825 10.0241 1.45672 9.2961C1.15519 8.56815 1 7.78793 1 7C1 5.4087 1.63214 3.88258 2.75736 2.75736C3.88258 1.63214 5.4087 1 7 1C8.5913 1 10.1174 1.63214 11.2426 2.75736C12.3679 3.88258 13 5.4087 13 7ZM7 9.5H7.00533V9.50533H7V9.5Z", stroke: "#1E4841", strokeLinecap: "round", strokeLinejoin: "round" }) })] }), (0, jsx_runtime_1.jsx)(material_1.Divider, { flexItem: true }), (0, jsx_runtime_1.jsxs)(material_1.Typography, { display: "flex", flexDirection: "column", alignItems: "center", gap: "0.375rem", variant: "title01", children: [depositData === null || depositData === void 0 ? void 0 : depositData.metadata.bank_account.account_name, (0, jsx_runtime_1.jsx)(material_1.Typography, { variant: "content02", color: "accent2", children: depositData === null || depositData === void 0 ? void 0 : depositData.metadata.bank_account.bank_name }), (0, jsx_runtime_1.jsxs)(material_1.Typography, { variant: "title02", display: "flex", alignItems: "center", gap: "0.25rem", children: [copySuccess ? "Copied!" : depositData === null || depositData === void 0 ? void 0 : depositData.metadata.bank_account.account_number, (0, jsx_runtime_1.jsx)(material_1.Button, { variant: "icon", onClick: function () { var _a; return handleCopyLink((_a = depositData === null || depositData === void 0 ? void 0 : depositData.metadata.bank_account.account_number) !== null && _a !== void 0 ? _a : ""); }, children: (0, jsx_runtime_1.jsx)(exports.CopyIcon, {}) })] }), (0, jsx_runtime_1.jsx)(link_1.default, { href: (_f = depositData === null || depositData === void 0 ? void 0 : depositData._link.payment_link.href) !== null && _f !== void 0 ? _f : "#", target: "_blank", rel: "noopener noreferrer", style: {
|
|
243
|
+
marginTop: "-0.5rem",
|
|
244
|
+
}, children: (0, jsx_runtime_1.jsx)(material_1.Typography, { variant: "content02", sx: { textDecoration: "underline", fontStyle: "italic" }, children: "Transfer" }) })] })] }) }), (0, jsx_runtime_1.jsx)(material_1.Box, { pt: "0.75rem", pb: "1rem", width: "100%", children: (0, jsx_runtime_1.jsx)(material_1.Button, { disabled: loading, loading: loading, onClick: function () {
|
|
245
|
+
if (count === 0) {
|
|
246
|
+
handleClick();
|
|
247
|
+
}
|
|
248
|
+
else {
|
|
249
|
+
setOpenShare(true);
|
|
250
|
+
}
|
|
251
|
+
}, fullWidth: true, children: count === 0 ? "Reload" : "Share" }) })] })] }), (0, jsx_runtime_1.jsx)(material_1.SwipeableDrawer, { keepMounted: false, anchor: "bottom", open: openShare, onOpen: function () { return setOpenShare(true); }, onClose: function () { return setOpenShare(false); }, classes: { paper: "rounded-t-2xl" }, sx: {
|
|
252
|
+
zIndex: 1201,
|
|
253
|
+
}, onClick: function (e) { return e.stopPropagation(); }, children: (0, jsx_runtime_1.jsx)(shareDrawer_1.default, { count: count, depositData: depositData, handleRefresh: handleClick, onClose: function () { return setOpenShare(false); } }) })] }));
|
|
254
|
+
}
|
|
@@ -45,22 +45,23 @@ var Formatter = function (_a) {
|
|
|
45
45
|
var isSmallValue = valueInNumber > 0 && valueInNumber < 0.01;
|
|
46
46
|
if (isSmallValue) {
|
|
47
47
|
if (showLessThan) {
|
|
48
|
-
return ((0, jsx_runtime_1.jsxs)("span", { className: (0, clsx_1.default)(className), children: ["< ", "0", userSetting.decimalDot, "01"] }));
|
|
48
|
+
return ((0, jsx_runtime_1.jsxs)("span", { className: (0, clsx_1.default)(className), children: [start, "< ", "0", userSetting.decimalDot, "01"] }));
|
|
49
49
|
}
|
|
50
50
|
else {
|
|
51
|
-
return ((0, jsx_runtime_1.jsxs)("span", { className: (0, clsx_1.default)(className), children: ["0.0", (0, jsx_runtime_1.jsx)("sub", { children: lengthFromDot }), formattedNumber.slice(2 + lengthFromDot, lengthValueAllowed - 2 + lengthFromDot)] }));
|
|
51
|
+
return ((0, jsx_runtime_1.jsxs)("span", { className: (0, clsx_1.default)(className), children: [start, "0.0", (0, jsx_runtime_1.jsx)("sub", { children: lengthFromDot }), formattedNumber.slice(2 + lengthFromDot, lengthValueAllowed - 2 + lengthFromDot)] }));
|
|
52
52
|
}
|
|
53
53
|
}
|
|
54
|
-
return ((0, jsx_runtime_1.
|
|
54
|
+
return ((0, jsx_runtime_1.jsxs)("span", { className: (0, clsx_1.default)(className), children: [start, (0, formatter_1.default)(valueInNumber, useCompact, useCompactOnThousand, lengthValueAllowed)] }));
|
|
55
55
|
}, [
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
56
|
+
valueInNumber,
|
|
57
|
+
className,
|
|
58
|
+
start,
|
|
59
59
|
useCompact,
|
|
60
60
|
useCompactOnThousand,
|
|
61
|
+
lengthValueAllowed,
|
|
62
|
+
allowShowZero,
|
|
63
|
+
showLessThan,
|
|
61
64
|
userSetting.decimalDot,
|
|
62
|
-
valueInNumber,
|
|
63
|
-
className,
|
|
64
65
|
]);
|
|
65
66
|
var trigger = valueDisplay();
|
|
66
67
|
return ((0, jsx_runtime_1.jsx)(CustomTooltip_1.default, { disabled: disableTooltip, trigger: addUnit(trigger), sx: {
|
|
@@ -199,7 +199,6 @@ var HistorySwap = function (props) {
|
|
|
199
199
|
return [3 /*break*/, 5];
|
|
200
200
|
case 4:
|
|
201
201
|
setLoading(false);
|
|
202
|
-
console.error("Error fetching swap history.");
|
|
203
202
|
return [7 /*endfinally*/];
|
|
204
203
|
case 5: return [2 /*return*/];
|
|
205
204
|
}
|
|
@@ -410,13 +409,13 @@ var HistorySwap = function (props) {
|
|
|
410
409
|
timestamp: selectedItem.date_created,
|
|
411
410
|
success: selectedItem === null || selectedItem === void 0 ? void 0 : selectedItem.transaction_status,
|
|
412
411
|
message: "",
|
|
413
|
-
} }, "detail-".concat(currentId))) }) }, "drawer-".concat(currentId)), resultData.map(function (item) {
|
|
412
|
+
} }, "detail-".concat(currentId))) }) }, "drawer-".concat(currentId)), resultData.map(function (item, i) {
|
|
414
413
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
|
|
415
414
|
return ((0, jsx_runtime_1.jsx)(material_1.Box, { onClick: function () {
|
|
416
415
|
handleTransactionClick(item.id);
|
|
417
416
|
}, sx: {
|
|
418
417
|
mt: theme.mixins.customMargin.m8,
|
|
419
|
-
}, children: (0, jsx_runtime_1.jsx)(CardHistorySwap_1.default, { amount: item.amount, status: item.transaction_status, fromCurrency: (_a = item.currency_data) === null || _a === void 0 ? void 0 : _a.full_name, toCurrency: (_f = (_e = (_d = (_c = (_b = item.fee_info) === null || _b === void 0 ? void 0 : _b.fee_detail) === null || _c === void 0 ? void 0 : _c[0]) === null || _d === void 0 ? void 0 : _d.currency) === null || _e === void 0 ? void 0 : _e.outputs[0]) === null || _f === void 0 ? void 0 : _f.full_name, swapAmount: (_l = (_k = (_j = (_h = (_g = item.fee_info) === null || _g === void 0 ? void 0 : _g.fee_detail) === null || _h === void 0 ? void 0 : _h[0]) === null || _j === void 0 ? void 0 : _j.currency) === null || _k === void 0 ? void 0 : _k.outputs[0]) === null || _l === void 0 ? void 0 : _l.swap_amount, date: item.date_created, description: item.description }, item.id) },
|
|
418
|
+
}, children: (0, jsx_runtime_1.jsx)(CardHistorySwap_1.default, { amount: item.amount, status: item.transaction_status, fromCurrency: (_a = item.currency_data) === null || _a === void 0 ? void 0 : _a.full_name, toCurrency: (_f = (_e = (_d = (_c = (_b = item.fee_info) === null || _b === void 0 ? void 0 : _b.fee_detail) === null || _c === void 0 ? void 0 : _c[0]) === null || _d === void 0 ? void 0 : _d.currency) === null || _e === void 0 ? void 0 : _e.outputs[0]) === null || _f === void 0 ? void 0 : _f.full_name, swapAmount: (_l = (_k = (_j = (_h = (_g = item.fee_info) === null || _g === void 0 ? void 0 : _g.fee_detail) === null || _h === void 0 ? void 0 : _h[0]) === null || _j === void 0 ? void 0 : _j.currency) === null || _k === void 0 ? void 0 : _k.outputs[0]) === null || _l === void 0 ? void 0 : _l.swap_amount, date: item.date_created, description: item.description }, item.id) }, i));
|
|
420
419
|
})] })) : (resultData.length == 0 &&
|
|
421
420
|
!isLoading && ((0, jsx_runtime_1.jsxs)(material_1.Box, { sx: __assign(__assign(__assign(__assign({}, theme.mixins.center), { padding: theme.mixins.customPadding.p24 }), theme.mixins.column), { gap: theme.mixins.gaps.g4, textAlign: "center" }), children: [(0, jsx_runtime_1.jsx)(Icon_1.default, { src: (0, getIcon_1.default)("result"), width: 62, height: 62, sx: {
|
|
422
421
|
mx: "auto",
|
|
@@ -8,6 +8,7 @@ export interface ListItemCustomProps extends Omit<ListItemButtonProps, "title">
|
|
|
8
8
|
disabled?: boolean;
|
|
9
9
|
rightIcon?: React.ReactNode | boolean;
|
|
10
10
|
hideDefaultRightIcon?: boolean;
|
|
11
|
+
recommended?: boolean;
|
|
11
12
|
}
|
|
12
|
-
declare function ListItemCustom({ title, description, icon, rightIcon, hideDefaultRightIcon, sx, ...rest }: ListItemCustomProps): import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
declare function ListItemCustom({ title, description, icon, rightIcon, hideDefaultRightIcon, sx, recommended, ...rest }: ListItemCustomProps): import("react/jsx-runtime").JSX.Element;
|
|
13
14
|
export default ListItemCustom;
|
|
@@ -31,9 +31,16 @@ var ThemeProvider_1 = require("../../../providers/ThemeProvider");
|
|
|
31
31
|
var Text_1 = __importDefault(require("../Text"));
|
|
32
32
|
var SvgPath_1 = require("../SvgPath");
|
|
33
33
|
function ListItemCustom(_a) {
|
|
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"]);
|
|
34
|
+
var title = _a.title, description = _a.description, icon = _a.icon, rightIcon = _a.rightIcon, hideDefaultRightIcon = _a.hideDefaultRightIcon, sx = _a.sx, recommended = _a.recommended, rest = __rest(_a, ["title", "description", "icon", "rightIcon", "hideDefaultRightIcon", "sx", "recommended"]);
|
|
35
35
|
var theme = (0, ThemeProvider_1.useTheme)();
|
|
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.r16, backgroundColor: theme.palette.background.white
|
|
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: "calc(".concat(theme.mixins.customPadding.p16, " + 6px) ").concat(theme.mixins.customPadding.p16), border: "1px solid ".concat(theme.palette.border.accent3), borderRadius: theme.mixins.customRadius.r16, backgroundColor: theme.palette.background.white, position: "relative", overflow: "hidden" }), sx), children: [(0, jsx_runtime_1.jsxs)(material_1.Box, { sx: {
|
|
37
|
+
position: "absolute",
|
|
38
|
+
top: "-9px",
|
|
39
|
+
left: "-1px",
|
|
40
|
+
}, children: [(0, jsx_runtime_1.jsx)(material_1.SvgIcon, { sx: {
|
|
41
|
+
width: "6.6rem",
|
|
42
|
+
height: "auto",
|
|
43
|
+
}, children: recommended ? SvgPath_1.IC_RECEIVE_TAG_RECOMMENDED : SvgPath_1.IC_RECEIVE_TAG }), (0, jsx_runtime_1.jsx)(material_1.Box, { sx: __assign(__assign({}, theme.mixins.center), { whiteSpace: "nowrap", color: recommended ? theme.palette.text.blackContrast : theme.palette.text.white, fontSize: theme.typography.fontSize10, fontWeight: theme.typography.fontWeight600, lineHeight: "120%" }), children: recommended ? "Recommended" : "Fee upto 8%" })] }), 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
44
|
// <Icon width={10} src={getIcon("right_arrow")} sx={{ ml: "auto" }} />
|
|
38
45
|
(0, jsx_runtime_1.jsx)(material_1.SvgIcon, { sx: { width: "12px", height: "12px" }, children: SvgPath_1.IC_CHEVRON_RIGHT })))] })));
|
|
39
46
|
}
|
|
@@ -1,7 +1,9 @@
|
|
|
1
|
+
import { SxProps } from "@mui/material";
|
|
1
2
|
import { GeneralProps } from "../../../types/ui";
|
|
2
3
|
interface LoadingLayoutProps extends GeneralProps {
|
|
3
4
|
loadingMessage?: string;
|
|
4
5
|
initLoading?: boolean;
|
|
6
|
+
overlaySx?: SxProps;
|
|
5
7
|
}
|
|
6
8
|
export interface LoadingLayoutRef {
|
|
7
9
|
startLoading: () => void;
|
|
@@ -21,7 +21,7 @@ var Text_1 = __importDefault(require("../Text"));
|
|
|
21
21
|
var react_1 = require("react");
|
|
22
22
|
var LoadingLayout = (0, react_1.forwardRef)(function (props, ref) {
|
|
23
23
|
var _a = (0, react_1.useState)(props.initLoading), loading = _a[0], setLoading = _a[1];
|
|
24
|
-
var _b = props.loadingMessage, loadingMessage = _b === void 0 ? "Processing" : _b, children = props.children, sx = props.sx;
|
|
24
|
+
var _b = props.loadingMessage, loadingMessage = _b === void 0 ? "Processing" : _b, children = props.children, sx = props.sx, overlaySx = props.overlaySx;
|
|
25
25
|
var theme = (0, ThemeProvider_1.useTheme)();
|
|
26
26
|
(0, react_1.useImperativeHandle)(ref, function () { return ({
|
|
27
27
|
startLoading: function () {
|
|
@@ -31,9 +31,9 @@ var LoadingLayout = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
31
31
|
setLoading(false);
|
|
32
32
|
},
|
|
33
33
|
}); });
|
|
34
|
-
return ((0, jsx_runtime_1.jsxs)(material_1.Box, { sx: __assign({ position: "relative", width: "fit-content", height: "fit-content" }, sx), children: [children, loading && ((0, jsx_runtime_1.jsxs)(material_1.Box, { sx: __assign(__assign(__assign({}, theme.mixins.whiteLoadingOverlay), theme.mixins.row), { gap: theme.mixins.gaps.g8, justifyContent: "center" }), children: [(0, jsx_runtime_1.jsx)(material_1.CircularProgress, { color: "
|
|
34
|
+
return ((0, jsx_runtime_1.jsxs)(material_1.Box, { sx: __assign({ position: "relative", width: "fit-content", height: "fit-content" }, sx), children: [children, loading && ((0, jsx_runtime_1.jsxs)(material_1.Box, { sx: __assign(__assign(__assign(__assign({}, theme.mixins.whiteLoadingOverlay), theme.mixins.row), { gap: theme.mixins.gaps.g8, justifyContent: "center" }), overlaySx), children: [(0, jsx_runtime_1.jsx)(material_1.CircularProgress, { sx: { color: "black" }, size: 20 }), (0, jsx_runtime_1.jsx)(Text_1.default, { sx: {
|
|
35
35
|
fontSize: theme.typography.fontSize12,
|
|
36
|
-
color: "
|
|
36
|
+
color: "black",
|
|
37
37
|
}, children: loadingMessage })] }))] }));
|
|
38
38
|
});
|
|
39
39
|
LoadingLayout.displayName = "LoadingLayout";
|
|
@@ -10,6 +10,7 @@ interface CustomOtpInputProps extends Omit<OTPInputProps, "renderInput" | "onCha
|
|
|
10
10
|
renderInput?: (inputProps: InputProps, index: number) => React.ReactNode;
|
|
11
11
|
onChange?: (value: string) => void;
|
|
12
12
|
readOnly?: boolean;
|
|
13
|
+
disabled?: boolean;
|
|
13
14
|
}
|
|
14
15
|
declare const CustomOtpInput: (props: CustomOtpInputProps) => import("react/jsx-runtime").JSX.Element;
|
|
15
16
|
export default CustomOtpInput;
|
|
@@ -50,7 +50,7 @@ var OtpInputType;
|
|
|
50
50
|
OtpInputType["CONFIRM_BY_PASSCODE"] = "confirm-by-passcode";
|
|
51
51
|
})(OtpInputType || (exports.OtpInputType = OtpInputType = {}));
|
|
52
52
|
var CustomOtpInput = function (props) {
|
|
53
|
-
var otpInputType = props.otpInputType, numInputs = props.numInputs, _a = props.onChange, onChange = _a === void 0 ? function () { } : _a, _b = props.readOnly, readOnly = _b === void 0 ? false : _b, rest = __rest(props, ["otpInputType", "numInputs", "onChange", "readOnly"]);
|
|
53
|
+
var otpInputType = props.otpInputType, numInputs = props.numInputs, _a = props.onChange, onChange = _a === void 0 ? function () { } : _a, _b = props.readOnly, readOnly = _b === void 0 ? false : _b, _c = props.disabled, disabled = _c === void 0 ? false : _c, rest = __rest(props, ["otpInputType", "numInputs", "onChange", "readOnly", "disabled"]);
|
|
54
54
|
var theme = (0, providers_1.useTheme)();
|
|
55
55
|
var InputElement = (0, react_1.useMemo)(function () {
|
|
56
56
|
var _a, _b, _c;
|
|
@@ -102,6 +102,8 @@ var CustomOtpInput = function (props) {
|
|
|
102
102
|
alignItems: "center",
|
|
103
103
|
justifyContent: "center",
|
|
104
104
|
width: "100%",
|
|
105
|
+
opacity: disabled ? 0.5 : 1,
|
|
106
|
+
pointerEvents: disabled ? "none" : "initial",
|
|
105
107
|
}, children: (0, jsx_runtime_1.jsx)(xhub_keyboard_1.Input, { styles: {
|
|
106
108
|
container: {
|
|
107
109
|
width: "100%",
|
|
@@ -21,6 +21,6 @@ var BackHeader_1 = __importDefault(require("../BackHeader"));
|
|
|
21
21
|
var Text_1 = __importDefault(require("../Text"));
|
|
22
22
|
var PageHeader = function (props) {
|
|
23
23
|
var theme = (0, ThemeProvider_1.useTheme)();
|
|
24
|
-
return ((0, jsx_runtime_1.jsxs)(BackHeader_1.default, { overrideBack: props.overrideBack, renderBack: props.renderBack, hideBack: props.hideBack, sx: __assign({ display: "flex", alignItems: "center", justifyContent: "space-between", height: "100%", position: "relative", paddingLeft: theme.mixins.pagePadding.paddingLeft, paddingRight: theme.mixins.pagePadding.paddingRight, minHeight: "3.125rem", color: theme.palette.text.
|
|
24
|
+
return ((0, jsx_runtime_1.jsxs)(BackHeader_1.default, { overrideBack: props.overrideBack, renderBack: props.renderBack, hideBack: props.hideBack, sx: __assign({ display: "flex", alignItems: "center", justifyContent: "space-between", height: "100%", position: "relative", paddingLeft: theme.mixins.pagePadding.paddingLeft, paddingRight: theme.mixins.pagePadding.paddingRight, minHeight: "3.125rem", color: theme.palette.text.blackContrast }, props.sx), children: [(0, jsx_runtime_1.jsx)(Text_1.default, { sx: __assign(__assign(__assign({}, theme.mixins.center), theme.mixins.headerTitle), { color: "inherit" }), children: props.title }), props.children] }));
|
|
25
25
|
};
|
|
26
26
|
exports.default = PageHeader;
|
|
@@ -5,7 +5,7 @@ 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
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: {
|
|
8
|
-
src: logo || "",
|
|
8
|
+
src: logo || "/",
|
|
9
9
|
x: undefined,
|
|
10
10
|
y: undefined,
|
|
11
11
|
height: 24,
|
|
@@ -11,6 +11,7 @@ var react_qr_scanner_1 = require("@yudiel/react-qr-scanner");
|
|
|
11
11
|
var AppBackDrop_1 = __importDefault(require("../AppBackDrop"));
|
|
12
12
|
var ChildPageLayout_1 = __importDefault(require("../../layouts/ChildPageLayout"));
|
|
13
13
|
var PageHeader_1 = __importDefault(require("../PageHeader"));
|
|
14
|
+
var providers_1 = require("../../../providers");
|
|
14
15
|
var STYLES = {
|
|
15
16
|
borderWidth: "4px",
|
|
16
17
|
borderColor: "#ffffff",
|
|
@@ -85,6 +86,7 @@ var QrCodeReader = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
85
86
|
styleTag.remove();
|
|
86
87
|
};
|
|
87
88
|
}, []);
|
|
89
|
+
var theme = (0, providers_1.useTheme)();
|
|
88
90
|
return ((0, jsx_runtime_1.jsx)(DrawerComponent_1.default, { trigger: props.children, ref: drawerRef, onClose: onClose, onOpen: onOpen, sx: sx, className: className, children: (0, jsx_runtime_1.jsx)(ChildPageLayout_1.default, { sx: {
|
|
89
91
|
backgroundColor: "transparent !important",
|
|
90
92
|
}, header: (0, jsx_runtime_1.jsx)(PageHeader_1.default, { hideBack: true, title: "Scan QR code", sx: {
|
|
@@ -95,12 +97,13 @@ var QrCodeReader = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
95
97
|
zIndex: 1001,
|
|
96
98
|
height: "fit-content",
|
|
97
99
|
fontWeight: 700,
|
|
100
|
+
color: theme.palette.text.white,
|
|
98
101
|
}, children: (0, jsx_runtime_1.jsx)(material_1.SvgIcon, { sx: {
|
|
99
102
|
width: "1.5rem",
|
|
100
103
|
height: "1.5rem",
|
|
101
104
|
cursor: "pointer",
|
|
102
105
|
ml: "auto",
|
|
103
|
-
}, onClick: close, children: (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: "M5 15L15 5M5 5L15 15", stroke: "white",
|
|
106
|
+
}, onClick: close, children: (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: "M5 15L15 5M5 5L15 15", stroke: "white", strokeWidth: "1.25", strokeLinecap: "round", strokeLinejoin: "round" }) }) }) }), children: (0, jsx_runtime_1.jsx)("div", { ref: qrReaderContainer, children: isOpen && ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(material_1.Box, { sx: {
|
|
104
107
|
opacity: isReaderReady ? 0 : 1,
|
|
105
108
|
transition: "opacity 0.3s ease-in-out",
|
|
106
109
|
}, children: (0, jsx_runtime_1.jsx)(AppBackDrop_1.default, { open: true, message: "Starting the camera..." }) }), (0, jsx_runtime_1.jsxs)("div", { style: { transition: "opacity 0.3s ease-in-out", opacity: isReaderReady ? 1 : 0 }, children: [(0, jsx_runtime_1.jsxs)("div", { style: {
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
36
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
37
|
+
};
|
|
38
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
+
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
40
|
+
var material_1 = require("@mui/material");
|
|
41
|
+
var DrawerComponent_1 = __importStar(require("../../DrawerComponent"));
|
|
42
|
+
var HelpView_1 = __importDefault(require("./HelpView"));
|
|
43
|
+
var SvgPath_1 = require("../../SvgPath");
|
|
44
|
+
var react_1 = require("react");
|
|
45
|
+
function HelpButton() {
|
|
46
|
+
var drawerRef = (0, react_1.useRef)(null);
|
|
47
|
+
var onClose = function () {
|
|
48
|
+
var _a;
|
|
49
|
+
(_a = drawerRef.current) === null || _a === void 0 ? void 0 : _a.close();
|
|
50
|
+
};
|
|
51
|
+
return ((0, jsx_runtime_1.jsx)(DrawerComponent_1.default, { ref: drawerRef, direction: DrawerComponent_1.DRAWER_DIRECTION.RIGHT, trigger: (0, jsx_runtime_1.jsx)(material_1.SvgIcon, { sx: { width: 20, height: 20, display: "block" }, children: SvgPath_1.IC_HELP }), children: (0, jsx_runtime_1.jsx)(HelpView_1.default, { onBack: onClose }) }));
|
|
52
|
+
}
|
|
53
|
+
exports.default = HelpButton;
|