tek-wallet 0.0.179 → 0.0.181
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.
|
@@ -36,6 +36,12 @@ var DrawerComponent = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
36
36
|
var onOpen = props.onOpen, onClose = props.onClose, onToggle = props.onToggle, sx = props.sx, trigger = props.trigger, direction = props.direction, children = props.children, rest = __rest(props, ["onOpen", "onClose", "onToggle", "sx", "trigger", "direction", "children"]);
|
|
37
37
|
var _b = (0, react_1.useState)(false), isShowDrawerComponent = _b[0], setIsShowDrawerComponent = _b[1];
|
|
38
38
|
var isOpen = (0, react_1.useRef)(undefined);
|
|
39
|
+
var DrawerElement = (0, react_1.useMemo)(function () {
|
|
40
|
+
if (isOpen.current === undefined) {
|
|
41
|
+
return material_1.SwipeableDrawer;
|
|
42
|
+
}
|
|
43
|
+
return material_1.Drawer;
|
|
44
|
+
}, [isOpen]);
|
|
39
45
|
var handleOpen = function () {
|
|
40
46
|
setIsShowDrawerComponent(true);
|
|
41
47
|
};
|
|
@@ -64,13 +70,13 @@ var DrawerComponent = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
64
70
|
setIsShowDrawerComponent(true);
|
|
65
71
|
onOpen === null || onOpen === void 0 ? void 0 : onOpen(e);
|
|
66
72
|
};
|
|
67
|
-
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(material_1.Box, { sx: sx, onClick: toggle, children: trigger }), (0, jsx_runtime_1.jsx)(
|
|
73
|
+
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(material_1.Box, { sx: sx, onClick: toggle, children: trigger }), (0, jsx_runtime_1.jsx)(DrawerElement, __assign({}, rest, { sx: {
|
|
68
74
|
"& .MuiDrawer-paper": {
|
|
69
75
|
backgroundColor: "transparent",
|
|
70
76
|
overflow: "hidden",
|
|
71
77
|
boxShadow: "none",
|
|
72
78
|
},
|
|
73
|
-
},
|
|
79
|
+
}, anchor: direction || "bottom", open: (_a = isOpen.current) !== null && _a !== void 0 ? _a : isShowDrawerComponent, onOpen: onDrawerOpen, onClose: onDrawerClose, children: children }))] }));
|
|
74
80
|
});
|
|
75
81
|
DrawerComponent.displayName = "DrawerComponent";
|
|
76
82
|
exports.default = DrawerComponent;
|
|
@@ -114,6 +114,6 @@ var LockToken = function (props) {
|
|
|
114
114
|
(0, react_1.useEffect)(function () {
|
|
115
115
|
validateAmount(props.lockData);
|
|
116
116
|
}, [validateAmount]);
|
|
117
|
-
return ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: (0, jsx_runtime_1.jsx)(ConfirmLayout_1.default, { ref: confirmByPasscodeDrawerRef, action: type_1.ActionConfirm.LOCK, trigger: props.trigger, children: (0, jsx_runtime_1.jsxs)(material_1.Box, { sx: __assign(__assign({}, theme.mixins.column), { gap: theme.mixins.gaps.g16 }), children: [(0, jsx_runtime_1.jsx)(material_1.Box, { sx: __assign({}, theme.mixins.paper), children: (0, jsx_runtime_1.jsxs)(material_1.Box, { sx: __assign({}, theme.mixins.column), children: [(0, jsx_runtime_1.jsx)(LineValue_1.default, { field: "Amount", value: (0, jsx_runtime_1.jsx)(Formatter_1.default, { value: props.lockData.amount, unit: token === null || token === void 0 ? void 0 : token.name }) }), (0, jsx_runtime_1.jsxs)(Text_1.default, { sx: __assign(__assign({}, theme.mixins.validationError), { mt: theme.mixins.gaps.g6 }), children: [error, " ", !!errorAmount && ((0, jsx_runtime_1.jsx)(Formatter_1.default, { value: errorAmount, unit: token === null || token === void 0 ? void 0 : token.name }))] })] }) }), (0, jsx_runtime_1.jsx)(ConfirmByPasscode_1.default, { action: type_1.ActionConfirm.LOCK, onConfirmSuccess: handleLockToken, children: (0, jsx_runtime_1.jsx)(Button_1.default.Primary, { status: !!error ? Button_1.BUTTON_STATUS.DISABLED : buttonStatus, sx: { width: "100%" }, children: "Confirm" }) })] }) }) }));
|
|
117
|
+
return ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: (0, jsx_runtime_1.jsx)(ConfirmLayout_1.default, { ref: confirmByPasscodeDrawerRef, action: type_1.ActionConfirm.LOCK, trigger: props.trigger, children: (0, jsx_runtime_1.jsxs)(material_1.Box, { sx: __assign(__assign({}, theme.mixins.column), { gap: theme.mixins.gaps.g16 }), children: [(0, jsx_runtime_1.jsx)(material_1.Box, { sx: __assign({}, theme.mixins.paper), children: (0, jsx_runtime_1.jsxs)(material_1.Box, { sx: __assign({}, theme.mixins.column), children: [(0, jsx_runtime_1.jsx)(LineValue_1.default, { field: "Amount", value: (0, jsx_runtime_1.jsx)(Formatter_1.default, { value: props.lockData.amount, unit: token === null || token === void 0 ? void 0 : token.name }) }), !!error && ((0, jsx_runtime_1.jsxs)(Text_1.default, { sx: __assign(__assign({}, theme.mixins.validationError), { mt: theme.mixins.gaps.g6 }), children: [error, " ", !!errorAmount && ((0, jsx_runtime_1.jsx)(Formatter_1.default, { value: errorAmount, unit: token === null || token === void 0 ? void 0 : token.name }))] }))] }) }), (0, jsx_runtime_1.jsx)(ConfirmByPasscode_1.default, { action: type_1.ActionConfirm.LOCK, onConfirmSuccess: handleLockToken, children: (0, jsx_runtime_1.jsx)(Button_1.default.Primary, { status: !!error ? Button_1.BUTTON_STATUS.DISABLED : buttonStatus, sx: { width: "100%" }, children: "Confirm" }) })] }) }) }));
|
|
118
118
|
};
|
|
119
119
|
exports.default = LockToken;
|