@akinon/pz-otp 1.83.0 → 1.85.0-rc.0
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 +15 -0
- package/package.json +1 -1
- package/readme.md +4 -4
- package/src/views/Otp.tsx +11 -10
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,20 @@
|
|
|
1
1
|
# @akinon/pz-otp
|
|
2
2
|
|
|
3
|
+
## 1.85.0-rc.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- a0a1bac4: ZERO-3228 :edit OTP login flow to use Redux for popup visibility and clean up unused props
|
|
8
|
+
- 64699d3f: ZERO-2761: Fix invalid import for plugin module
|
|
9
|
+
- 7727ae55: ZERO-3073: Refactor basket page to use server-side data fetching and simplify component structure
|
|
10
|
+
- 33377cfd: ZERO-3267: Refactor import statement for ROUTES in error-page component
|
|
11
|
+
|
|
12
|
+
## 1.84.0
|
|
13
|
+
|
|
14
|
+
### Minor Changes
|
|
15
|
+
|
|
16
|
+
- 624a4eb: ZERO-3276: Update installation instructions across multiple README files to standardize format and improve clarity
|
|
17
|
+
|
|
3
18
|
## 1.83.0
|
|
4
19
|
|
|
5
20
|
## 1.82.0
|
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,15 +117,17 @@ 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">
|