tek-wallet 0.0.827 → 0.0.828
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/views/AssetView/index.js +1 -1
- package/dist/components/TekWallet/components/views/ChangePasscodeView/index.d.ts +1 -0
- package/dist/components/TekWallet/components/views/ChangePasscodeView/index.js +11 -11
- package/dist/components/TekWallet/components/views/InitPasscodeView.d.ts +4 -1
- package/dist/components/TekWallet/components/views/InitPasscodeView.js +6 -4
- package/package.json +1 -1
|
@@ -95,7 +95,7 @@ var AssetView = function (props) {
|
|
|
95
95
|
return [2 /*return*/, updateWalletDetail()];
|
|
96
96
|
});
|
|
97
97
|
}); };
|
|
98
|
-
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [!isInitPasscode && !!masterWallet && (0, jsx_runtime_1.jsx)(InitPasscodeView_1.default, {}), !!isInitPasscode && ((0, jsx_runtime_1.jsx)(ChildPageLayout_1.default, { header: !!isInitPasscode && (0, jsx_runtime_1.jsx)(AssetViewHeader_1.default, {}), pullToRefreshProps: {
|
|
98
|
+
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [!isInitPasscode && !!masterWallet && (0, jsx_runtime_1.jsx)(InitPasscodeView_1.default, { useAutoBack: false }), !!isInitPasscode && ((0, jsx_runtime_1.jsx)(ChildPageLayout_1.default, { header: !!isInitPasscode && (0, jsx_runtime_1.jsx)(AssetViewHeader_1.default, {}), pullToRefreshProps: {
|
|
99
99
|
isPullable: !!isInitPasscode,
|
|
100
100
|
onRefresh: handleRefresh,
|
|
101
101
|
}, children: (0, jsx_runtime_1.jsxs)(DefaultPageLayout_1.default, __assign({}, rest, { sx: __assign({ display: "flex", flexDirection: "column", gap: theme.styleMixins.gaps.g16 }, sx), children: [useBasicAmountGroupInAssetView ? (0, jsx_runtime_1.jsx)(BasicAmountGroup_1.default, {}) : (0, jsx_runtime_1.jsx)(AmountGroupAndChart_1.default, {}), (0, jsx_runtime_1.jsx)(Menu_1.default, { sx: {
|
|
@@ -4,6 +4,7 @@ interface ChangePasscodeViewProps extends GeneralProps {
|
|
|
4
4
|
isInitPasscode?: boolean;
|
|
5
5
|
idPrefix?: string;
|
|
6
6
|
hideBackInFirstStep?: boolean;
|
|
7
|
+
useAutoBack?: boolean;
|
|
7
8
|
}
|
|
8
9
|
export declare const ChangePasscodeView: (props: ChangePasscodeViewProps) => import("react/jsx-runtime").JSX.Element;
|
|
9
10
|
export default ChangePasscodeView;
|
|
@@ -106,7 +106,7 @@ var useWarningWrongPasscode_1 = require("../../../hooks/useWarningWrongPasscode"
|
|
|
106
106
|
var providers_1 = require("../../../providers");
|
|
107
107
|
var passcodeLength = 6;
|
|
108
108
|
var ChangePasscodeView = function (props) {
|
|
109
|
-
var _a = props.isInitPasscode, isInitPasscode = _a === void 0 ? false : _a, _b = props.idPrefix, idPrefix = _b === void 0 ? "" : _b, _c = props.hideBackInFirstStep, hideBackInFirstStep = _c === void 0 ? false : _c;
|
|
109
|
+
var _a = props.isInitPasscode, isInitPasscode = _a === void 0 ? false : _a, _b = props.idPrefix, idPrefix = _b === void 0 ? "" : _b, _c = props.hideBackInFirstStep, hideBackInFirstStep = _c === void 0 ? false : _c, _d = props.useAutoBack, useAutoBack = _d === void 0 ? true : _d;
|
|
110
110
|
var initStep = (0, react_2.useRef)(isInitPasscode
|
|
111
111
|
? type_1.ChangePasscodeViewStep.ENTER_NEW_PASSCODE
|
|
112
112
|
: type_1.ChangePasscodeViewStep.ENTER_OLD_PASSCODE);
|
|
@@ -115,15 +115,15 @@ var ChangePasscodeView = function (props) {
|
|
|
115
115
|
? const_2.STEPS_CONTENT_FOR_INIT_PASSCODE
|
|
116
116
|
: const_1.STEPS_CONTENT_FOR_CHANGE_PASSCODE;
|
|
117
117
|
var theme = (0, mui_1.useTheme)();
|
|
118
|
-
var
|
|
119
|
-
var
|
|
120
|
-
var
|
|
118
|
+
var _e = (0, react_2.useState)(""), oldPasscode = _e[0], setOldPasscode = _e[1];
|
|
119
|
+
var _f = (0, react_2.useState)(""), newPasscode = _f[0], setNewPasscode = _f[1];
|
|
120
|
+
var _g = (0, react_2.useState)(""), confirmPasscode = _g[0], setConfirmPasscode = _g[1];
|
|
121
121
|
var swiperControlledRef = (0, react_2.useRef)(null);
|
|
122
122
|
var childPageLayoutRef = (0, react_2.useRef)(null);
|
|
123
|
-
var
|
|
124
|
-
var
|
|
123
|
+
var _h = (0, react_2.useState)(initStep.current), currentStep = _h[0], setCurrentStep = _h[1];
|
|
124
|
+
var _j = (0, react_2.useState)(null), error = _j[0], setError = _j[1];
|
|
125
125
|
var hideBack = currentStep === initStep.current && hideBackInFirstStep;
|
|
126
|
-
var
|
|
126
|
+
var _k = (0, useWarningWrongPasscode_1.useValidatePasscode)(), handleVerifyPasscode = _k.handleVerifyPasscode, warningContent = _k.warningContent, isLocked = _k.isLocked, handleClearUnknownError = _k.handleClearUnknownError, unknownError = _k.unknownError;
|
|
127
127
|
var resetValue = function () {
|
|
128
128
|
var _a;
|
|
129
129
|
handleClearUnknownError();
|
|
@@ -240,7 +240,7 @@ var ChangePasscodeView = function (props) {
|
|
|
240
240
|
if (res.success) {
|
|
241
241
|
(_d = childPageLayoutRef.current) === null || _d === void 0 ? void 0 : _d.showSuccess();
|
|
242
242
|
setTimeout(function () {
|
|
243
|
-
handleDone();
|
|
243
|
+
useAutoBack && handleDone();
|
|
244
244
|
}, 1000);
|
|
245
245
|
}
|
|
246
246
|
else {
|
|
@@ -272,7 +272,7 @@ var ChangePasscodeView = function (props) {
|
|
|
272
272
|
if (res.success) {
|
|
273
273
|
(_d = childPageLayoutRef.current) === null || _d === void 0 ? void 0 : _d.showSuccess();
|
|
274
274
|
setTimeout(function () {
|
|
275
|
-
handleDone();
|
|
275
|
+
useAutoBack && handleDone();
|
|
276
276
|
}, 1000);
|
|
277
277
|
}
|
|
278
278
|
else {
|
|
@@ -319,7 +319,7 @@ var ChangePasscodeView = function (props) {
|
|
|
319
319
|
return { value: confirmPasscode, onChange: handleConfirmPasscodeChange };
|
|
320
320
|
}
|
|
321
321
|
};
|
|
322
|
-
var
|
|
322
|
+
var _l = getValueAndHandlerByStep(currentStep), value = _l.value, onChange = _l.onChange;
|
|
323
323
|
var keyboardId = (0, react_2.useMemo)(function () { return "".concat(idPrefix, "-").concat(isInitPasscode ? "init" : "change", "-passcode-keyboard"); }, [isInitPasscode, idPrefix]);
|
|
324
324
|
var keyboardThemeMode = (0, providers_1.useKeyboardThemeMode)();
|
|
325
325
|
var offset = (0, providers_1.useWalletSetup)().offset;
|
|
@@ -349,7 +349,7 @@ var ChangePasscodeView = function (props) {
|
|
|
349
349
|
alignItems: "center",
|
|
350
350
|
gap: "1rem",
|
|
351
351
|
height: "100%",
|
|
352
|
-
}, children: [(0, jsx_runtime_1.jsx)(Text_1.default, { sx: __assign({}, theme.styleMixins.sessionTitle), children: stepsContent[type_1.ChangePasscodeViewStep.ENTER_OLD_PASSCODE].title }), (0, jsx_runtime_1.jsx)(xhub_keyboard_1.Label, { ref: labelRef, useBrowserInput: false, htmlFor: keyboardId,
|
|
352
|
+
}, children: [(0, jsx_runtime_1.jsx)(Text_1.default, { sx: __assign({}, theme.styleMixins.sessionTitle), children: stepsContent[type_1.ChangePasscodeViewStep.ENTER_OLD_PASSCODE].title }), (0, jsx_runtime_1.jsx)(xhub_keyboard_1.Label, { ref: labelRef, useBrowserInput: false, htmlFor: keyboardId, children: (0, jsx_runtime_1.jsx)(OTP_1.default, { value: oldPasscode, numInputs: passcodeLength, otpInputType: OTP_1.OtpInputType.PASSWORD, readOnly: true }) }), unknownError, warningContent, !!error && ((0, jsx_runtime_1.jsx)(Text_1.default, { sx: __assign(__assign({}, theme.styleMixins.validationError), { alignSelf: "left" }), children: error })), (0, jsx_runtime_1.jsx)(Text_1.default, { sx: __assign({}, theme.styleMixins.sessionDescription), children: stepsContent[type_1.ChangePasscodeViewStep.ENTER_OLD_PASSCODE].description })] }) }), (0, jsx_runtime_1.jsx)(react_1.SwiperSlide, { children: (0, jsx_runtime_1.jsxs)(material_1.Box, { sx: {
|
|
353
353
|
display: "flex",
|
|
354
354
|
flexDirection: "column",
|
|
355
355
|
justifyContent: "center",
|
|
@@ -1,2 +1,5 @@
|
|
|
1
|
-
|
|
1
|
+
export interface InitPasscodeViewProps {
|
|
2
|
+
useAutoBack?: boolean;
|
|
3
|
+
}
|
|
4
|
+
declare function InitPasscodeView(props: InitPasscodeViewProps): import("react/jsx-runtime").JSX.Element;
|
|
2
5
|
export default InitPasscodeView;
|
|
@@ -7,12 +7,14 @@ var jsx_runtime_1 = require("react/jsx-runtime");
|
|
|
7
7
|
var useCustomRouter_1 = __importDefault(require("../../hooks/useCustomRouter"));
|
|
8
8
|
var ChangePasscodeView_1 = __importDefault(require("./ChangePasscodeView"));
|
|
9
9
|
var xhub_keyboard_1 = require("xhub-keyboard");
|
|
10
|
-
|
|
10
|
+
var react_1 = require("react");
|
|
11
|
+
function InitPasscodeView(props) {
|
|
12
|
+
var _a = props.useAutoBack, useAutoBack = _a === void 0 ? true : _a;
|
|
11
13
|
var idPrefix = (0, xhub_keyboard_1.useUniqueId)();
|
|
12
14
|
var router = (0, useCustomRouter_1.default)();
|
|
13
|
-
var handleBackInitPasscodeView = function () {
|
|
15
|
+
var handleBackInitPasscodeView = (0, react_1.useCallback)(function () {
|
|
14
16
|
router.back();
|
|
15
|
-
};
|
|
16
|
-
return ((0, jsx_runtime_1.jsx)(ChangePasscodeView_1.default, { hideBackInFirstStep: true, isInitPasscode: true, onBack: handleBackInitPasscodeView, idPrefix: idPrefix }));
|
|
17
|
+
}, [router]);
|
|
18
|
+
return ((0, jsx_runtime_1.jsx)(ChangePasscodeView_1.default, { hideBackInFirstStep: true, isInitPasscode: true, onBack: handleBackInitPasscodeView, idPrefix: idPrefix, useAutoBack: useAutoBack }));
|
|
17
19
|
}
|
|
18
20
|
exports.default = InitPasscodeView;
|