ordering-ui-react-native 0.18.57 → 0.18.58-test

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.18.57",
3
+ "version": "0.18.58-test",
4
4
  "description": "Reusable components made in react native",
5
5
  "main": "src/index.tsx",
6
6
  "author": "ordering.inc",
@@ -123,7 +123,7 @@ const AddressFormUI = (props: AddressFormParams) => {
123
123
  },
124
124
  wrapperNavbar: Platform.OS === 'ios'
125
125
  ? { paddingVertical: 0, paddingLeft: 40, paddingRight: 20 }
126
- : { paddingVertical: 20, paddingLeft: 40, paddingRight: 20 }
126
+ : { paddingVertical: 10, paddingLeft: 40, paddingRight: 20 }
127
127
  });
128
128
 
129
129
  const [, t] = useLanguage();
@@ -176,7 +176,6 @@ const AddressFormUI = (props: AddressFormParams) => {
176
176
 
177
177
  const getAddressFormatted = (address: any) => {
178
178
  const data: any = { address: null, error: null };
179
- Geocoder.init(googleMapsApiKey);
180
179
  Geocoder.from(address)
181
180
  .then((json) => {
182
181
  if (json.results && json.results?.length > 0) {
@@ -491,6 +490,10 @@ const AddressFormUI = (props: AddressFormParams) => {
491
490
  }
492
491
  }, []);
493
492
 
493
+ useEffect(() => {
494
+ Geocoder.init(googleMapsApiKey);
495
+ }, [googleMapsApiKey]);
496
+
494
497
  useEffect(() => {
495
498
  const keyboardDidShowListener = Keyboard.addListener(
496
499
  'keyboardDidShow',
@@ -535,7 +538,7 @@ const AddressFormUI = (props: AddressFormParams) => {
535
538
  />
536
539
  </View>
537
540
  <TouchableWithoutFeedback onPress={Keyboard.dismiss}>
538
- <AddressFormContainer style={{ height: HEIGHT_SCREEN * .78, overflow: 'scroll' }}>
541
+ <AddressFormContainer style={{ overflow: 'scroll' }}>
539
542
  <View>
540
543
  <FormInput>
541
544
  <AutocompleteInput>
@@ -640,6 +643,7 @@ const AddressFormUI = (props: AddressFormParams) => {
640
643
  }
641
644
  }}
642
645
  IconButton={<OIcon src={theme.images.general.pin} width={16} />}
646
+ isIntGeoCoder
643
647
  />
644
648
  </View>
645
649
  )}
@@ -661,6 +665,7 @@ const AddressFormUI = (props: AddressFormParams) => {
661
665
  saveLocation={saveMapLocation}
662
666
  setSaveLocation={setSaveMapLocation}
663
667
  handleToggleMap={handleToggleMap}
668
+ isIntGeoCoder
664
669
  />
665
670
  </GoogleMapContainer>
666
671
  </View>
@@ -871,6 +876,7 @@ const AddressFormUI = (props: AddressFormParams) => {
871
876
  saveLocation={saveMapLocation}
872
877
  setSaveLocation={setSaveMapLocation}
873
878
  handleToggleMap={handleToggleMap}
879
+ isIntGeoCoder
874
880
  />
875
881
  </GoogleMapContainer>
876
882
  )}
@@ -281,7 +281,9 @@ const CartUI = (props: any) => {
281
281
  <TouchableOpacity style={{ marginLeft: 3 }} onPress={() => setOpenTaxModal({ open: true, data: offer, type: 'offer_target_1' })}>
282
282
  <AntIcon name='infocirlceo' size={16} color={theme.colors.primary} />
283
283
  </TouchableOpacity>
284
- <OfferAlert offerId={offer?.id} />
284
+ {!!offer?.id && (
285
+ <OfferAlert offerId={offer?.id} />
286
+ )}
285
287
  </OSRow>
286
288
  <OText size={12} lineHeight={18}>
287
289
  - {parsePrice(offer?.summary?.discount)}
@@ -343,7 +345,7 @@ const CartUI = (props: any) => {
343
345
  <TouchableOpacity style={{ marginLeft: 3 }} onPress={() => setOpenTaxModal({ open: true, data: offer, type: 'offer_target_3' })}>
344
346
  <AntIcon name='infocirlceo' size={16} color={theme.colors.primary} />
345
347
  </TouchableOpacity>
346
- {!offer?.type && (
348
+ {!offer?.type && !!offer?.id && (
347
349
  <OfferAlert offerId={offer?.id} />
348
350
  )}
349
351
  </OSRow>
@@ -370,7 +372,9 @@ const CartUI = (props: any) => {
370
372
  <TouchableOpacity style={{ marginLeft: 3 }} onPress={() => setOpenTaxModal({ open: true, data: offer, type: 'offer_target_2' })}>
371
373
  <AntIcon name='infocirlceo' size={16} color={theme.colors.primary} />
372
374
  </TouchableOpacity>
373
- <OfferAlert offerId={offer?.id} />
375
+ {!!offer?.id && (
376
+ <OfferAlert offerId={offer?.id} />
377
+ )}
374
378
  </OSRow>
375
379
  <OText size={12} lineHeight={18}>
376
380
  - {parsePrice(offer?.summary?.discount)}
@@ -12,7 +12,8 @@ export const GPSButton = (props: any) => {
12
12
  handleGPS,
13
13
  apiKey,
14
14
  IconButton,
15
- IconLoadingButton
15
+ IconLoadingButton,
16
+ isIntGeoCoder
16
17
  } = props
17
18
 
18
19
  const [isLoading, setLoading] = useState(false);
@@ -74,8 +75,9 @@ export const GPSButton = (props: any) => {
74
75
  }
75
76
 
76
77
  useEffect(() => {
78
+ if (isIntGeoCoder) return
77
79
  Geocoder.init(apiKey);
78
- }, [])
80
+ }, [isIntGeoCoder])
79
81
 
80
82
  return (
81
83
  <GpsButtonStyle
@@ -18,7 +18,8 @@ export const GoogleMap = (props: GoogleMapsParams) => {
18
18
  saveLocation,
19
19
  setSaveLocation,
20
20
  handleToggleMap,
21
- locations
21
+ locations,
22
+ isIntGeoCoder
22
23
  } = props
23
24
 
24
25
  const [, t] = useLanguage()
@@ -161,8 +162,9 @@ export const GoogleMap = (props: GoogleMapsParams) => {
161
162
  }
162
163
 
163
164
  useEffect(() => {
165
+ if (isIntGeoCoder) return
164
166
  Geocoder.init(googleMapsApiKey)
165
- }, [])
167
+ }, [isIntGeoCoder])
166
168
 
167
169
  useEffect(() => {
168
170
  mapRef.current.animateToRegion({
@@ -169,7 +169,9 @@ const OrderSummaryUI = (props: any) => {
169
169
  <TouchableOpacity style={{ marginLeft: 3 }} onPress={() => setOpenTaxModal({ open: true, data: offer, type: 'offer_target_1' })}>
170
170
  <AntIcon name='infocirlceo' size={16} color={theme.colors.primary} />
171
171
  </TouchableOpacity>
172
- <OfferAlert offerId={offer?.id} />
172
+ {!!offer?.id && (
173
+ <OfferAlert offerId={offer?.id} />
174
+ )}
173
175
  </OSRow>
174
176
  <OText size={12}>
175
177
  - {parsePrice(offer?.summary?.discount)}
@@ -233,7 +235,9 @@ const OrderSummaryUI = (props: any) => {
233
235
  <TouchableOpacity style={{ marginLeft: 3 }} onPress={() => setOpenTaxModal({ open: true, data: offer, type: 'offer_target_3' })}>
234
236
  <AntIcon name='infocirlceo' size={16} color={theme.colors.primary} />
235
237
  </TouchableOpacity>
236
- <OfferAlert offerId={offer?.id} />
238
+ {!!offer?.id && (
239
+ <OfferAlert offerId={offer?.id} />
240
+ )}
237
241
  </OSRow>
238
242
  <OText size={12}>
239
243
  - {parsePrice(offer?.summary?.discount)}
@@ -258,7 +262,9 @@ const OrderSummaryUI = (props: any) => {
258
262
  <TouchableOpacity style={{ marginLeft: 3 }} onPress={() => setOpenTaxModal({ open: true, data: offer, type: 'offer_target_2' })}>
259
263
  <AntIcon name='infocirlceo' size={16} color={theme.colors.primary} />
260
264
  </TouchableOpacity>
261
- <OfferAlert offerId={offer?.id} />
265
+ {!!offer?.id && (
266
+ <OfferAlert offerId={offer?.id} />
267
+ )}
262
268
  </OSRow>
263
269
  <OText size={12}>
264
270
  - {parsePrice(offer?.summary?.discount)}
@@ -629,7 +629,8 @@ export interface GoogleMapsParams {
629
629
  isSetInputs?: boolean,
630
630
  locations?: Array<any>,
631
631
  setSaveLocation?: (val: boolean) => void,
632
- handleToggleMap?: () => void
632
+ handleToggleMap?: () => void,
633
+ isIntGeoCoder: boolean
633
634
  }
634
635
 
635
636
  export interface HelpParams {