tek-wallet 0.0.723 → 0.0.726
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/DrawerComponent/index.d.ts +2 -0
- package/dist/components/TekWallet/components/ui/DrawerComponent/index.js +9 -12
- package/dist/components/TekWallet/components/ui/IncomeWallet/components/WealthDeposit.js +3 -5
- package/dist/components/TekWallet/components/ui/IncomeWallet/components/WealthWithdraw.js +1 -5
- package/dist/components/TekWallet/components/ui/IncomeWallet/index.d.ts +1 -0
- package/dist/components/TekWallet/components/ui/IncomeWallet/index.js +1 -2
- package/package.json +1 -1
|
@@ -18,6 +18,8 @@ export interface DrawerComponentProps extends Omit<GeneralProps, "onClick" | "sx
|
|
|
18
18
|
direction?: DRAWER_DIRECTION;
|
|
19
19
|
disableSwipe?: boolean;
|
|
20
20
|
triggerStatus?: DRAWER_TRIGGER_STATUS;
|
|
21
|
+
onDismiss?: () => void;
|
|
22
|
+
draggable?: boolean;
|
|
21
23
|
}
|
|
22
24
|
export interface DrawerComponentRef {
|
|
23
25
|
open: () => void;
|
|
@@ -39,10 +39,9 @@ var DRAWER_TRIGGER_STATUS;
|
|
|
39
39
|
DRAWER_TRIGGER_STATUS["DISABLED"] = "DISABLED";
|
|
40
40
|
})(DRAWER_TRIGGER_STATUS || (exports.DRAWER_TRIGGER_STATUS = DRAWER_TRIGGER_STATUS = {}));
|
|
41
41
|
var DrawerComponent = (0, react_1.forwardRef)(function (props, ref) {
|
|
42
|
-
var onOpen = props.onOpen, onClose = props.onClose, onToggle = props.onToggle, sx = props.sx, trigger = props.trigger, direction = props.direction, children = props.children,
|
|
42
|
+
var onOpen = props.onOpen, onClose = props.onClose, onToggle = props.onToggle, sx = props.sx, trigger = props.trigger, direction = props.direction, children = props.children, _a = props.triggerStatus, triggerStatus = _a === void 0 ? DRAWER_TRIGGER_STATUS.ENABLED : _a, onDismiss = props.onDismiss, draggable = props.draggable, rest = __rest(props, ["onOpen", "onClose", "onToggle", "sx", "trigger", "direction", "children", "triggerStatus", "onDismiss", "draggable"]);
|
|
43
43
|
var _b = (0, react_1.useState)(false), isShowDrawerComponent = _b[0], setIsShowDrawerComponent = _b[1];
|
|
44
44
|
var _c = (0, react_1.useState)(undefined), isOpen = _c[0], setIsOpen = _c[1];
|
|
45
|
-
var DrawerComponent = (0, react_1.useMemo)(function () { return (isOpen !== undefined || disableSwipe ? material_1.Drawer : material_1.SwipeableDrawer); }, [isOpen, disableSwipe]);
|
|
46
45
|
var lockStatus = function () {
|
|
47
46
|
setIsOpen(isShowDrawerComponent);
|
|
48
47
|
};
|
|
@@ -70,12 +69,6 @@ var DrawerComponent = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
70
69
|
var newState = !isShowDrawerComponent;
|
|
71
70
|
setIsShowDrawerComponent(newState);
|
|
72
71
|
onToggle === null || onToggle === void 0 ? void 0 : onToggle(newState);
|
|
73
|
-
if (newState) {
|
|
74
|
-
onOpen === null || onOpen === void 0 ? void 0 : onOpen();
|
|
75
|
-
}
|
|
76
|
-
else {
|
|
77
|
-
onClose === null || onClose === void 0 ? void 0 : onClose();
|
|
78
|
-
}
|
|
79
72
|
};
|
|
80
73
|
(0, react_1.useImperativeHandle)(ref, function () { return ({
|
|
81
74
|
open: handleOpen,
|
|
@@ -83,21 +76,25 @@ var DrawerComponent = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
83
76
|
lockStatus: lockStatus,
|
|
84
77
|
unlockStatus: unlockStatus,
|
|
85
78
|
}); });
|
|
86
|
-
var onDrawerClose = function (
|
|
79
|
+
var onDrawerClose = function () {
|
|
87
80
|
setIsShowDrawerComponent(false);
|
|
88
|
-
|
|
81
|
+
onDismiss === null || onDismiss === void 0 ? void 0 : onDismiss();
|
|
89
82
|
};
|
|
90
83
|
var onDrawerOpen = function (e) {
|
|
91
84
|
setIsShowDrawerComponent(true);
|
|
92
85
|
onOpen === null || onOpen === void 0 ? void 0 : onOpen(e);
|
|
93
86
|
};
|
|
94
|
-
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(material_1.Box, { sx: __assign({
|
|
87
|
+
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(material_1.Box, { sx: __assign({}, sx), onClick: toggle, children: trigger }), (0, jsx_runtime_1.jsx)(material_1.SwipeableDrawer, __assign({}, rest, { disableSwipeToOpen: true, sx: {
|
|
95
88
|
"& .MuiDrawer-paper": {
|
|
96
89
|
backgroundColor: "transparent",
|
|
97
90
|
overflow: "hidden",
|
|
98
91
|
boxShadow: "none",
|
|
99
92
|
},
|
|
100
|
-
}, anchor: direction ||
|
|
93
|
+
}, anchor: direction || "bottom", open: isOpen !== null && isOpen !== void 0 ? isOpen : isShowDrawerComponent, onOpen: onDrawerOpen, onClose: onDrawerClose, ModalProps: {
|
|
94
|
+
onBackdropClick: function () {
|
|
95
|
+
onDismiss === null || onDismiss === void 0 ? void 0 : onDismiss();
|
|
96
|
+
},
|
|
97
|
+
}, draggable: draggable, children: children }))] }));
|
|
101
98
|
});
|
|
102
99
|
DrawerComponent.displayName = "DrawerComponent";
|
|
103
100
|
exports.default = DrawerComponent;
|
|
@@ -49,18 +49,16 @@ function WealthDeposit(props) {
|
|
|
49
49
|
var _a, _b;
|
|
50
50
|
var drawerRef = (0, react_1.useRef)(null);
|
|
51
51
|
var handleOnClose = function () {
|
|
52
|
-
var _a
|
|
52
|
+
var _a;
|
|
53
53
|
(_a = drawerRef.current) === null || _a === void 0 ? void 0 : _a.close();
|
|
54
|
-
(_b = props.onClose) === null || _b === void 0 ? void 0 : _b.call(props);
|
|
55
54
|
};
|
|
56
55
|
var close = function () {
|
|
57
|
-
var _a
|
|
56
|
+
var _a;
|
|
58
57
|
(_a = drawerRef.current) === null || _a === void 0 ? void 0 : _a.close();
|
|
59
|
-
(_b = props.onClose) === null || _b === void 0 ? void 0 : _b.call(props);
|
|
60
58
|
};
|
|
61
59
|
var keyboardId = (0, useUniqueId_1.useUniqueId)("wealth-deposit-keyboard");
|
|
62
60
|
var keyboardRef = (0, react_1.useRef)(null);
|
|
63
|
-
return ((0, jsx_runtime_1.jsx)(DrawerComponent_1.default, { ref: drawerRef, trigger: props.children,
|
|
61
|
+
return ((0, jsx_runtime_1.jsx)(DrawerComponent_1.default, { ref: drawerRef, trigger: props.children, onDismiss: props.onClose, direction: DrawerComponent_1.DRAWER_DIRECTION.RIGHT, children: (0, jsx_runtime_1.jsx)(xhub_keyboard_1.Keyboard, { ref: keyboardRef, id: keyboardId, value: props.amount, onChange: function (value) {
|
|
64
62
|
var _a;
|
|
65
63
|
(_a = props === null || props === void 0 ? void 0 : props.setAmount) === null || _a === void 0 ? void 0 : _a.call(props, value);
|
|
66
64
|
}, keyboardType: xhub_keyboard_1.KeyboardType.Double, layoutType: xhub_keyboard_1.LayoutType.Integer, viewFullHeight: true, children: (0, jsx_runtime_1.jsx)(ModalLayout_1.default, { onClose: close, fullScreen: true, backgroundColor: "#fff", overrideHeader: (0, jsx_runtime_1.jsx)(PageHeader_1.default, { title: "Topup", overrideBack: handleOnClose, sx: {
|
|
@@ -50,18 +50,14 @@ function WealthWithdraw(props) {
|
|
|
50
50
|
var _a, _b;
|
|
51
51
|
var drawerRef = (0, react_1.useRef)(null);
|
|
52
52
|
var handleOnClose = function () {
|
|
53
|
-
var _a;
|
|
54
53
|
(0, ref_extension_1.safeCloseDrawer)(drawerRef);
|
|
55
|
-
(_a = props.onClose) === null || _a === void 0 ? void 0 : _a.call(props);
|
|
56
54
|
};
|
|
57
55
|
var close = function () {
|
|
58
|
-
var _a;
|
|
59
56
|
(0, ref_extension_1.safeCloseDrawer)(drawerRef);
|
|
60
|
-
(_a = props.onClose) === null || _a === void 0 ? void 0 : _a.call(props);
|
|
61
57
|
};
|
|
62
58
|
var keyboardId = (0, useUniqueId_1.useUniqueId)("wealth-withdraw-keyboard");
|
|
63
59
|
var keyboardRef = (0, react_1.useRef)(null);
|
|
64
|
-
return ((0, jsx_runtime_1.jsx)(DrawerComponent_1.default, { ref: drawerRef, trigger: props.children,
|
|
60
|
+
return ((0, jsx_runtime_1.jsx)(DrawerComponent_1.default, { ref: drawerRef, trigger: props.children, onDismiss: props.onClose, direction: DrawerComponent_1.DRAWER_DIRECTION.RIGHT, children: (0, jsx_runtime_1.jsx)(xhub_keyboard_1.Keyboard, { ref: keyboardRef, id: keyboardId, value: props.amount, onChange: function (value) {
|
|
65
61
|
var _a;
|
|
66
62
|
(_a = props === null || props === void 0 ? void 0 : props.setAmount) === null || _a === void 0 ? void 0 : _a.call(props, value);
|
|
67
63
|
}, keyboardType: xhub_keyboard_1.KeyboardType.Double, layoutType: xhub_keyboard_1.LayoutType.Integer, viewFullHeight: true, children: (0, jsx_runtime_1.jsx)(ModalLayout_1.default, { onClose: close, fullScreen: true, backgroundColor: "#fff", overrideHeader: (0, jsx_runtime_1.jsx)(PageHeader_1.default, { title: "Withdraw", overrideBack: handleOnClose, sx: {
|
|
@@ -2,6 +2,7 @@ interface IncomeWalletProps {
|
|
|
2
2
|
listItemFunction: React.ReactNode[];
|
|
3
3
|
transactionHistory: React.ReactNode;
|
|
4
4
|
balanceChart: React.ReactNode;
|
|
5
|
+
header?: React.ReactNode;
|
|
5
6
|
}
|
|
6
7
|
export declare const IncomeWallet: (props: IncomeWalletProps) => import("react/jsx-runtime").JSX.Element;
|
|
7
8
|
export default IncomeWallet;
|
|
@@ -22,13 +22,12 @@ var useWalletData_1 = __importDefault(require("../../../hooks/useWalletData"));
|
|
|
22
22
|
var ThemeProvider_1 = require("../../../providers/ThemeProvider");
|
|
23
23
|
var Text_1 = __importDefault(require("../Text"));
|
|
24
24
|
var ChildPageLayout_1 = __importDefault(require("../../layouts/ChildPageLayout"));
|
|
25
|
-
var PageHeader_1 = __importDefault(require("../PageHeader"));
|
|
26
25
|
var Column_1 = __importDefault(require("../Column"));
|
|
27
26
|
var Spacer_1 = __importDefault(require("../Spacer"));
|
|
28
27
|
var IncomeWallet = function (props) {
|
|
29
28
|
var isInitPasscode = (0, useWalletData_1.default)().isInitPasscode;
|
|
30
29
|
var theme = (0, ThemeProvider_1.useTheme)();
|
|
31
|
-
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [!isInitPasscode && ((0, jsx_runtime_1.jsx)(Text_1.default, { sx: __assign({}, theme.mixins.sessionDescription), children: "Please connect your wallet to get asset information" })), !!isInitPasscode && ((0, jsx_runtime_1.jsx)(ChildPageLayout_1.default, __assign({}, props, { header:
|
|
30
|
+
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [!isInitPasscode && ((0, jsx_runtime_1.jsx)(Text_1.default, { sx: __assign({}, theme.mixins.sessionDescription), children: "Please connect your wallet to get asset information" })), !!isInitPasscode && ((0, jsx_runtime_1.jsx)(ChildPageLayout_1.default, __assign({}, props, { header: props.header, children: (0, jsx_runtime_1.jsxs)(Column_1.default, { sx: {
|
|
32
31
|
paddingLeft: theme.mixins.customPadding.p16,
|
|
33
32
|
paddingRight: theme.mixins.customPadding.p16,
|
|
34
33
|
}, children: [props.balanceChart, (0, jsx_runtime_1.jsx)(material_1.Box, { sx: {
|