@akinon/pz-otp 1.82.0-rc.9 → 1.83.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 CHANGED
@@ -1,38 +1,8 @@
1
1
  # @akinon/pz-otp
2
2
 
3
- ## 1.82.0-rc.9
3
+ ## 1.83.0
4
4
 
5
- ## 1.82.0-rc.8
6
-
7
- ## 1.82.0-rc.7
8
-
9
- ## 1.82.0-rc.6
10
-
11
- ## 1.82.0-rc.5
12
-
13
- ## 1.82.0-rc.4
14
-
15
- ## 1.82.0-rc.3
16
-
17
- ### Minor Changes
18
-
19
- - a0a1bac4: ZERO-3228 :edit OTP login flow to use Redux for popup visibility and clean up unused props
20
-
21
- ## 1.82.0-rc.2
22
-
23
- ### Minor Changes
24
-
25
- - 64699d3f: ZERO-2761: Fix invalid import for plugin module
26
- - 7727ae55: ZERO-3073: Refactor basket page to use server-side data fetching and simplify component structure
27
-
28
- ## 1.82.0-rc.1
29
-
30
- ## 1.82.0-rc.0
31
-
32
- ### Minor Changes
33
-
34
- - 64699d3f: ZERO-2761: Fix invalid import for plugin module
35
- - 7727ae55: ZERO-3073: Refactor basket page to use server-side data fetching and simplify component structure
5
+ ## 1.82.0
36
6
 
37
7
  ## 1.81.0
38
8
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@akinon/pz-otp",
3
- "version": "1.82.0-rc.9",
3
+ "version": "1.83.0",
4
4
  "license": "MIT",
5
5
  "main": "./src/index.ts",
6
6
  "module": "./src/index.ts",
package/src/views/Otp.tsx CHANGED
@@ -30,6 +30,7 @@ type ComponentClasses = ComponentClassKey | ComponentWrapperClassKey;
30
30
  type OtpProps = {
31
31
  codeLength?: number;
32
32
  timer?: number;
33
+ phone?: string;
33
34
  submitAction: SubmitHandler<{
34
35
  [key: string]: any;
35
36
  }>;
@@ -52,15 +53,15 @@ export const Otp = ({
52
53
  timer = 60,
53
54
  texts,
54
55
  classes,
55
- error
56
+ error,
57
+ phone
56
58
  }: OtpProps) => {
57
- const { phone } = data;
58
59
  const [otp, setOtp] = useState('');
59
60
  const [canResend, setCanResend] = useState(false);
60
61
  const [time, setTime] = useState(timer);
61
62
  const [hasError, setHasError] = useState(false);
62
63
  const dispatch = useAppDispatch();
63
- const { isPopupVisible } = useAppSelector((state) => state.otp);
64
+ const otpPopupVisible = useAppSelector((state) => state.otp?.isPopupVisible);
64
65
 
65
66
  const resetTimer = () => {
66
67
  setTime(timer);
@@ -117,17 +118,15 @@ export const Otp = ({
117
118
  }, [time, onTimerEnd]);
118
119
 
119
120
  useEffect(() => {
120
- if (isPopupVisible) {
121
- document.body.style.overflow = 'hidden';
122
- window.scrollTo({ top: 0, behavior: 'smooth' });
121
+ document.body.style.overflow = 'hidden';
122
+ window.scrollTo({ top: 0, behavior: 'smooth' });
123
123
 
124
- return () => {
125
- document.body.style.overflow = 'auto';
126
- };
127
- }
124
+ return () => {
125
+ document.body.style.overflow = 'auto';
126
+ };
128
127
  }, []);
129
128
 
130
- if (!isPopupVisible) return null;
129
+ if (!otpPopupVisible) return null;
131
130
 
132
131
  return (
133
132
  <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">