ordering-ui-react-native 0.22.97 → 0.22.99

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.97",
3
+ "version": "0.22.99",
4
4
  "description": "Reusable components made in react native",
5
5
  "main": "src/index.tsx",
6
6
  "author": "ordering.inc",
@@ -53,19 +53,23 @@ const MapViewComponent = (props: MapViewParams) => {
53
53
 
54
54
  const fitCoordinates = (location?: any) => {
55
55
  if (mapRef.current) {
56
- mapRef.current.fitToCoordinates(
57
- [
58
- {
59
- latitude: typeof location?.latitude !== 'object' ? location?.latitude : 0,
60
- longitude: typeof location?.longitude !== 'object' ? location?.latitude : 0
61
- },
62
- {
63
- latitude: typeof userLocation?.latitude !== 'object' ? userLocation?.latitude : 0,
64
- longitude: typeof userLocation?.longitude !== 'object' ? userLocation?.latitude : 0
65
- },
66
- ],
56
+ const isSendCoordinates =
57
+ location &&
58
+ userLocation &&
59
+ location.latitude !== userLocation.latitude &&
60
+ location.longitude !== userLocation.longitude &&
61
+ location.latitude !== 0 &&
62
+ location.longitude !== 0 &&
63
+ userLocation.latitude !== 0 &&
64
+ userLocation.longitude !== 0
65
+
66
+ isSendCoordinates && mapRef.current.fitToCoordinates(
67
+ [location, userLocation].map(_location => ({
68
+ latitude: _location.latitude,
69
+ longitude: _location.longitude
70
+ })),
67
71
  {
68
- edgePadding: { top: 120, right: 120, bottom: 120, left: 120 },
72
+ edgePadding: { top: 120, right: 120, bottom: 120, left: 120 }
69
73
  },
70
74
  );
71
75
  }
@@ -780,6 +780,7 @@ const CheckoutUI = (props: any) => {
780
780
  </Placeholder>
781
781
  ) : (
782
782
  <AddressDetails
783
+ cart={cart}
783
784
  navigation={navigation}
784
785
  location={options?.address?.location}
785
786
  businessLogo={businessDetails?.business?.logo}
@@ -35,7 +35,7 @@ const StripeElementsFormUI = (props: any) => {
35
35
  setPlaceByMethodPay,
36
36
  cartTotal,
37
37
  publicKeyAddCard,
38
- urlScheme,
38
+ urlscheme,
39
39
  androidAppId,
40
40
  businessNames,
41
41
  setNewCardAdded
@@ -218,7 +218,7 @@ const StripeElementsFormUI = (props: any) => {
218
218
  <StripeProvider
219
219
  publishableKey={isToSave}
220
220
  merchantIdentifier={merchantId}
221
- urlScheme={`${urlScheme}://checkout/${cart?.uuid}`}
221
+ urlscheme={`${urlscheme}://checkout/${cart?.uuid}`}
222
222
  >
223
223
  {methodsPay?.includes(paymethod) ? (
224
224
  <StripeMethodForm