ordering-ui-react-native 0.23.79 → 0.23.81

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.79",
3
+ "version": "0.23.81",
4
4
  "description": "Reusable components made in react native",
5
5
  "main": "src/index.tsx",
6
6
  "author": "ordering.inc",
@@ -1,5 +1,5 @@
1
1
  import React, { useState, useEffect, useRef, useCallback } from 'react';
2
- import { Dimensions, SafeAreaView, StyleSheet, View } from 'react-native';
2
+ import { Dimensions, Platform, SafeAreaView, StyleSheet, View } from 'react-native';
3
3
  import { useFocusEffect } from '@react-navigation/native'
4
4
  import MapView, {
5
5
  PROVIDER_GOOGLE,
@@ -265,8 +265,8 @@ const MapViewComponent = (props: MapViewParams) => {
265
265
  style={{ flex: 1 }}
266
266
  zoomTapEnabled
267
267
  zoomEnabled
268
- zoomControlEnabled
269
- cacheEnabled
268
+ zoomControlEnabled={!(isDeliveryApp && Platform.OS === 'android')}
269
+ cacheEnabled={(isDeliveryApp && Platform.OS === 'android' && isFocused) || Platform.OS === 'ios' || !isDeliveryApp}
270
270
  moveOnMarkerPress
271
271
  onTouchStart={() => (following.current = false)}
272
272
  >
@@ -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>