tek-wallet 0.0.98 → 0.0.100
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.
|
@@ -7,8 +7,5 @@ interface CustomOtpInputProps extends Omit<OTPInputProps, "renderInput"> {
|
|
|
7
7
|
otpInputType?: OtpInputType;
|
|
8
8
|
renderInput?: (inputProps: InputProps, index: number) => React.ReactNode;
|
|
9
9
|
}
|
|
10
|
-
|
|
11
|
-
blur: () => void;
|
|
12
|
-
};
|
|
13
|
-
declare const CustomOtpInput: import("react").ForwardRefExoticComponent<CustomOtpInputProps & import("react").RefAttributes<CustomOtpInputRef>>;
|
|
10
|
+
declare const CustomOtpInput: (props: CustomOtpInputProps) => import("react/jsx-runtime").JSX.Element;
|
|
14
11
|
export default CustomOtpInput;
|
|
@@ -27,23 +27,17 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
27
27
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
28
28
|
exports.OtpInputType = void 0;
|
|
29
29
|
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
30
|
-
var react_1 = require("react");
|
|
31
30
|
var react_otp_input_1 = __importDefault(require("react-otp-input"));
|
|
32
31
|
var OtpInputType;
|
|
33
32
|
(function (OtpInputType) {
|
|
34
33
|
OtpInputType["TEXT"] = "text";
|
|
35
34
|
OtpInputType["PASSWORD"] = "password";
|
|
36
35
|
})(OtpInputType || (exports.OtpInputType = OtpInputType = {}));
|
|
37
|
-
var CustomOtpInput =
|
|
36
|
+
var CustomOtpInput = function (props) {
|
|
38
37
|
var otpInputType = props.otpInputType, rest = __rest(props, ["otpInputType"]);
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
var _a;
|
|
43
|
-
(_a = blurButtonRef.current) === null || _a === void 0 ? void 0 : _a.click();
|
|
44
|
-
},
|
|
45
|
-
}); });
|
|
46
|
-
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)("button", { ref: blurButtonRef, style: { display: "none" } }), otpInputType === OtpInputType.PASSWORD && ((0, jsx_runtime_1.jsx)(react_otp_input_1.default, __assign({}, rest, { inputType: "password", inputStyle: {
|
|
38
|
+
switch (otpInputType) {
|
|
39
|
+
case OtpInputType.PASSWORD:
|
|
40
|
+
return ((0, jsx_runtime_1.jsx)(react_otp_input_1.default, __assign({}, rest, { inputType: "password", inputStyle: {
|
|
47
41
|
border: "1px solid #ffffff58",
|
|
48
42
|
borderRadius: "0.75rem",
|
|
49
43
|
width: "2.8rem",
|
|
@@ -52,7 +46,9 @@ var CustomOtpInput = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
52
46
|
outline: "none",
|
|
53
47
|
color: "#ffffff",
|
|
54
48
|
backgroundColor: "#ffffff29",
|
|
55
|
-
}, renderInput: function (props) { return (0, jsx_runtime_1.jsx)("input", __assign({}, props, { inputMode: "decimal" }))
|
|
56
|
-
|
|
57
|
-
|
|
49
|
+
}, renderInput: function (props) { return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)("input", __assign({}, props, { inputMode: "decimal" })), (0, jsx_runtime_1.jsx)("style", { children: "input::selection {\n background-color: transparent; \n color: white; \n }" })] })); } })));
|
|
50
|
+
default:
|
|
51
|
+
return ((0, jsx_runtime_1.jsx)(react_otp_input_1.default, __assign({}, rest, { renderInput: function (props) { return (0, jsx_runtime_1.jsx)("input", __assign({}, props, { inputMode: "text" })); } })));
|
|
52
|
+
}
|
|
53
|
+
};
|
|
58
54
|
exports.default = CustomOtpInput;
|
|
@@ -73,7 +73,6 @@ var CreateWalletView = function (props) {
|
|
|
73
73
|
var childPageLayoutRef = (0, react_2.useRef)(null);
|
|
74
74
|
var _c = (0, react_2.useState)(CreateWalletViewStep.CREATE_PASSCODE), currentStep = _c[0], setCurrentStep = _c[1];
|
|
75
75
|
var createWallet = (0, useWalletData_1.default)().createWallet;
|
|
76
|
-
var otpInputRef = (0, react_2.useRef)(null);
|
|
77
76
|
var gotoStep = function (step) {
|
|
78
77
|
var _a;
|
|
79
78
|
setCurrentStep(step);
|
|
@@ -122,10 +121,6 @@ var CreateWalletView = function (props) {
|
|
|
122
121
|
* validate otp here
|
|
123
122
|
*/
|
|
124
123
|
if (value.length === passcodeLength) {
|
|
125
|
-
console.warn("🚀 ~ handleConfirmOtpChange ~ value:", otpInputRef);
|
|
126
|
-
// setTimeout(() => {
|
|
127
|
-
// otpInputRef.current?.blur();
|
|
128
|
-
// }, 100);
|
|
129
124
|
createWallet({
|
|
130
125
|
passcode: value,
|
|
131
126
|
appSlug: process.env.NEXT_PUBLIC_TEK_WALLET_APP_SLUG || "",
|