tek-wallet 0.0.769 → 0.0.771
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/ActivitiesTypeSlice/index.js +1 -1
- package/dist/components/TekWallet/components/ui/AssetViewHeader/index.js +1 -1
- package/dist/components/TekWallet/components/ui/PageHeader/index.js +1 -1
- package/dist/components/TekWallet/components/ui/QrCodeReader/index.js +5 -37
- package/dist/components/TekWallet/components/ui/ReceiveFunction/index.js +5 -5
- package/dist/components/TekWallet/components/ui/ScanQRToSend/index.js +1 -1
- package/dist/components/TekWallet/components/views/ActivityView/index.js +1 -1
- package/dist/components/TekWallet/components/views/AssetView/index.js +1 -1
- package/dist/components/TekWallet/components/views/SettingView/index.js +1 -1
- package/dist/components/TekWallet/providers/EventHandlerProvider/index.js +1 -1
- package/dist/components/TekWallet/providers/TekWalletProvider/index.d.ts +4 -2
- package/dist/components/TekWallet/providers/TekWalletProvider/index.js +5 -5
- package/package.json +1 -1
|
@@ -39,7 +39,7 @@ function ActivitiesTypeSlice(props) {
|
|
|
39
39
|
var theme = (0, ThemeProvider_1.useTheme)();
|
|
40
40
|
var _c = (0, useActivities_1.default)(), activities = _c.activities, loadActivities = _c.loadActivities, loadOutActivityType = _c.loadOutActivityType;
|
|
41
41
|
var type = props.type, isActive = props.isActive, limitItems = props.limitItems, sx = props.sx, smartListProps = props.smartListProps;
|
|
42
|
-
var options = (0, TekWalletProvider_1.
|
|
42
|
+
var options = (0, TekWalletProvider_1.useWalletSetup)().options;
|
|
43
43
|
var basePath = (options || {}).basePath;
|
|
44
44
|
var activitiesByType = (0, react_1.useMemo)(function () {
|
|
45
45
|
if (!(type === null || type === void 0 ? void 0 : type.slug))
|
|
@@ -64,7 +64,7 @@ var TekWalletView_1 = require("../../views/TekWalletView");
|
|
|
64
64
|
var Icon_1 = __importDefault(require("../Icon"));
|
|
65
65
|
var AssetViewHeader = function () {
|
|
66
66
|
var _a = (0, useWallet_1.default)(), masterWallet = _a.masterWallet, blockchainWallets = _a.blockchainWallets;
|
|
67
|
-
var options = (0, TekWalletProvider_1.
|
|
67
|
+
var options = (0, TekWalletProvider_1.useWalletSetup)().options;
|
|
68
68
|
var theme = (0, ThemeProvider_1.useTheme)();
|
|
69
69
|
var modalRef = (0, react_1.useRef)(null);
|
|
70
70
|
return ((0, jsx_runtime_1.jsxs)(material_1.Box, { sx: __assign(__assign({}, theme.mixins.row), { justifyContent: "center", position: "relative", boxShadow: "0 0 1px 2px rgba(0, 0, 0, 0.03)" }), children: [(0, jsx_runtime_1.jsx)(DrawerComponent_1.default, { ref: modalRef, trigger: (0, jsx_runtime_1.jsxs)(material_1.Box, { sx: __assign(__assign(__assign({}, theme.mixins.row), { alignItems: "center", justifyContent: "center", textAlign: "center", gap: theme.mixins.gaps.g4, py: theme.mixins.customPadding.p8 }), theme.mixins.value), children: [(0, jsx_runtime_1.jsx)(material_1.SvgIcon, { sx: { width: "1.25rem", height: "1.25rem" }, children: SvgPath_1.WALLET }), (0, compactWalletAddress_1.default)(masterWallet), (0, jsx_runtime_1.jsx)(material_1.SvgIcon, { sx: { width: "0.625rem", height: "0.625rem" }, children: SvgPath_1.ARROW_DROP_DOWN })] }), direction: DrawerComponent_1.DRAWER_DIRECTION.TOP, children: (0, jsx_runtime_1.jsxs)(material_1.Box, { sx: {
|
|
@@ -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.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] }));
|
|
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), { textTransform: "capitalize", color: "inherit" }), children: props.title }), props.children] }));
|
|
25
25
|
};
|
|
26
26
|
exports.default = PageHeader;
|
|
@@ -1,44 +1,11 @@
|
|
|
1
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
2
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
36
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
37
4
|
};
|
|
38
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
6
|
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
40
7
|
var material_1 = require("@mui/material");
|
|
41
|
-
var DrawerComponent_1 =
|
|
8
|
+
var DrawerComponent_1 = __importDefault(require("../DrawerComponent"));
|
|
42
9
|
var react_1 = require("react");
|
|
43
10
|
var react_qr_scanner_1 = require("@yudiel/react-qr-scanner");
|
|
44
11
|
var AppBackDrop_1 = __importDefault(require("../AppBackDrop"));
|
|
@@ -113,18 +80,19 @@ var QrCodeReader = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
113
80
|
}, [isOpen]);
|
|
114
81
|
(0, react_1.useLayoutEffect)(function () {
|
|
115
82
|
var styleTag = document.createElement("style");
|
|
116
|
-
styleTag.innerHTML = "\n @keyframes move-up-down {\n 0% {\n transform: translateY(0%);\n }\n 50% {\n transform: translateY(100%);\n }\n 100% {\n transform: translateY(0%);\n }\n }\n\n .move-up-down-animation {\n animation: move-up-down
|
|
83
|
+
styleTag.innerHTML = "\n @keyframes move-up-down {\n 0% {\n transform: translateY(0%);\n }\n 50% {\n transform: translateY(100%);\n }\n 100% {\n transform: translateY(0%);\n }\n }\n\n .move-up-down-animation {\n animation: move-up-down 4s infinite linear;\n }\n ";
|
|
117
84
|
document.head.appendChild(styleTag);
|
|
118
85
|
return function () {
|
|
119
86
|
styleTag.remove();
|
|
120
87
|
};
|
|
121
88
|
}, []);
|
|
122
89
|
var theme = (0, providers_1.useTheme)();
|
|
123
|
-
|
|
90
|
+
var topOffset = (0, providers_1.useWalletSetup)().topOffset;
|
|
91
|
+
return ((0, jsx_runtime_1.jsx)(DrawerComponent_1.default, { trigger: props.children, ref: drawerRef, onDone: onClose, onOpen: onOpen, sx: sx, className: className, children: (0, jsx_runtime_1.jsx)(ChildPageLayout_1.default, { sx: {
|
|
124
92
|
backgroundColor: "transparent !important",
|
|
125
93
|
}, header: (0, jsx_runtime_1.jsx)(PageHeader_1.default, { hideBack: true, title: "Scan QR code", sx: {
|
|
126
94
|
position: "absolute",
|
|
127
|
-
top: 0,
|
|
95
|
+
top: topOffset || 0,
|
|
128
96
|
left: 0,
|
|
129
97
|
right: 0,
|
|
130
98
|
zIndex: 1001,
|
|
@@ -443,13 +443,13 @@ exports.ReceiveFunction = (0, react_1.forwardRef)(function (_a, ref) {
|
|
|
443
443
|
height: "1rem",
|
|
444
444
|
width: "1px",
|
|
445
445
|
backgroundColor: theme.palette.border.accent3,
|
|
446
|
-
} }), (0, jsx_runtime_1.jsx)(material_1.SvgIcon, { sx: { width: 20, height: 20, display: "block" }, onClick: handleGotoHistory, children: SvgPath_1.IC_HISTORY })] }))] })) }), footer: (0, jsx_runtime_1.
|
|
446
|
+
} }), (0, jsx_runtime_1.jsx)(material_1.SvgIcon, { sx: { width: 20, height: 20, display: "block" }, onClick: handleGotoHistory, children: SvgPath_1.IC_HISTORY })] }))] })) }), footer: (0, jsx_runtime_1.jsxs)(material_1.Box, { sx: {
|
|
447
447
|
maxHeight: currentStep === ReceiveStep.SHOW_QR_CODE ? "120px" : 0,
|
|
448
448
|
overflow: "hidden",
|
|
449
449
|
transition: currentStep === ReceiveStep.SHOW_QR_CODE
|
|
450
450
|
? "max-height 0.3s linear 0.3s"
|
|
451
451
|
: "max-height 0s linear",
|
|
452
|
-
}, 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.jsxs)(SwiperControlled_1.default, { ref: stepSwiperRef, swiperProps: {
|
|
452
|
+
}, children: [false && ((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" }) }) })), (0, jsx_runtime_1.jsx)(BottomActionLayout_1.default, { children: (0, jsx_runtime_1.jsx)(Button_1.default.Primary, { onClick: close, fullWidth: true, children: "Done" }) })] }), children: (0, jsx_runtime_1.jsxs)(SwiperControlled_1.default, { ref: stepSwiperRef, swiperProps: {
|
|
453
453
|
spaceBetween: 32,
|
|
454
454
|
}, disableSwipe: true, initialActiveTab: currentStep - 1, sx: {
|
|
455
455
|
height: "100%",
|
|
@@ -505,7 +505,7 @@ exports.ReceiveFunction = (0, react_1.forwardRef)(function (_a, ref) {
|
|
|
505
505
|
fontWeight: theme.typography.fontWeight600,
|
|
506
506
|
fontSize: theme.typography.fontSize10,
|
|
507
507
|
lineHeight: "100%",
|
|
508
|
-
}, children: "Learn more" }), children: (0, jsx_runtime_1.jsx)(ModalLayout_1.default, { title: "How to choose my top up network", onClose: closeChooseNetworkSupport, 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)(Text_1.default, { component: "div", sx: __assign(__assign({}, theme.mixins.listDescription), { color: theme.palette.text.blackContrast }), children: "
|
|
508
|
+
}, children: "Learn more" }), children: (0, jsx_runtime_1.jsx)(ModalLayout_1.default, { title: "How to choose my top up network?", onClose: closeChooseNetworkSupport, 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)(Text_1.default, { component: "div", sx: __assign(__assign({}, theme.mixins.listDescription), { color: theme.palette.text.blackContrast }), children: "When top up, choose the same network as the one used on the sending platform. For example, if transferring funds using BSC network, select BSC for top up. Otherwise, you may risk losing your assets." }), (0, jsx_runtime_1.jsx)(Text_1.default, { component: "div", sx: __assign(__assign({}, theme.mixins.listDescription), { color: theme.palette.text.blackContrast }), children: "If unsure, test with a small amount and confirm it arrives safely before top up the rest." })] }) }) }), (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: "#044C2F" }) }) })] })] })), networks === null || networks === void 0 ? void 0 : networks.map(function (item, index) {
|
|
509
509
|
if (!item)
|
|
510
510
|
return null;
|
|
511
511
|
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)));
|
|
@@ -539,11 +539,11 @@ exports.ReceiveFunction = (0, react_1.forwardRef)(function (_a, ref) {
|
|
|
539
539
|
alignItems: "start",
|
|
540
540
|
}, 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: "Received user" }), value: (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)(Icon_1.default, { width: 16, height: 16, src: userInfo === null || userInfo === void 0 ? void 0 : userInfo.avatar, sx: {
|
|
541
541
|
borderRadius: "9999px",
|
|
542
|
-
} }), (0, jsx_runtime_1.jsx)(material_1.Box, { sx: __assign(__assign({}, theme.mixins.column), { gap: theme.mixins.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.mixins.valueDescription), { color: theme.palette.text.accent, fontSize: theme.typography.fontSize13 }), children: "Amount" }), value: (0, jsx_runtime_1.jsx)(Text_1.default, { sx: __assign(__assign({}, theme.mixins.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.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.value), { fontSize: theme.typography.fontSize13 }), children: "~
|
|
542
|
+
} }), (0, jsx_runtime_1.jsx)(material_1.Box, { sx: __assign(__assign({}, theme.mixins.column), { gap: theme.mixins.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.mixins.valueDescription), { color: theme.palette.text.accent, fontSize: theme.typography.fontSize13 }), children: "Amount" }), value: (0, jsx_runtime_1.jsx)(Text_1.default, { sx: __assign(__assign({}, theme.mixins.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.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.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.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.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: {
|
|
543
543
|
color: theme.palette.border.accent,
|
|
544
544
|
width: "100%",
|
|
545
545
|
mt: theme.mixins.customMargin.m12,
|
|
546
|
-
} }), (0, jsx_runtime_1.jsx)(Text_1.default, { sx: __assign({}, theme.mixins.valueDescription), children: warningMessage })] }))] }) }), isInternal && ((0, jsx_runtime_1.jsx)(DrawerComponent_1.default, { ref: amountDrawerRef, sx: {
|
|
546
|
+
} }), (0, jsx_runtime_1.jsx)(Text_1.default, { sx: __assign({}, theme.mixins.valueDescription), children: warningMessage })] }))] }) }), isInternal && false && ((0, jsx_runtime_1.jsx)(DrawerComponent_1.default, { ref: amountDrawerRef, sx: {
|
|
547
547
|
width: "100%",
|
|
548
548
|
display: "flex",
|
|
549
549
|
justifyContent: "center",
|
|
@@ -70,7 +70,7 @@ var providers_1 = require("../../../providers");
|
|
|
70
70
|
var TekWalletView_1 = require("../../views/TekWalletView");
|
|
71
71
|
exports.ScanQRToSend = (0, react_1.forwardRef)(function (props, ref) {
|
|
72
72
|
var children = props.children, transferInternalPath = props.transferInternalPath, transferExternalPath = props.transferExternalPath, gotoTransferInternalOverride = props.gotoTransferInternalOverride, gotoTransferExternalOverride = props.gotoTransferExternalOverride, sx = props.sx, className = props.className;
|
|
73
|
-
var options = (0, providers_1.
|
|
73
|
+
var options = (0, providers_1.useWalletSetup)().options;
|
|
74
74
|
var internalPath = transferInternalPath ||
|
|
75
75
|
"".concat((options === null || options === void 0 ? void 0 : options.basePath) || "", "/tek-wallet/").concat(TekWalletView_1.TekWalletViewRoutes.SEND_INTERNAL);
|
|
76
76
|
var externalPath = transferExternalPath ||
|
|
@@ -19,7 +19,7 @@ var TekWalletProvider_1 = require("../../../providers/TekWalletProvider");
|
|
|
19
19
|
var ActivityView = function (props) {
|
|
20
20
|
var sx = props.sx;
|
|
21
21
|
var theme = (0, ThemeProvider_1.useTheme)();
|
|
22
|
-
var options = (0, TekWalletProvider_1.
|
|
22
|
+
var options = (0, TekWalletProvider_1.useWalletSetup)().options;
|
|
23
23
|
var hideBackButtons = (options || {}).hideBackButtons;
|
|
24
24
|
var swiperRef = (0, react_1.useRef)(null);
|
|
25
25
|
var activityTypes = (0, useActivities_1.default)().activityTypes;
|
|
@@ -54,7 +54,7 @@ var AssetView = function (props) {
|
|
|
54
54
|
var sx = props.sx, rest = __rest(props, ["sx"]);
|
|
55
55
|
var _a = (0, useWalletData_1.default)(), isInitPasscode = _a.isInitPasscode, masterWallet = _a.masterWallet;
|
|
56
56
|
var theme = (0, ThemeProvider_1.useTheme)();
|
|
57
|
-
var options = (0, TekWalletProvider_1.
|
|
57
|
+
var options = (0, TekWalletProvider_1.useWalletSetup)().options;
|
|
58
58
|
var _b = options || {}, hideActivitySectionInAssetView = _b.hideActivitySectionInAssetView, useBasicAmountGroupInAssetView = _b.useBasicAmountGroupInAssetView, basePath = _b.basePath;
|
|
59
59
|
var router = (0, useCustomRouter_1.default)();
|
|
60
60
|
var idPrefix = (0, xhub_keyboard_1.useUniqueId)();
|
|
@@ -65,7 +65,7 @@ var SettingView = function (props) {
|
|
|
65
65
|
var _a = props;
|
|
66
66
|
var _b = (0, react_1.useState)(Button_1.BUTTON_STATUS.ENABLED), buttonStatus = _b[0], setButtonStatus = _b[1];
|
|
67
67
|
var theme = (0, providers_1.useTheme)();
|
|
68
|
-
var onLogout = (0, TekWalletProvider_1.
|
|
68
|
+
var onLogout = (0, TekWalletProvider_1.useWalletSetup)().onLogout;
|
|
69
69
|
var handleLogout = function () {
|
|
70
70
|
if (!onLogout)
|
|
71
71
|
return;
|
|
@@ -28,7 +28,7 @@ function EventHandlerProvider(props) {
|
|
|
28
28
|
var _a = (0, useEventHandler_1.useEventHandler)(), transactionHandler = _a.transactionHandler, walletInfoHandler = _a.walletInfoHandler;
|
|
29
29
|
var _b = (0, useRealtime_1.default)(), pushNotification = _b.pushNotification, transaction = _b.transaction, walletHandlerInfo = _b.walletHandlerInfo;
|
|
30
30
|
var router = (0, useCustomRouter_1.default)();
|
|
31
|
-
var options = (0, TekWalletProvider_1.
|
|
31
|
+
var options = (0, TekWalletProvider_1.useWalletSetup)().options;
|
|
32
32
|
(0, react_1.useEffect)(function () {
|
|
33
33
|
router.prefetch("".concat(options === null || options === void 0 ? void 0 : options.basePath, "/tek-wallet/activities/abc"));
|
|
34
34
|
}, [router, options === null || options === void 0 ? void 0 : options.basePath]);
|
|
@@ -18,13 +18,15 @@ export interface TekWalletProviderProps {
|
|
|
18
18
|
accessToken?: string;
|
|
19
19
|
options?: Options;
|
|
20
20
|
onLogout?: () => void;
|
|
21
|
+
topOffset?: number;
|
|
21
22
|
}
|
|
22
23
|
export interface TekWalletContextType {
|
|
23
24
|
isSSO: boolean | undefined;
|
|
24
25
|
options?: Options;
|
|
25
26
|
onLogout?: () => void;
|
|
27
|
+
topOffset?: number;
|
|
26
28
|
}
|
|
27
29
|
export declare const TekWalletContext: import("react").Context<TekWalletContextType>;
|
|
28
|
-
export declare function TekWalletProvider({ children, isSSO, accessToken, options, onLogout, }: TekWalletProviderProps): import("react/jsx-runtime").JSX.Element;
|
|
30
|
+
export declare function TekWalletProvider({ children, isSSO, accessToken, options, topOffset, onLogout, }: TekWalletProviderProps): import("react/jsx-runtime").JSX.Element;
|
|
29
31
|
export default TekWalletProvider;
|
|
30
|
-
export declare const
|
|
32
|
+
export declare const useWalletSetup: () => TekWalletContextType;
|
|
@@ -4,7 +4,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
5
5
|
};
|
|
6
6
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
-
exports.
|
|
7
|
+
exports.useWalletSetup = exports.TekWalletContext = exports.Views = void 0;
|
|
8
8
|
exports.TekWalletProvider = TekWalletProvider;
|
|
9
9
|
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
10
10
|
var react_1 = require("react");
|
|
@@ -30,17 +30,17 @@ var initialTekWalletContext = {
|
|
|
30
30
|
};
|
|
31
31
|
exports.TekWalletContext = (0, react_1.createContext)(initialTekWalletContext);
|
|
32
32
|
function TekWalletProvider(_a) {
|
|
33
|
-
var children = _a.children, isSSO = _a.isSSO, accessToken = _a.accessToken, options = _a.options, onLogout = _a.onLogout;
|
|
33
|
+
var children = _a.children, isSSO = _a.isSSO, accessToken = _a.accessToken, options = _a.options, topOffset = _a.topOffset, onLogout = _a.onLogout;
|
|
34
34
|
var WalletProvider = isSSO ? WalletDataProviderNoImport_1.default : WalletDataProvider_1.default;
|
|
35
35
|
var _b = (0, react_1.useState)("1"), resetTrigger = _b[0], setResetTrigger = _b[1];
|
|
36
36
|
var onDisconnect = function () {
|
|
37
37
|
setResetTrigger(function (prev) { return prev + "1"; });
|
|
38
38
|
};
|
|
39
|
-
return ((0, jsx_runtime_1.jsx)(exports.TekWalletContext.Provider, { value: { isSSO: isSSO, options: options, onLogout: onLogout }, children: (0, jsx_runtime_1.jsx)(WalletProvider, { accessToken: accessToken !== null && accessToken !== void 0 ? accessToken : "", onDisconnect: onDisconnect, children: (0, jsx_runtime_1.jsx)(ThemeProvider_1.CustomThemeProvider, { children: (0, jsx_runtime_1.jsx)(RealtimeProvider_1.default, { options: options, children: (0, jsx_runtime_1.jsx)(ActivitiesProvider_1.default, { children: (0, jsx_runtime_1.jsx)(ReceiveProvider_1.default, { children: (0, jsx_runtime_1.jsx)(LockTokenProvider_1.default, { children: (0, jsx_runtime_1.jsx)(WithdrawProvider_1.default, { children: (0, jsx_runtime_1.jsx)(SwapProvider_1.default, { children: (0, jsx_runtime_1.jsx)(EventHandlerProvider_1.default, { options: options, children: children }) }) }) }) }) }) }) }) }, resetTrigger) }));
|
|
39
|
+
return ((0, jsx_runtime_1.jsx)(exports.TekWalletContext.Provider, { value: { isSSO: isSSO, options: options, onLogout: onLogout, topOffset: topOffset }, children: (0, jsx_runtime_1.jsx)(WalletProvider, { accessToken: accessToken !== null && accessToken !== void 0 ? accessToken : "", onDisconnect: onDisconnect, children: (0, jsx_runtime_1.jsx)(ThemeProvider_1.CustomThemeProvider, { children: (0, jsx_runtime_1.jsx)(RealtimeProvider_1.default, { options: options, children: (0, jsx_runtime_1.jsx)(ActivitiesProvider_1.default, { children: (0, jsx_runtime_1.jsx)(ReceiveProvider_1.default, { children: (0, jsx_runtime_1.jsx)(LockTokenProvider_1.default, { children: (0, jsx_runtime_1.jsx)(WithdrawProvider_1.default, { children: (0, jsx_runtime_1.jsx)(SwapProvider_1.default, { children: (0, jsx_runtime_1.jsx)(EventHandlerProvider_1.default, { options: options, children: children }) }) }) }) }) }) }) }) }, resetTrigger) }));
|
|
40
40
|
}
|
|
41
41
|
exports.default = TekWalletProvider;
|
|
42
|
-
var
|
|
42
|
+
var useWalletSetup = function () {
|
|
43
43
|
var config = (0, react_1.useContext)(exports.TekWalletContext);
|
|
44
44
|
return config;
|
|
45
45
|
};
|
|
46
|
-
exports.
|
|
46
|
+
exports.useWalletSetup = useWalletSetup;
|