tek-wallet 0.0.697 → 0.0.699
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.
|
@@ -67,7 +67,6 @@ var Share_1 = __importDefault(require("../Share"));
|
|
|
67
67
|
var NetworkSelection_1 = __importDefault(require("../NetworkSelection"));
|
|
68
68
|
var TokenSelection_1 = __importDefault(require("../TokenSelection"));
|
|
69
69
|
var useReceiveData_1 = __importDefault(require("../../../hooks/useReceiveData"));
|
|
70
|
-
var RequireConnect_1 = __importDefault(require("../RequireConnect"));
|
|
71
70
|
var WaitingData_1 = __importDefault(require("../WaitingData"));
|
|
72
71
|
var EmptyData_1 = __importDefault(require("../EmptyData"));
|
|
73
72
|
var Formatter_1 = __importDefault(require("../Formatter"));
|
|
@@ -323,87 +322,87 @@ exports.ReceiveFunction = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
323
322
|
var blockchainAddress = (_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;
|
|
324
323
|
return blockchainAddress;
|
|
325
324
|
}, [blockchainWallets, masterWallet, selectedMethod, selectedNetwork]);
|
|
326
|
-
return ((0, jsx_runtime_1.jsx)(
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
325
|
+
return ((0, jsx_runtime_1.jsx)(DrawerComponent_1.default, { ref: drawerRef, trigger: props.children, onOpen: props.onOpen, onClose: handleOnClose, sx: props.sx, children: (0, jsx_runtime_1.jsx)(ModalLayout_1.default, { title: RECEIVE_STEP_NAME[ReceiveStep.SELECT_METHOD], onClose: close, children: (0, jsx_runtime_1.jsx)(DrawerComponent_1.default, { ref: stepDrawerRef, direction: DrawerComponent_1.DRAWER_DIRECTION.RIGHT, sx: {
|
|
326
|
+
width: "100%",
|
|
327
|
+
}, trigger: (0, jsx_runtime_1.jsxs)(material_1.Box, { sx: __assign(__assign({}, theme.mixins.column), { gap: theme.mixins.gaps.g12, height: "fit-content", width: "100%" }), children: [(0, jsx_runtime_1.jsx)(ListItemCustom_1.default, { title: "Top up via internal transfer", description: "Receive crypto from other Ting users", icon: (0, jsx_runtime_1.jsx)(material_1.SvgIcon, { sx: { width: 24, height: 24 }, children: SvgPath_1.IC_RECEIVE_INTERNAL }), onClick: function () { return handleSelectMethod(ReceiveMethods.RECEIVE_INTERNAL); } }), (0, jsx_runtime_1.jsx)(ListItemCustom_1.default, { title: "Top up via blockchain", description: "Deposit using a Web3 or an Exchange wallet", icon: (0, jsx_runtime_1.jsx)(material_1.SvgIcon, { sx: { width: 24, height: 24 }, children: SvgPath_1.IC_RECEIVE_EXTERNAL }), onClick: function () { return handleSelectMethod(ReceiveMethods.RECEIVE_EXTERNAL); } })] }), children: (0, jsx_runtime_1.jsx)(ChildPageLayout_1.default, { sx: {
|
|
328
|
+
position: "relative",
|
|
329
|
+
sx: "100dvh",
|
|
330
|
+
}, header: (0, jsx_runtime_1.jsx)(PageHeader_1.default, { title: RECEIVE_STEP_NAME[Math.max(currentStep, ReceiveStep.SELECT_TOKEN)], overrideBack: handleBack, children: (0, jsx_runtime_1.jsxs)(material_1.Box, { sx: __assign(__assign({}, theme.mixins.row), { gap: theme.mixins.gaps.g8, marginLeft: "auto" }), 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, { orientation: "vertical", sx: {
|
|
331
|
+
height: "1rem",
|
|
332
|
+
width: "1px",
|
|
333
|
+
backgroundColor: theme.palette.border.accent3,
|
|
334
|
+
} }), (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: closeHistory }) })] }) }), footer: (0, jsx_runtime_1.jsx)(material_1.Box, { sx: {
|
|
335
|
+
maxHeight: currentStep === ReceiveStep.SHOW_QR_CODE ? "120px" : 0,
|
|
336
|
+
overflow: "hidden",
|
|
337
|
+
transition: currentStep === ReceiveStep.SHOW_QR_CODE
|
|
338
|
+
? "max-height 0.3s linear 0.3s"
|
|
339
|
+
: "max-height 0s linear",
|
|
340
|
+
}, children: (0, jsx_runtime_1.jsx)(Share_1.default, { elementId: "share-receive-info", onProgress: handleShareProgress, onFinish: handleShareFinish, imageName: sharedImageName, children: (0, jsx_runtime_1.jsx)(BottomActionLayout_1.default, { children: (0, jsx_runtime_1.jsx)(Button_1.default.Primary, { fullWidth: true, status: isSharing ? Button_1.BUTTON_STATUS.LOADING : undefined, children: "Share" }) }) }) }), children: (0, jsx_runtime_1.jsx)(material_1.Box, { sx: { padding: theme.mixins.pagePadding }, children: (0, jsx_runtime_1.jsxs)(SwiperControlled_1.default, { ref: stepSwiperRef, swiperProps: {
|
|
341
|
+
// autoHeight: true,
|
|
342
|
+
spaceBetween: 32,
|
|
343
|
+
}, disableSwipe: true,
|
|
344
|
+
// key={`step_${currentStep}`}
|
|
345
|
+
initialActiveTab: currentStep - 1, children: [(0, jsx_runtime_1.jsx)(react_2.SwiperSlide, { children: (0, jsx_runtime_1.jsxs)(material_1.Box, { sx: __assign(__assign({}, theme.mixins.column), { gap: theme.mixins.gaps.g12, height: "fit-content" }), children: [!receiveTokens && (0, jsx_runtime_1.jsx)(WaitingData_1.default, {}), (receiveTokens === null || receiveTokens === void 0 ? void 0 : receiveTokens.length) === 0 && (0, jsx_runtime_1.jsx)(EmptyData_1.default, {}), receiveTokens && (receiveTokens === null || receiveTokens === void 0 ? void 0 : receiveTokens.length) > 0 && ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(material_1.InputBase, { startAdornment: (0, jsx_runtime_1.jsx)(material_1.InputAdornment, { position: "start", children: (0, jsx_runtime_1.jsx)(material_1.SvgIcon, { sx: { width: 20, height: 20 }, children: SvgPath_1.IC_SEARCH }) }), placeholder: "Search", sx: {
|
|
346
|
+
borderRadius: theme.mixins.customRadius.r12,
|
|
347
|
+
border: "1px solid",
|
|
348
|
+
borderColor: theme.palette.border.accent3,
|
|
349
|
+
background: theme.palette.background.white,
|
|
350
|
+
color: theme.palette.text.black,
|
|
351
|
+
py: theme.mixins.customPadding.p6,
|
|
352
|
+
px: theme.mixins.customPadding.p12,
|
|
353
|
+
fontSize: theme.typography.fontSize16,
|
|
354
|
+
"input::placeholder": {
|
|
355
|
+
fontSize: theme.typography.fontSize12,
|
|
356
|
+
pl: theme.mixins.customPadding.p4,
|
|
357
|
+
fontWeight: theme.typography.fontWeight500,
|
|
351
358
|
color: theme.palette.text.black,
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
} }), (0, jsx_runtime_1.jsxs)(material_1.Box, { sx: {
|
|
362
|
-
display: theme.mixins.row,
|
|
363
|
-
justifyContent: "space-between",
|
|
364
|
-
mt: theme.mixins.customMargin.m16,
|
|
365
|
-
}, children: [(0, jsx_runtime_1.jsx)(sortByBalance_1.default, { name: "Token" }), (0, jsx_runtime_1.jsx)(sortByBalance_1.default, { name: "Balance",
|
|
366
|
-
// sortBalance={sortBalance}
|
|
367
|
-
setSortBalance: setSortBalance })] })] })), receiveTokens === null || receiveTokens === void 0 ? void 0 : receiveTokens.map(function (item, index) {
|
|
368
|
-
var stringifiedTokenData = JSON.stringify(item);
|
|
369
|
-
if (!item)
|
|
370
|
-
return null;
|
|
371
|
-
return ((0, jsx_runtime_1.jsx)(TokenSelection_1.default, { onClick: handleSelectToken, tokenData: stringifiedTokenData, active: (selectedToken === null || selectedToken === void 0 ? void 0 : selectedToken.id) === item.id }, "token_".concat(item.id, "_").concat(index)));
|
|
372
|
-
})] }) }, "slide_step_".concat(ReceiveStep.SELECT_TOKEN)), (0, jsx_runtime_1.jsx)(react_2.SwiperSlide, { children: (0, jsx_runtime_1.jsx)(material_1.Box, { sx: __assign(__assign({}, theme.mixins.column), { gap: theme.mixins.gaps.g12, display: selectedMethod === ReceiveMethods.RECEIVE_EXTERNAL ? "flex" : "none" }), children: networks === null || networks === void 0 ? void 0 : networks.map(function (item, index) {
|
|
359
|
+
},
|
|
360
|
+
} }), (0, jsx_runtime_1.jsxs)(material_1.Box, { sx: {
|
|
361
|
+
display: theme.mixins.row,
|
|
362
|
+
justifyContent: "space-between",
|
|
363
|
+
mt: theme.mixins.customMargin.m16,
|
|
364
|
+
}, children: [(0, jsx_runtime_1.jsx)(sortByBalance_1.default, { name: "Token" }), (0, jsx_runtime_1.jsx)(sortByBalance_1.default, { name: "Balance",
|
|
365
|
+
// sortBalance={sortBalance}
|
|
366
|
+
setSortBalance: setSortBalance })] })] })), receiveTokens === null || receiveTokens === void 0 ? void 0 : receiveTokens.map(function (item, index) {
|
|
367
|
+
var stringifiedTokenData = JSON.stringify(item);
|
|
373
368
|
if (!item)
|
|
374
369
|
return null;
|
|
375
|
-
return ((0, jsx_runtime_1.jsx)(
|
|
376
|
-
}) }) }, "slide_step_".concat(ReceiveStep.
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
370
|
+
return ((0, jsx_runtime_1.jsx)(TokenSelection_1.default, { onClick: handleSelectToken, tokenData: stringifiedTokenData, active: (selectedToken === null || selectedToken === void 0 ? void 0 : selectedToken.id) === item.id }, "token_".concat(item.id, "_").concat(index)));
|
|
371
|
+
})] }) }, "slide_step_".concat(ReceiveStep.SELECT_TOKEN)), (0, jsx_runtime_1.jsx)(react_2.SwiperSlide, { children: (0, jsx_runtime_1.jsx)(material_1.Box, { sx: __assign(__assign({}, theme.mixins.column), { gap: theme.mixins.gaps.g12, display: selectedMethod === ReceiveMethods.RECEIVE_EXTERNAL ? "flex" : "none" }), children: networks === null || networks === void 0 ? void 0 : networks.map(function (item, index) {
|
|
372
|
+
if (!item)
|
|
373
|
+
return null;
|
|
374
|
+
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 }, "network_".concat(item.id, "_").concat(index)));
|
|
375
|
+
}) }) }, "slide_step_".concat(ReceiveStep.SELECT_NETWORK)), (0, jsx_runtime_1.jsx)(react_2.SwiperSlide, { children: (0, jsx_runtime_1.jsxs)(material_1.Box, { sx: {
|
|
376
|
+
display: "flex",
|
|
377
|
+
flexDirection: "column",
|
|
378
|
+
gap: theme.mixins.gaps.g16,
|
|
379
|
+
}, children: [(0, jsx_runtime_1.jsx)("div", { id: "share-receive-info", children: (0, jsx_runtime_1.jsxs)(material_1.Box, { sx: __assign(__assign({ width: "100%" }, theme.mixins.column), { gap: theme.mixins.gaps.g12, backgroundColor: theme.palette.background.tertiary, borderRadius: theme.mixins.customRadius.r16, padding: theme.mixins.customPadding.p16, paddingTop: "5rem", alignItems: "flex-start", position: "relative", marginTop: "4.6875rem" }), children: [(0, jsx_runtime_1.jsx)(material_1.Divider, { sx: {
|
|
380
|
+
color: theme.palette.border.accent,
|
|
381
|
+
width: "100%",
|
|
382
|
+
} }), (0, jsx_runtime_1.jsxs)(material_1.Box, { sx: __assign(__assign({}, theme.mixins.center), { top: 0, width: "fit-content", height: "fit-content", borderRadius: theme.mixins.customRadius.r12, padding: theme.mixins.customPadding.p8 }), children: [(0, jsx_runtime_1.jsx)(QRCode_1.default, { value: qrCodeValue, logo: 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.mixins.center), { padding: theme.mixins.customPadding.p4, borderRadius: 9999, backgroundColor: theme.palette.background.white }), children: (0, jsx_runtime_1.jsx)(Icon_1.default, { crossOrigin: "anonymous", width: 24, height: 24, src: selectedToken === null || selectedToken === void 0 ? void 0 : selectedToken.link, sx: {
|
|
383
|
+
borderRadius: 9999,
|
|
384
|
+
} }) })] }), selectedMethod === ReceiveMethods.RECEIVE_EXTERNAL && ((0, jsx_runtime_1.jsxs)(material_1.Box, { sx: __assign(__assign({}, theme.mixins.column), { gap: theme.mixins.gaps.g4 }), children: [(0, jsx_runtime_1.jsx)(Text_1.default, { sx: __assign({}, theme.mixins.valueDescription), children: "Network" }), (0, jsx_runtime_1.jsxs)(material_1.Box, { sx: __assign({}, theme.mixins.row), onClick: handleBack, children: [(0, jsx_runtime_1.jsxs)(material_1.Box, { component: "button", sx: __assign(__assign({}, theme.mixins.row), { gap: theme.mixins.gaps.g4, cursor: "pointer", transition: "transform 0.3s ease-in-out", "&:active": {
|
|
385
|
+
transform: "translateX(0.5rem)",
|
|
386
|
+
} }), children: [(0, jsx_runtime_1.jsx)(Icon_1.default, { width: 24, height: 24, sx: {
|
|
387
|
+
borderRadius: "9999px",
|
|
388
|
+
}, src: selectedNetwork === null || selectedNetwork === void 0 ? void 0 : selectedNetwork.link }), (0, jsx_runtime_1.jsx)(Text_1.default, { sx: __assign({}, theme.mixins.value), children: selectedNetwork === null || selectedNetwork === void 0 ? void 0 : selectedNetwork.name })] }), (0, jsx_runtime_1.jsx)(material_1.SvgIcon, { sx: { width: 12, height: 12, ml: "auto" }, children: SvgPath_1.IC_CHEVRON_RIGHT })] })] })), (0, jsx_runtime_1.jsxs)(material_1.Box, { sx: __assign(__assign({}, theme.mixins.column), { gap: theme.mixins.gaps.g4 }), children: [(0, jsx_runtime_1.jsxs)(material_1.Box, { sx: __assign(__assign({}, theme.mixins.row), { gap: theme.mixins.gaps.g4 }), children: [(0, jsx_runtime_1.jsx)(Text_1.default, { sx: __assign({}, theme.mixins.valueDescription), children: selectedMethod === ReceiveMethods.RECEIVE_INTERNAL
|
|
389
|
+
? "Internal address"
|
|
390
|
+
: "Address" }), selectedMethod === ReceiveMethods.RECEIVE_INTERNAL && ((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.mixins.warning), children: ["This address is used to receive token by internal transfer. You can not use it for blockchain transaction. If you want to receive token by blockchain, please select the", " ", (0, jsx_runtime_1.jsx)("strong", { children: "Receive External" }), " method instead."] }) }) }))] }), (0, jsx_runtime_1.jsxs)(CopyTextComponent_1.default, { sx: __assign(__assign({}, theme.mixins.row), { justifyContent: "space-between" }), value: receiveAddress || "", children: [(0, jsx_runtime_1.jsx)(Text_1.default, { sx: __assign(__assign({}, theme.mixins.value), { wordBreak: "break-all", maxWidth: "85%" }), children: receiveAddress }), (0, jsx_runtime_1.jsx)(material_1.SvgIcon, { sx: { width: 20, height: 20 }, children: SvgPath_1.IC_COPY })] })] }), (0, jsx_runtime_1.jsx)(material_1.Divider, { sx: {
|
|
391
|
+
color: theme.palette.border.accent,
|
|
392
|
+
width: "100%",
|
|
393
|
+
} }), (0, jsx_runtime_1.jsxs)(material_1.Box, { sx: __assign(__assign({ width: "100%" }, theme.mixins.column), { gap: theme.mixins.gaps.g12 }), children: [!!amount && ((0, jsx_runtime_1.jsx)(LineValue_1.default, { field: (0, jsx_runtime_1.jsx)(Text_1.default, { sx: __assign(__assign({}, theme.mixins.valueDescription), { color: theme.palette.text.accent, fontSize: theme.typography.fontSize13 }), children: "Amount" }), value: (0, jsx_runtime_1.jsxs)(Text_1.default, { sx: __assign(__assign({}, theme.mixins.activityTitle), { fontSize: theme.typography.fontSize13 }), children: [amount, " ", selectedToken === null || selectedToken === void 0 ? void 0 : selectedToken.name] }) })), (0, jsx_runtime_1.jsx)(LineValue_1.default, { field: (0, jsx_runtime_1.jsx)(Text_1.default, { sx: __assign(__assign({}, theme.mixins.valueDescription), { color: theme.palette.text.accent, fontSize: theme.typography.fontSize13 }), children: "Minimum Top Up" }), value: (0, jsx_runtime_1.jsxs)(Text_1.default, { sx: __assign(__assign({}, theme.mixins.activityTitle), { fontSize: theme.typography.fontSize13 }), children: ["0.003 ", selectedNetwork === null || selectedNetwork === void 0 ? void 0 : selectedNetwork.name] }) }), (0, jsx_runtime_1.jsx)(LineValue_1.default, { field: (0, jsx_runtime_1.jsx)(Text_1.default, { sx: __assign(__assign({}, theme.mixins.valueDescription), { color: theme.palette.text.accent, fontSize: theme.typography.fontSize13 }), children: "Top Up Arrival Time" }), value: (0, jsx_runtime_1.jsx)(Text_1.default, { sx: __assign(__assign({}, theme.mixins.activityTitle), { fontSize: theme.typography.fontSize13 }), children: "~ 7 Minutes" }) }), (0, jsx_runtime_1.jsx)(LineValue_1.default, { field: (0, jsx_runtime_1.jsx)(Text_1.default, { sx: __assign(__assign({}, theme.mixins.valueDescription), { color: theme.palette.text.accent, fontSize: theme.typography.fontSize13 }), children: "Withdrawal Arrival Time" }), value: (0, jsx_runtime_1.jsx)(Text_1.default, { sx: __assign(__assign({}, theme.mixins.activityTitle), { fontSize: theme.typography.fontSize13 }), children: "~ 20 Minutes" }) })] }), (0, jsx_runtime_1.jsx)(material_1.Divider, { sx: {
|
|
394
|
+
color: theme.palette.border.accent,
|
|
395
|
+
width: "100%",
|
|
396
|
+
mt: theme.mixins.customMargin.m12,
|
|
397
|
+
} }), !!warningMessage && ((0, jsx_runtime_1.jsx)(material_1.Box, { sx: __assign(__assign({}, theme.mixins.column), { gap: theme.mixins.gaps.g4, backgroundColor: theme.palette.background.white16, borderRadius: theme.mixins.customRadius.r12, padding: theme.mixins.customPadding.p8 }), children: (0, jsx_runtime_1.jsx)(Text_1.default, { sx: __assign({}, theme.mixins.valueDescription), children: warningMessage }) }))] }) }), (0, jsx_runtime_1.jsx)(DrawerComponent_1.default, { ref: amountDrawerRef, sx: {
|
|
398
|
+
width: "100%",
|
|
399
|
+
display: "flex",
|
|
400
|
+
justifyContent: "center",
|
|
401
|
+
}, onOpen: handleAmountModalOpen, trigger: (0, jsx_runtime_1.jsx)(xhub_keyboard_1.Label, { htmlFor: keyboardId, children: (0, jsx_runtime_1.jsxs)(Button_1.default.Text, { sx: {
|
|
402
|
+
fontSize: theme.typography.fontSize14,
|
|
403
|
+
textTransform: "none",
|
|
404
|
+
fontWeight: theme.typography.fontWeight500,
|
|
405
|
+
}, children: [amount ? "Edit" : "+ Set", " amount"] }) }), children: (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", children: (0, jsx_runtime_1.jsx)(ModalLayout_1.default, { onClose: function () { var _a; return (_a = amountDrawerRef.current) === null || _a === void 0 ? void 0 : _a.close(); }, title: (0, jsx_runtime_1.jsxs)(Text_1.default, { sx: __assign({}, theme.mixins.fieldTitle), children: [amount ? "Edit" : "Set", " ", selectedToken === null || selectedToken === void 0 ? void 0 : selectedToken.name, " amount"] }), children: (0, jsx_runtime_1.jsxs)(material_1.Box, { sx: __assign(__assign({}, theme.mixins.column), { gap: theme.mixins.gaps.g12 }), children: [(0, jsx_runtime_1.jsx)(xhub_keyboard_1.Label, { htmlFor: keyboardId, children: (0, jsx_runtime_1.jsx)(xhub_keyboard_1.Input, { ref: amountInputRef, elementsAcceptIds: ["amount-keyboard-id"], value: inputAmount === null || inputAmount === void 0 ? void 0 : inputAmount.toString(), displayType: xhub_keyboard_1.DisplayType.Double, rightElement: (0, jsx_runtime_1.jsx)(Button_1.default.Secondary, { onClick: handleClickMaxAmount, sx: __assign({}, theme.mixins.smallButton), children: "Max" }) }) }), amountError && ((0, jsx_runtime_1.jsx)(Text_1.default, { sx: __assign({}, theme.mixins.validationError), children: amountError })), (0, jsx_runtime_1.jsxs)(material_1.Box, { sx: __assign(__assign({}, theme.mixins.row), { width: "100%", mt: theme.mixins.customMargin.m8, gap: theme.mixins.gaps.g12 }), children: [!!amount && (0, jsx_runtime_1.jsx)(Button_1.default.Text, { onClick: handleUnset, children: "Unset" }), (0, jsx_runtime_1.jsx)(Button_1.default.Primary, { sx: { flex: 1 }, onClick: handleContinue, status: !!amountError ? Button_1.BUTTON_STATUS.DISABLED : Button_1.BUTTON_STATUS.ENABLED, children: "Continue" })] })] }) }) }) })] }) }, "slide_step_".concat(ReceiveStep.SHOW_QR_CODE))] }) }) }) }) }) }));
|
|
407
406
|
});
|
|
408
407
|
exports.ReceiveFunction.displayName = "ReceiveFunction";
|
|
409
408
|
exports.default = exports.ReceiveFunction;
|
|
@@ -9,23 +9,13 @@ var jsx_runtime_1 = require("react/jsx-runtime");
|
|
|
9
9
|
var react_1 = require("react");
|
|
10
10
|
var useEventHandler_1 = require("../../hooks/useEventHandler");
|
|
11
11
|
var useRealtime_1 = __importDefault(require("../../hooks/useRealtime"));
|
|
12
|
-
var Activities_1 = __importDefault(require("../../components/ui/Activities"));
|
|
13
12
|
function EventHandlerProvider(props) {
|
|
14
13
|
var _a = (0, useEventHandler_1.useEventHandler)(), transactionHandler = _a.transactionHandler, walletInfoHandler = _a.walletInfoHandler;
|
|
15
14
|
var _b = (0, useRealtime_1.default)(), pushNotification = _b.pushNotification, transaction = _b.transaction, walletHandlerInfo = _b.walletHandlerInfo;
|
|
16
|
-
var activitiesRef = (0, react_1.useRef)(null);
|
|
17
|
-
var options = props.options;
|
|
18
|
-
var hideDefaultActivities = options === null || options === void 0 ? void 0 : options.hideDefaultActivities;
|
|
19
|
-
var showActivities = (0, react_1.useCallback)(function () {
|
|
20
|
-
var _a;
|
|
21
|
-
if (hideDefaultActivities)
|
|
22
|
-
return;
|
|
23
|
-
(_a = activitiesRef.current) === null || _a === void 0 ? void 0 : _a.openTab(0);
|
|
24
|
-
}, [hideDefaultActivities]);
|
|
25
15
|
(0, react_1.useEffect)(function () {
|
|
26
16
|
if (!transactionHandler || !transaction)
|
|
27
17
|
return;
|
|
28
|
-
var theMessage = transactionHandler(transaction
|
|
18
|
+
var theMessage = transactionHandler(transaction);
|
|
29
19
|
if (theMessage) {
|
|
30
20
|
pushNotification(theMessage);
|
|
31
21
|
}
|
|
@@ -33,6 +23,6 @@ function EventHandlerProvider(props) {
|
|
|
33
23
|
(0, react_1.useEffect)(function () {
|
|
34
24
|
walletInfoHandler === null || walletInfoHandler === void 0 ? void 0 : walletInfoHandler(walletHandlerInfo);
|
|
35
25
|
}, [walletHandlerInfo]);
|
|
36
|
-
return (
|
|
26
|
+
return (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: props.children });
|
|
37
27
|
}
|
|
38
28
|
exports.default = EventHandlerProvider;
|