ordering-ui-react-native 0.22.58 → 0.22.60

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.22.58",
3
+ "version": "0.22.60",
4
4
  "description": "Reusable components made in react native",
5
5
  "main": "src/index.tsx",
6
6
  "author": "ordering.inc",
@@ -67,7 +67,8 @@ const AddressFormUI = (props: AddressFormParams) => {
67
67
  hasAddressDefault,
68
68
  afterSignup,
69
69
  businessSlug,
70
- isFromCheckout
70
+ isFromCheckout,
71
+ onNavigationRedirect
71
72
  } = props;
72
73
 
73
74
  const theme = useTheme();
@@ -174,6 +175,8 @@ const AddressFormUI = (props: AddressFormParams) => {
174
175
  const isHideMap = theme?.address?.components?.map?.hidden
175
176
  const isHideIcons = theme?.address?.components?.icons?.hidden
176
177
  const continueAsGuest = () => navigation.navigate(!!businessSlug ? 'Business' : 'BusinessList', { isGuestUser: true });
178
+ const unaddressedTypes = configState?.configs?.unaddressed_order_types_allowed?.value.split('|').map((value: any) => Number(value)) || []
179
+ const isAllowUnaddressOrderType = unaddressedTypes.includes(orderState?.options?.type)
177
180
  const goToBack = () => navigation?.canGoBack() && navigation.goBack();
178
181
 
179
182
  const getAddressFormatted = (address: any) => {
@@ -528,6 +531,12 @@ const AddressFormUI = (props: AddressFormParams) => {
528
531
  setIsSignUpEffect(true);
529
532
  }, [orderState.loading]);
530
533
 
534
+ useEffect(() => {
535
+ if (isAllowUnaddressOrderType) {
536
+ onNavigationRedirect && onNavigationRedirect(!!businessSlug ? 'Business' : 'BusinessList')
537
+ }
538
+ }, [isAllowUnaddressOrderType])
539
+
531
540
  return (
532
541
  <ScrollView
533
542
  keyboardShouldPersistTaps='always'
@@ -8,7 +8,6 @@ import Alert from '../../../../../src/providers/AlertProvider'
8
8
  import { OIcon } from '../shared';
9
9
 
10
10
  export const GoogleMap = (props: GoogleMapsParams) => {
11
-
12
11
  const {
13
12
  location,
14
13
  handleChangeAddressMap,
@@ -23,7 +22,8 @@ export const GoogleMap = (props: GoogleMapsParams) => {
23
22
  businessZones,
24
23
  delta,
25
24
  autoCompleteAddress,
26
- setAutoCompleteAddress
25
+ setAutoCompleteAddress,
26
+ manualZoom
27
27
  } = props
28
28
 
29
29
  const [, t] = useLanguage()
@@ -217,11 +217,12 @@ export const GoogleMap = (props: GoogleMapsParams) => {
217
217
 
218
218
  useEffect(() => {
219
219
  const interval = setInterval(() => {
220
- if (mapRef.current && locations) {
220
+ if (mapRef.current && locations && !manualZoom) {
221
221
  fitAllMarkers()
222
222
  }
223
223
  }, 1000)
224
224
  if (locations) {
225
+ fitAllMarkers()
225
226
  SETMARKERS(locations)
226
227
  }
227
228
  return () => clearInterval(interval)
@@ -18,12 +18,6 @@ export const Home = (props: any) => {
18
18
  const unaddressedTypes = configs?.unaddressed_order_types_allowed?.value.split('|').map((value: any) => Number(value)) || []
19
19
  const isAllowUnaddressOrderType = unaddressedTypes.includes(orderState?.options?.type)
20
20
 
21
- useEffect(() => {
22
- if (isAllowUnaddressOrderType) {
23
- onNavigationRedirect(!!businessSlug ? 'Business' : 'BusinessList')
24
- }
25
- }, [isAllowUnaddressOrderType])
26
-
27
21
  return (
28
22
  <View style={styles.container}>
29
23
  <View>
@@ -66,7 +60,7 @@ export const Home = (props: any) => {
66
60
  <TouchableOpacity
67
61
  style={{ ...styles.textLink, marginTop: 12 }}
68
62
  onPress={() =>
69
- orderState?.options?.address?.address
63
+ orderState?.options?.address?.address || isAllowUnaddressOrderType
70
64
  ? onNavigationRedirect(!!businessSlug ? 'Business' : 'BusinessList', { isGuestUser: true })
71
65
  : onNavigationRedirect('AddressForm', { isGuestUser: true })
72
66
  }>
@@ -29,7 +29,7 @@ import {
29
29
  TimeItem
30
30
  } from './styles';
31
31
  import { useSafeAreaInsets } from 'react-native-safe-area-context';
32
- import { locale, monthsEnum } from '../../utils';
32
+ import { monthsEnum, setLocalMoment } from '../../utils';
33
33
 
34
34
  const MomentOptionUI = (props: MomentOptionParams) => {
35
35
  const {
@@ -323,6 +323,10 @@ const MomentOptionUI = (props: MomentOptionParams) => {
323
323
  }
324
324
  }, [dateSelected, JSON.stringify(hoursList), JSON.stringify(datesWhitelist), cateringPreorder, JSON.stringify(business)])
325
325
 
326
+ useEffect(() => {
327
+ setLocalMoment(moment, t)
328
+ }, [])
329
+
326
330
  return (
327
331
  <>
328
332
  <Container
@@ -394,7 +398,6 @@ const MomentOptionUI = (props: MomentOptionParams) => {
394
398
  <View style={{ flex: 1 }}>
395
399
  {selectDate && datesWhitelist[0]?.start !== null && (
396
400
  <CalendarStrip
397
- locale={locale}
398
401
  scrollable
399
402
  style={styles.calendar}
400
403
  calendarHeaderContainerStyle={styles.calendarHeaderContainer}
@@ -749,6 +749,7 @@ export const OrderDetailsUI = (props: OrderDetailsParams) => {
749
749
  }
750
750
  locations={parsedLocations}
751
751
  readOnly
752
+ manualZoom
752
753
  />
753
754
  </Map>
754
755
  )}
@@ -639,6 +639,7 @@ export interface GoogleMapsParams {
639
639
  delta?: number
640
640
  setAutoCompleteAddress?: (val: boolean) => void,
641
641
  autoCompleteAddress?: boolean,
642
+ manualZoom?: boolean
642
643
  }
643
644
 
644
645
  export interface HelpParams {