ordering-ui-react-native 0.15.65 → 0.15.66-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.15.65",
3
+ "version": "0.15.66-test",
4
4
  "description": "Reusable components made in react native",
5
5
  "main": "src/index.tsx",
6
6
  "author": "ordering.inc",
@@ -90,7 +90,7 @@
90
90
  "react-native-linear-gradient": "^2.5.6",
91
91
  "react-native-loading-spinner-overlay": "^2.0.0",
92
92
  "react-native-map-link": "^2.8.2",
93
- "react-native-maps": "^0.28.0",
93
+ "react-native-maps": "0.31.1",
94
94
  "react-native-modal-dropdown": "^1.0.1",
95
95
  "react-native-onesignal": "^4.1.1",
96
96
  "react-native-paper": "^4.7.2",
@@ -1,6 +1,6 @@
1
1
  import React, { useState, useEffect, useRef } from 'react'
2
2
  import { Dimensions, StyleSheet, View, Platform } from 'react-native';
3
- import MapView, { PROVIDER_DEFAULT, PROVIDER_GOOGLE, Marker, Region, } from 'react-native-maps'
3
+ import MapView, { PROVIDER_DEFAULT, PROVIDER_GOOGLE, Marker, Region, enableLatestRenderer} from 'react-native-maps'
4
4
  import Geocoder from 'react-native-geocoding';
5
5
  import { useLanguage, useConfig } from 'ordering-components/native'
6
6
  import { GoogleMapsParams } from '../../types';
@@ -152,11 +152,26 @@ export const GoogleMap = (props: GoogleMapsParams) => {
152
152
  animated: true,
153
153
  });
154
154
  }
155
+
156
+ const handleEnableLatestRenderer = async () => {
157
+ try {
158
+ const result = await enableLatestRenderer()
159
+ if (result == 'LATEST') {
160
+ setMapErrors && setMapErrors('Latest')
161
+ }else {
162
+ setMapErrors && setMapErrors('Legacy')
163
+ }
164
+
165
+ } catch (error: any) {
166
+ setMapErrors && setMapErrors(error)
167
+ }
168
+ }
155
169
 
156
170
  useEffect(() => {
171
+ handleEnableLatestRenderer()
157
172
  Geocoder.init(googleMapsApiKey)
158
173
  }, [])
159
-
174
+
160
175
 
161
176
  useEffect(() => {
162
177
  if (saveLocation) {