@propel-nsl/propel-react-native-sdk 1.1.7 → 1.2.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/package.json +1 -1
- package/src/screens/OrdersDetails/index.tsx +6 -0
- package/src/screens/OtpVerification/index.tsx +7 -0
- package/src/screens/PaymentMethod/index.tsx +8 -0
- package/src/screens/ProductDetails/styles.ts +1 -0
- package/src/screens/Reedem/styles.ts +1 -0
- package/src-app/components/CustomButton/index.tsx +1 -1
- package/src-app/components/CustomCard/index.tsx +1 -1
- package/src-app/components/OTPModal.tsx +8 -1
package/package.json
CHANGED
|
@@ -85,6 +85,10 @@ const OrderDetails: React.FC<Props> = ({ navigation, route }) => {
|
|
|
85
85
|
return (
|
|
86
86
|
<CustomImage source={Images?.pendingIcon} imgStyle={[styles.icon]} />
|
|
87
87
|
);
|
|
88
|
+
case 'cancelled':
|
|
89
|
+
return (
|
|
90
|
+
<CustomImage source={Images?.redCrossIcon} imgStyle={[styles.icon]} />
|
|
91
|
+
);
|
|
88
92
|
default:
|
|
89
93
|
return null;
|
|
90
94
|
}
|
|
@@ -106,6 +110,8 @@ const OrderDetails: React.FC<Props> = ({ navigation, route }) => {
|
|
|
106
110
|
case 'complete':
|
|
107
111
|
case 'Complete':
|
|
108
112
|
return colors.green;
|
|
113
|
+
case 'cancelled':
|
|
114
|
+
return colors.red;
|
|
109
115
|
default:
|
|
110
116
|
return colors.orderDetailsText;
|
|
111
117
|
}
|
|
@@ -128,7 +128,11 @@ const wasPhoneAlreadyVerified = useAppSelector(
|
|
|
128
128
|
getDeviceId();
|
|
129
129
|
}, []);
|
|
130
130
|
|
|
131
|
+
const isSubmitting = useRef(false);
|
|
132
|
+
|
|
131
133
|
const handleVerify = async () => {
|
|
134
|
+
if (isSubmitting.current || verifyOtpLoading) return;
|
|
135
|
+
isSubmitting.current = true;
|
|
132
136
|
dispatch(
|
|
133
137
|
verifyMobileOtpRequest({
|
|
134
138
|
client_key: "mobile_app",
|
|
@@ -143,6 +147,8 @@ const wasPhoneAlreadyVerified = useAppSelector(
|
|
|
143
147
|
is_hppl_login: true,
|
|
144
148
|
})
|
|
145
149
|
);
|
|
150
|
+
// Reset guard after a short delay to allow retry on error
|
|
151
|
+
setTimeout(() => { isSubmitting.current = false; }, 1500);
|
|
146
152
|
};
|
|
147
153
|
|
|
148
154
|
const handleResendOTP = () => {
|
|
@@ -257,6 +263,7 @@ const wasPhoneAlreadyVerified = useAppSelector(
|
|
|
257
263
|
title="Verify"
|
|
258
264
|
onPress={handleVerify}
|
|
259
265
|
disabled={otpInput.length < 4}
|
|
266
|
+
loading={verifyOtpLoading}
|
|
260
267
|
customButtonContainerStyle={styles.buttonContainer}
|
|
261
268
|
/>
|
|
262
269
|
|
|
@@ -84,6 +84,14 @@ const PaymentMethod: React.FC<{
|
|
|
84
84
|
}
|
|
85
85
|
}, [cartId, dispatch]);
|
|
86
86
|
|
|
87
|
+
// Reset Apply button state when screen gains focus
|
|
88
|
+
useFocusEffect(
|
|
89
|
+
useCallback(() => {
|
|
90
|
+
setShowPointsApply(false);
|
|
91
|
+
return () => {};
|
|
92
|
+
}, [])
|
|
93
|
+
);
|
|
94
|
+
|
|
87
95
|
|
|
88
96
|
return (
|
|
89
97
|
<View style={styles.container}>
|
|
@@ -70,7 +70,7 @@ const getStatusIcon = (status: string) => {
|
|
|
70
70
|
);
|
|
71
71
|
case 'cancelled':
|
|
72
72
|
return (
|
|
73
|
-
<CustomImage source={Images?.
|
|
73
|
+
<CustomImage source={Images?.redCrossIcon} imgStyle={[styles.icon]} />
|
|
74
74
|
);
|
|
75
75
|
default:
|
|
76
76
|
return null;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React, { useState, useEffect } from 'react';
|
|
1
|
+
import React, { useState, useEffect, useRef } from 'react';
|
|
2
2
|
import {
|
|
3
3
|
View,
|
|
4
4
|
Text,
|
|
@@ -79,6 +79,7 @@ const OTPModal: React.FC<OTPModalProps> = ({
|
|
|
79
79
|
if (visible) {
|
|
80
80
|
setCountdown(60);
|
|
81
81
|
setNewOtp('');
|
|
82
|
+
isSubmitting.current = false;
|
|
82
83
|
}
|
|
83
84
|
}, [visible]);
|
|
84
85
|
|
|
@@ -90,8 +91,14 @@ const OTPModal: React.FC<OTPModalProps> = ({
|
|
|
90
91
|
return () => clearTimeout(timer);
|
|
91
92
|
}, [visible, countdown]);
|
|
92
93
|
|
|
94
|
+
const isSubmitting = useRef(false);
|
|
95
|
+
|
|
93
96
|
const handleVerify = () => {
|
|
97
|
+
if (isSubmitting.current || isVerifying) return;
|
|
98
|
+
isSubmitting.current = true;
|
|
94
99
|
onVerify(newOtp);
|
|
100
|
+
// Reset guard after a short delay to allow retry on error
|
|
101
|
+
setTimeout(() => { isSubmitting.current = false; }, 1500);
|
|
95
102
|
};
|
|
96
103
|
|
|
97
104
|
const handleResendOTP = () => {
|