ordering-ui-react-native 0.15.66-test → 0.15.66
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.66
|
|
3
|
+
"version": "0.15.66",
|
|
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.
|
|
93
|
+
"react-native-maps": "^0.28.0",
|
|
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,
|
|
3
|
+
import MapView, { PROVIDER_DEFAULT, PROVIDER_GOOGLE, Marker, Region, } 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,26 +152,11 @@ 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
|
-
}
|
|
169
155
|
|
|
170
156
|
useEffect(() => {
|
|
171
|
-
handleEnableLatestRenderer()
|
|
172
157
|
Geocoder.init(googleMapsApiKey)
|
|
173
158
|
}, [])
|
|
174
|
-
|
|
159
|
+
|
|
175
160
|
|
|
176
161
|
useEffect(() => {
|
|
177
162
|
if (saveLocation) {
|
|
@@ -94,6 +94,7 @@ export const OrderDetailsUI = (props: OrderDetailsParams) => {
|
|
|
94
94
|
const [isReviewed, setIsReviewed] = useState(false)
|
|
95
95
|
const [openTaxModal, setOpenTaxModal] = useState<any>({ open: false, tax: null, type: '' })
|
|
96
96
|
const { order, businessData } = props.order;
|
|
97
|
+
const mapValidStatuses = [9, 19, 23]
|
|
97
98
|
|
|
98
99
|
const walletName: any = {
|
|
99
100
|
cash: {
|
|
@@ -680,7 +681,7 @@ export const OrderDetailsUI = (props: OrderDetailsParams) => {
|
|
|
680
681
|
)}
|
|
681
682
|
{order?.driver && (
|
|
682
683
|
<>
|
|
683
|
-
{order?.driver?.location && parseInt(order?.status)
|
|
684
|
+
{order?.driver?.location && mapValidStatuses.includes(parseInt(order?.status)) && (
|
|
684
685
|
<Map>
|
|
685
686
|
<GoogleMap
|
|
686
687
|
location={order?.driver?.location}
|