@akinon/pz-otp 2.0.0-beta.1 → 2.0.0-beta.10
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/CHANGELOG.md +35 -0
- package/package.json +1 -1
- package/readme.md +4 -4
- package/src/views/Otp.tsx +12 -11
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,40 @@
|
|
|
1
1
|
# @akinon/pz-otp
|
|
2
2
|
|
|
3
|
+
## 2.0.0-beta.10
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 2806320: ZERO-3390: Update version tailwindcss, autoprefixer, tailwind-merge, postcss
|
|
8
|
+
|
|
9
|
+
## 2.0.0-beta.9
|
|
10
|
+
|
|
11
|
+
### Minor Changes
|
|
12
|
+
|
|
13
|
+
- 0fe7711: ZERO-3387: Upgrade nextjs, eslint-config-next
|
|
14
|
+
|
|
15
|
+
## 2.0.0-beta.8
|
|
16
|
+
|
|
17
|
+
## 2.0.0-beta.7
|
|
18
|
+
|
|
19
|
+
## 2.0.0-beta.6
|
|
20
|
+
|
|
21
|
+
### Minor Changes
|
|
22
|
+
|
|
23
|
+
- 8f05f9b: ZERO-3250: Beta branch synchronized with Main branch
|
|
24
|
+
|
|
25
|
+
## 2.0.0-beta.5
|
|
26
|
+
|
|
27
|
+
## 2.0.0-beta.4
|
|
28
|
+
|
|
29
|
+
## 2.0.0-beta.3
|
|
30
|
+
|
|
31
|
+
## 2.0.0-beta.2
|
|
32
|
+
|
|
33
|
+
### Minor Changes
|
|
34
|
+
|
|
35
|
+
- a006015: ZERO-3116: Add not-found page and update default middleware.
|
|
36
|
+
- 1eeb3d8: ZERO-3116: Add not found page
|
|
37
|
+
|
|
3
38
|
## 2.0.0-beta.1
|
|
4
39
|
|
|
5
40
|
### Minor Changes
|
package/package.json
CHANGED
package/readme.md
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
# @akinon/pz-otp
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
## Installation method
|
|
4
|
+
|
|
5
|
+
You can use the following command to install the extension with the latest plugins:
|
|
4
6
|
|
|
5
7
|
```bash
|
|
6
|
-
# For latest version
|
|
7
|
-
yarn add @akinon/pz-otp
|
|
8
8
|
|
|
9
|
-
# Preferred installation method
|
|
10
9
|
npx @akinon/projectzero@latest --plugins
|
|
10
|
+
|
|
11
11
|
```
|
package/src/views/Otp.tsx
CHANGED
|
@@ -30,7 +30,6 @@ type ComponentClasses = ComponentClassKey | ComponentWrapperClassKey;
|
|
|
30
30
|
type OtpProps = {
|
|
31
31
|
codeLength?: number;
|
|
32
32
|
timer?: number;
|
|
33
|
-
phone?: string;
|
|
34
33
|
submitAction: SubmitHandler<{
|
|
35
34
|
[key: string]: any;
|
|
36
35
|
}>;
|
|
@@ -53,15 +52,15 @@ export const Otp = ({
|
|
|
53
52
|
timer = 60,
|
|
54
53
|
texts,
|
|
55
54
|
classes,
|
|
56
|
-
error
|
|
57
|
-
phone
|
|
55
|
+
error
|
|
58
56
|
}: OtpProps) => {
|
|
57
|
+
const { phone } = data;
|
|
59
58
|
const [otp, setOtp] = useState('');
|
|
60
59
|
const [canResend, setCanResend] = useState(false);
|
|
61
60
|
const [time, setTime] = useState(timer);
|
|
62
61
|
const [hasError, setHasError] = useState(false);
|
|
63
62
|
const dispatch = useAppDispatch();
|
|
64
|
-
const
|
|
63
|
+
const { isPopupVisible } = useAppSelector((state) => state.otp);
|
|
65
64
|
|
|
66
65
|
const resetTimer = () => {
|
|
67
66
|
setTime(timer);
|
|
@@ -118,19 +117,21 @@ export const Otp = ({
|
|
|
118
117
|
}, [time, onTimerEnd]);
|
|
119
118
|
|
|
120
119
|
useEffect(() => {
|
|
121
|
-
|
|
122
|
-
|
|
120
|
+
if (isPopupVisible) {
|
|
121
|
+
document.body.style.overflow = 'hidden';
|
|
122
|
+
window.scrollTo({ top: 0, behavior: 'smooth' });
|
|
123
123
|
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
124
|
+
return () => {
|
|
125
|
+
document.body.style.overflow = 'auto';
|
|
126
|
+
};
|
|
127
|
+
}
|
|
127
128
|
}, []);
|
|
128
129
|
|
|
129
|
-
if (!
|
|
130
|
+
if (!isPopupVisible) return null;
|
|
130
131
|
|
|
131
132
|
return (
|
|
132
133
|
<div className="fixed left-0 top-0 z-50 flex h-screen w-screen items-end md:items-center md:justify-center md:bg-black/10">
|
|
133
|
-
<div className="h-[calc(100vh-48px)] w-screen flex md:h-auto md:max-w-lg flex-col items-center rounded-
|
|
134
|
+
<div className="h-[calc(100vh-48px)] w-screen flex md:h-auto md:max-w-lg flex-col items-center rounded-xs bg-white p-8 shadow-xl">
|
|
134
135
|
<div className="w-full flex items-center justify-end">
|
|
135
136
|
<div className="cursor-pointer" onClick={closeHandler}>
|
|
136
137
|
<svg
|