ordering-ui-react-native 0.17.19-release → 0.17.20-release

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.17.19-release",
3
+ "version": "0.17.20-release",
4
4
  "description": "Reusable components made in react native",
5
5
  "main": "src/index.tsx",
6
6
  "author": "ordering.inc",
@@ -49,6 +49,8 @@
49
49
  "@react-navigation/material-bottom-tabs": "^5.3.14",
50
50
  "@react-navigation/native": "^5.7.6",
51
51
  "@react-navigation/stack": "^5.9.3",
52
+ "@segment/analytics-react-native": "2.1.11",
53
+ "@segment/sovran-react-native": "0.2.6",
52
54
  "@sentry/react-native": "^2.6.0",
53
55
  "@stripe/stripe-react-native": "^0.2.0",
54
56
  "@types/react-native-loading-spinner-overlay": "^0.5.2",
@@ -81,6 +83,7 @@
81
83
  "react-native-fbsdk-next": "^7.0.1",
82
84
  "react-native-geocoding": "^0.5.0",
83
85
  "react-native-gesture-handler": "^1.8.0",
86
+ "react-native-get-random-values": "1.8.0",
84
87
  "react-native-gifted-chat": "^0.16.3",
85
88
  "react-native-google-places-autocomplete": "^2.1.3",
86
89
  "react-native-html-to-pdf": "^0.10.0",
@@ -1,6 +1,6 @@
1
1
  import { AddressForm } from './src/components/AddressForm';
2
2
  import { AddressDetails } from './src/components/AddressDetails';
3
- // import { AnalyticsSegment } from './src/components/AnalyticsSegment';
3
+ import { AnalyticsSegment } from './src/components/AnalyticsSegment';
4
4
  import { Home } from './src/components/Home';
5
5
  import { LoginForm } from './src/components/LoginForm';
6
6
  import { SignupForm } from './src/components/SignupForm';
@@ -167,7 +167,7 @@ import {
167
167
  export {
168
168
  AddressForm,
169
169
  AddressDetails,
170
- // AnalyticsSegment,
170
+ AnalyticsSegment,
171
171
  Home as HomeView,
172
172
  SignupForm,
173
173
  LoginForm,
@@ -122,8 +122,8 @@ const AddressFormUI = (props: AddressFormParams) => {
122
122
  width: 16
123
123
  },
124
124
  wrapperNavbar: Platform.OS === 'ios'
125
- ? { paddingVertical: 0, paddingHorizontal: 40 }
126
- : { paddingVertical: 20, paddingHorizontal: 40 }
125
+ ? { paddingVertical: 0, 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) {
@@ -488,6 +487,10 @@ const AddressFormUI = (props: AddressFormParams) => {
488
487
  }
489
488
  }, []);
490
489
 
490
+ useEffect(() => {
491
+ Geocoder.init(googleMapsApiKey);
492
+ }, [googleMapsApiKey]);
493
+
491
494
  useEffect(() => {
492
495
  const keyboardDidShowListener = Keyboard.addListener(
493
496
  'keyboardDidShow',
@@ -532,7 +535,7 @@ const AddressFormUI = (props: AddressFormParams) => {
532
535
  />
533
536
  </View>
534
537
  <TouchableWithoutFeedback onPress={Keyboard.dismiss}>
535
- <AddressFormContainer style={{ height: HEIGHT_SCREEN * .78, overflow: 'scroll' }}>
538
+ <AddressFormContainer style={{ overflow: 'scroll' }}>
536
539
  <View>
537
540
  <FormInput>
538
541
  <AutocompleteInput>
@@ -637,6 +640,7 @@ const AddressFormUI = (props: AddressFormParams) => {
637
640
  }
638
641
  }}
639
642
  IconButton={<OIcon src={theme.images.general.pin} width={16} />}
643
+ isIntGeoCoder
640
644
  />
641
645
  </View>
642
646
  )}
@@ -658,6 +662,7 @@ const AddressFormUI = (props: AddressFormParams) => {
658
662
  saveLocation={saveMapLocation}
659
663
  setSaveLocation={setSaveMapLocation}
660
664
  handleToggleMap={handleToggleMap}
665
+ isIntGeoCoder
661
666
  />
662
667
  </GoogleMapContainer>
663
668
  </View>
@@ -866,6 +871,7 @@ const AddressFormUI = (props: AddressFormParams) => {
866
871
  saveLocation={saveMapLocation}
867
872
  setSaveLocation={setSaveMapLocation}
868
873
  handleToggleMap={handleToggleMap}
874
+ isIntGeoCoder
869
875
  />
870
876
  </GoogleMapContainer>
871
877
  )}
@@ -1,7 +1,7 @@
1
1
  import React, { useEffect, useState } from 'react';
2
2
  import {
3
3
  createClient,
4
- // AnalyticsProvider
4
+ AnalyticsProvider
5
5
  } from '@segment/analytics-react-native';
6
6
  import { useEvent, useConfig, useLanguage } from 'ordering-components/native';
7
7
 
@@ -302,9 +302,9 @@ export const AnalyticsSegment = (props: any) => {
302
302
 
303
303
  return (
304
304
  <>
305
- {/* <AnalyticsProvider client={segmentClient}>
305
+ <AnalyticsProvider client={segmentClient}>
306
306
  {children}
307
- </AnalyticsProvider> */}
307
+ </AnalyticsProvider>
308
308
  </>
309
309
  )
310
310
  }
@@ -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);
@@ -31,7 +32,7 @@ export const GPSButton = (props: any) => {
31
32
  break
32
33
  }
