ordering-ui-react-native 0.23.80 → 0.23.82

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": "ordering-ui-react-native",
3
- "version": "0.23.80",
3
+ "version": "0.23.82",
4
4
  "description": "Reusable components made in react native",
5
5
  "main": "src/index.tsx",
6
6
  "author": "ordering.inc",
@@ -51,7 +51,6 @@
51
51
  "@react-navigation/stack": "^5.9.3",
52
52
  "@segment/analytics-react-native": "2.1.11",
53
53
  "@segment/sovran-react-native": "0.2.6",
54
- "@sentry/react-native": "^2.6.0",
55
54
  "@stripe/stripe-react-native": "0.23.0",
56
55
  "@types/react-native-loading-spinner-overlay": "^0.5.2",
57
56
  "@types/react-native-snap-carousel": "^3.8.4",
@@ -43,7 +43,10 @@ export const UserFormDetailsUI = (props: any) => {
43
43
  isOrderTypeValidationField,
44
44
  checkoutFields,
45
45
  isCheckoutPlace,
46
- setCellphoneStartZero
46
+ setCellphoneStartZero,
47
+ setPhoneState,
48
+ isPhoneVerifyRequired,
49
+ cellphoneOtpSent
47
50
  } = props;
48
51
 
49
52
  const theme = useTheme();
@@ -321,6 +324,15 @@ export const UserFormDetailsUI = (props: any) => {
321
324
  setIsValid(_isValid)
322
325
  }, [formState?.changes, requiredFields])
323
326
 
327
+ useEffect(() => {
328
+ if (!isPhoneVerifyRequired || cellphoneOtpSent || formState?.changes?.length === 0) return
329
+ setPhoneState?.({
330
+ cellphone: formState?.changes?.country_code === "PR" ? formState?.changes?.cellphone.replace('787', '') : formState?.changes?.cellphone,
331
+ country_phone_code: formState?.changes?.country_code === "PR" ? '1787' : formState?.changes?.country_phone_code,
332
+ formatted: `+${formState?.changes?.country_phone_code} ${formState?.changes?.cellphone}`
333
+ })
334
+ }, [formState?.changes, cellphoneOtpSent])
335
+
324
336
  return (
325
337
  <>
326
338
  <UDForm>
@@ -505,7 +517,7 @@ export const UserFormDetailsUI = (props: any) => {
505
517
  </UDLoader>
506
518
  )}
507
519
  </UDForm>
508
- {!hideUpdateButton && (
520
+ {!hideUpdateButton && !isVerifiedPhone && (
509
521
  <>
510
522
  {((formState &&
511
523
  Object.keys(formState?.changes).length > 0 &&
@@ -496,7 +496,9 @@ const UserVerificationUI = (props: any) => {
496
496
  <UserDetails
497
497
  user={user}
498
498
  isEdit
499
- isVerifiedPhone
499
+ isPhoneVerifyRequired={isPhoneVerifyRequired}
500
+ cellphoneOtpSent={verificationState.phone}
501
+ setPhoneState={setPhoneState}
500
502
  dontToggleEditMode
501
503
  />
502
504
  </View>