@propel-nsl/propel-react-native-sdk 1.1.6 → 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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@propel-nsl/propel-react-native-sdk",
3
- "version": "1.1.6",
3
+ "version": "1.2.0",
4
4
  "description": "Propel Mobile SDK - React Native Core",
5
5
  "files": [
6
6
  "src/",
@@ -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}>
@@ -58,6 +58,7 @@ const styles = StyleSheet.create({
58
58
  height: 12,
59
59
  justifyContent: 'center',
60
60
  alignItems: 'center',
61
+ overflow: 'visible',
61
62
  },
62
63
  cartBadgeText: {
63
64
  fontFamily: FontFamily.LEXEND_REGULAR,
@@ -63,6 +63,7 @@ const styles = StyleSheet.create({
63
63
  height: VSCALE(20),
64
64
  justifyContent: 'center',
65
65
  alignItems: 'center',
66
+ overflow: 'visible',
66
67
  },
67
68
  cartBadgeText: {
68
69
  fontFamily: FontFamily.LEXEND_REGULAR,
@@ -45,7 +45,7 @@ const CustomButton: React.FC<CustomButtonProps> = ({
45
45
  buttonStyle,
46
46
  ]}
47
47
  onPress={onPress}
48
- disabled={disabled}
48
+ disabled={disabled || loading}
49
49
  >
50
50
  <View style={styles.row}>
51
51
  {loading ? (
@@ -68,6 +68,10 @@ const getStatusIcon = (status: string) => {
68
68
  return (
69
69
  <CustomImage source={Images?.pendingIcon} imgStyle={[styles.icon]} />
70
70
  );
71
+ case 'cancelled':
72
+ return (
73
+ <CustomImage source={Images?.redCrossIcon} imgStyle={[styles.icon]} />
74
+ );
71
75
  default:
72
76
  return null;
73
77
  }
@@ -83,6 +87,8 @@ const getStatusColor = (status: string) => {
83
87
  return colors.orange;
84
88
  case 'partial':
85
89
  return colors.orange;
90
+ case 'cancelled':
91
+ return colors.red;
86
92
  case 'complete':
87
93
  case 'confirmed':
88
94
  return colors.green;
@@ -100,8 +106,9 @@ const getStatusText = (status: string) => {
100
106
  case 'pending':
101
107
  return 'Pending';
102
108
  case 'partial':
103
- case 'cancelled':
104
109
  return 'Partial';
110
+ case 'cancelled':
111
+ return 'Cancelled';
105
112
  case 'complete':
106
113
  return 'Complete';
107
114
  case 'confirmed':
@@ -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 = () => {