tek-wallet 0.0.199 → 0.0.201
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.
|
@@ -121,49 +121,49 @@ var DepositFunction = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
121
121
|
updateDepositToken();
|
|
122
122
|
}
|
|
123
123
|
}, [isAuthenticated, depositTokens]);
|
|
124
|
-
return ((0, jsx_runtime_1.jsx)(
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
124
|
+
return ((0, jsx_runtime_1.jsx)(RequireConnect_1.default, { children: (0, jsx_runtime_1.jsx)(DrawerComponent_1.default, { ref: drawerRef, trigger: props.children, onOpen: props.onOpen, onClose: props.onClose, children: (0, jsx_runtime_1.jsx)(ModalLayout_1.default, { overrideHeader: (0, jsx_runtime_1.jsx)(BackHeader_1.default, { sx: {
|
|
125
|
+
width: "100%",
|
|
126
|
+
display: "flex",
|
|
127
|
+
alignItems: "center",
|
|
128
|
+
minHeight: "2rem",
|
|
129
|
+
mb: theme.mixins.customMargin.p20,
|
|
130
|
+
}, overrideBack: handleBack, hideBack: currentStep === DepositStep.SELECT_TOKEN, center: DEPOSIT_STEP_NAME[currentStep], children: (0, jsx_runtime_1.jsx)(CloseModal_1.default, { sx: { marginLeft: "auto" }, onClick: close }) }), children: (0, jsx_runtime_1.jsxs)(SwiperControlled_1.default, { ref: swiperRef, swiperProps: {
|
|
131
|
+
autoHeight: true,
|
|
132
|
+
spaceBetween: 32,
|
|
133
|
+
}, disableSwipe: true, children: [(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, height: "fit-content" }), children: depositTokens === null || depositTokens === void 0 ? void 0 : depositTokens.map(function (item) {
|
|
134
|
+
var stringifiedTokenData = JSON.stringify(item);
|
|
135
|
+
if (!item)
|
|
136
|
+
return null;
|
|
137
|
+
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 }, item.id));
|
|
138
|
+
}) }) }, DepositStep.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 }), children: networks === null || networks === void 0 ? void 0 : networks.map(function (item) {
|
|
139
|
+
if (!item)
|
|
140
|
+
return null;
|
|
141
|
+
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 }, item.id));
|
|
142
|
+
}) }) }, DepositStep.SELECT_NETWORK), (0, jsx_runtime_1.jsx)(react_2.SwiperSlide, { children: (0, jsx_runtime_1.jsxs)(material_1.Box, { sx: {
|
|
143
|
+
display: "flex",
|
|
144
|
+
flexDirection: "column",
|
|
145
|
+
gap: theme.mixins.gaps.g16,
|
|
146
|
+
}, 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.black24, borderRadius: theme.mixins.theBorderRadius.r16, padding: theme.mixins.customPadding.p16, alignItems: "flex-start", backdropFilter: "blur(10px)" }), id: "share-deposit-info", children: [(0, jsx_runtime_1.jsx)(material_1.Box, { sx: {
|
|
147
|
+
width: "fit-content",
|
|
148
|
+
height: "fit-content",
|
|
149
|
+
alignSelf: "center",
|
|
150
|
+
borderRadius: theme.mixins.theBorderRadius.r12,
|
|
151
|
+
overflow: "hidden",
|
|
152
|
+
backgroundColor: theme.palette.background.white,
|
|
153
|
+
backdropFilter: "blur(10px)",
|
|
154
|
+
}, children: (0, jsx_runtime_1.jsx)(QRCode_1.default, { value: qrCodeValue, title: "Deposit ".concat(selectedToken === null || selectedToken === void 0 ? void 0 : selectedToken.name), logo: (0, getIcon_1.default)("ton"), bgColor: "transparent" }) }), (0, jsx_runtime_1.jsxs)(material_1.Box, { sx: __assign(__assign({}, theme.mixins.column), { gap: theme.mixins.gaps.g4, color: "text.white" }), children: [(0, jsx_runtime_1.jsx)(Text_1.default, { sx: __assign({}, theme.mixins.valueDescription), children: "Network" }), (0, jsx_runtime_1.jsxs)(material_1.Box, { component: "button", sx: __assign(__assign({}, theme.mixins.row), { gap: theme.mixins.gaps.g2, cursor: "pointer", transition: "transform 0.3s ease-in-out", "&:active": {
|
|
155
|
+
transform: "translateX(0.5rem)",
|
|
156
|
+
} }), onClick: handleBack, children: [(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)(Icon_1.default, { src: (0, getIcon_1.default)("right_arrow"), width: 10 })] })] }), (0, jsx_runtime_1.jsxs)(material_1.Box, { sx: __assign(__assign({}, theme.mixins.column), { gap: theme.mixins.gaps.g4, color: "text.white" }), children: [(0, jsx_runtime_1.jsx)(Text_1.default, { sx: __assign({}, theme.mixins.valueDescription), children: "Address" }), (0, jsx_runtime_1.jsx)(Text_1.default, { sx: __assign(__assign({}, theme.mixins.value), { wordBreak: "break-all" }), children: (0, jsx_runtime_1.jsx)(CopyTextComponent_1.default, { value: addressByNetwork || "", children: addressByNetwork }) })] }), (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.theBorderRadius.r12, padding: theme.mixins.customPadding.p8 }), children: (0, jsx_runtime_1.jsxs)(Text_1.default, { sx: __assign({}, theme.mixins.valueDescription), children: ["Deposit", " ", (0, jsx_runtime_1.jsxs)("strong", { style: { color: theme.palette.text.white }, children: ["min ", selectedToken === null || selectedToken === void 0 ? void 0 : selectedToken.min_value, " ", selectedToken === null || selectedToken === void 0 ? void 0 : selectedToken.name] }), " ", "and", " ", (0, jsx_runtime_1.jsx)("strong", { style: { color: theme.palette.text.white }, children: "select the correct network" }), ", or you will lose your assets."] }) })] }), (0, jsx_runtime_1.jsxs)(material_1.Box, { sx: __assign(__assign({}, theme.mixins.row), { gap: theme.mixins.gaps.g12, justifyContent: "center" }), children: [(0, jsx_runtime_1.jsx)(CopyTextComponent_1.default, { value: qrCodeValue, children: (0, jsx_runtime_1.jsxs)(Button_1.default.Secondary, { className: "gap-1.5 flex items-center", children: [(0, jsx_runtime_1.jsx)(Text_1.default, { sx: {
|
|
157
|
+
fontSize: theme.typography.fontSize12,
|
|
158
|
+
fontWeight: theme.typography.fontWeight400,
|
|
159
|
+
leading: "typography.leading150",
|
|
160
|
+
textTransform: "capitalize",
|
|
161
|
+
}, children: "Copy" }), (0, jsx_runtime_1.jsx)(Icon_1.default, { src: (0, getIcon_1.default)("copy"), width: 20 })] }) }), (0, jsx_runtime_1.jsx)(Share_1.default, { elementId: "share-deposit-info", children: (0, jsx_runtime_1.jsxs)(Button_1.default.Secondary, { sx: __assign({ gap: theme.mixins.gaps.g4 }, theme.mixins.row), children: [(0, jsx_runtime_1.jsx)(Text_1.default, { sx: {
|
|
162
|
+
fontSize: theme.typography.fontSize12,
|
|
163
|
+
fontWeight: theme.typography.fontWeight400,
|
|
164
|
+
leading: "typography.leading150",
|
|
165
|
+
textTransform: "capitalize",
|
|
166
|
+
}, children: "Share" }), (0, jsx_runtime_1.jsx)(Icon_1.default, { src: (0, getIcon_1.default)("share"), width: 20 })] }) })] })] }) }, DepositStep.SHOW_QR_CODE)] }, depositTokens === null || depositTokens === void 0 ? void 0 : depositTokens.length) }) }) }));
|
|
167
167
|
});
|
|
168
168
|
DepositFunction.displayName = "DepositFunction";
|
|
169
169
|
exports.default = DepositFunction;
|
|
@@ -60,6 +60,7 @@ var ConfirmByPasscode_1 = __importDefault(require("../ConfirmByPasscode"));
|
|
|
60
60
|
var react_1 = require("react");
|
|
61
61
|
var useLockTokenData_1 = __importDefault(require("../../../hooks/useLockTokenData"));
|
|
62
62
|
var Text_1 = __importDefault(require("../Text"));
|
|
63
|
+
var RequireConnect_1 = __importDefault(require("../RequireConnect"));
|
|
63
64
|
var LockTokenError;
|
|
64
65
|
(function (LockTokenError) {
|
|
65
66
|
LockTokenError["TOKEN_NOT_FOUND"] = "Token not found";
|
|
@@ -114,6 +115,6 @@ var LockToken = function (props) {
|
|
|
114
115
|
(0, react_1.useEffect)(function () {
|
|
115
116
|
validateAmount(props.lockData);
|
|
116
117
|
}, [validateAmount]);
|
|
117
|
-
return ((0, jsx_runtime_1.jsx)(
|
|
118
|
+
return ((0, jsx_runtime_1.jsx)(RequireConnect_1.default, { children: (0, jsx_runtime_1.jsx)(ConfirmLayout_1.default, { ref: confirmByPasscodeDrawerRef, action: type_1.ActionConfirm.LOCK, trigger: props.children, 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
119
|
};
|
|
119
120
|
exports.default = LockToken;
|
|
@@ -51,13 +51,16 @@ function RequireConnect(_a) {
|
|
|
51
51
|
var _a;
|
|
52
52
|
(_a = authViewRef.current) === null || _a === void 0 ? void 0 : _a.close();
|
|
53
53
|
};
|
|
54
|
+
var stopPropagation = function (e) {
|
|
55
|
+
e.stopPropagation();
|
|
56
|
+
};
|
|
54
57
|
var handleOpenAuthView = function (e) {
|
|
55
58
|
var _a;
|
|
56
59
|
e.stopPropagation();
|
|
57
60
|
(_a = authViewRef.current) === null || _a === void 0 ? void 0 : _a.open();
|
|
58
61
|
};
|
|
59
62
|
if (!isAuthenticated) {
|
|
60
|
-
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsxs)(material_1.Box, { sx: { position: "relative" }, children: [children, (0, jsx_runtime_1.jsx)(material_1.Box, { sx: { position: "absolute", inset: 0, zIndex: 10 }, onClick: handleOpenAuthView })] }), (0, jsx_runtime_1.jsx)(DrawerComponent_1.default, { ref: authViewRef, direction: DrawerComponent_1.DRAWER_DIRECTION.RIGHT, children: (0, jsx_runtime_1.jsx)(AuthView_1.default, { onBack: backAuthView }) })] }));
|
|
63
|
+
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsxs)(material_1.Box, { sx: { position: "relative" }, children: [children, (0, jsx_runtime_1.jsx)(material_1.Box, { sx: { position: "absolute", inset: 0, zIndex: 10 }, onClick: handleOpenAuthView })] }), (0, jsx_runtime_1.jsx)(DrawerComponent_1.default, { ref: authViewRef, direction: DrawerComponent_1.DRAWER_DIRECTION.RIGHT, onClick: stopPropagation, children: (0, jsx_runtime_1.jsx)(AuthView_1.default, { onBack: backAuthView }) })] }));
|
|
61
64
|
}
|
|
62
65
|
return (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: children });
|
|
63
66
|
}
|