33
34
  }
34
- let data = null
35
+ let data : any
35
36
  const details = {
36
37
  geometry: { location: { lat: pos.latitude, lng: pos.longitude } }
37
38
  }
@@ -68,12 +69,13 @@ export const GPSButton = (props: any) => {
68
69
  setLoading(false);
69
70
  console.log(`ERROR(${err.code}): ${err.message}`)
70
71
  }, {
71
- enableHighAccuracy: true, timeout: 15000, maximumAge: 10000
72
+ enableHighAccuracy: false, timeout: 30000, maximumAge: 1000
72
73
  })
73
74
  }
74
75
  }
75
76
 
76
77
  useEffect(() => {
78
+ if (isIntGeoCoder) return
77
79
  Geocoder.init(apiKey);
78
80
  }, [])
79
81
 
@@ -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()
@@ -152,8 +153,9 @@ export const GoogleMap = (props: GoogleMapsParams) => {
152
153
  }
153
154
 
154
155
  useEffect(() => {
156
+ if (isIntGeoCoder) return
155
157
  Geocoder.init(googleMapsApiKey)
156
- }, [])
158
+ }, [isIntGeoCoder])
157
159
 
158
160
  useEffect(() => {
159
161
  mapRef.current.animateToRegion({
@@ -986,11 +986,11 @@ export const OrderDetailsUI = (props: OrderDetailsParams) => {
986
986
  ? walletName[event?.wallet_event?.wallet?.type]?.name
987
987
  : t(event?.paymethod?.name.toUpperCase()?.replace(/ /g, '_'), event?.paymethod?.name)}
988
988
  </OText>
989
- {event?.data?.charge_id && (
989
+ {/* {event?.data?.charge_id && (
990
990
  <OText>
991
991
  {`${t('CODE', 'Code')}: ${event?.data?.charge_id}`}
992
992
  </OText>
993
- )}
993
+ )} */}
994
994
  </View>
995
995
  <OText>
996
996
  -{parsePrice(event.amount, { isTruncable: true })}
@@ -617,7 +617,8 @@ export interface GoogleMapsParams {
617
617
  isSetInputs?: boolean,
618
618
  locations?: Array<any>,
619
619
  setSaveLocation?: (val: boolean) => void,
620
- handleToggleMap?: () => void
620
+ handleToggleMap?: () => void,
621
+ isIntGeoCoder: boolean
621
622
  }
622
623
 
623
624
  export interface HelpParams {