ordering-ui-react-native 0.23.74-test → 0.23.74-test3
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
|
@@ -143,20 +143,17 @@ const MapViewComponent = (props: MapViewParams) => {
|
|
|
143
143
|
let coordinateLat = (customer
|
|
144
144
|
? typeof marker?.customer?.location?.lat === 'number' && !Number.isNaN(marker?.customer?.location?.lat)
|
|
145
145
|
? marker?.customer?.location?.lat
|
|
146
|
-
:
|
|
146
|
+
: 0
|
|
147
147
|
: typeof marker?.business?.location?.lat === 'number' && !Number.isNaN(marker?.business?.location?.lat)
|
|
148
148
|
? marker?.business?.location?.lat
|
|
149
|
-
: initialPosition?.latitude || 0
|
|
150
|
-
) ?? 0;
|
|
151
|
-
|
|
149
|
+
: 0) ?? (initialPosition?.latitude || 0)
|
|
152
150
|
let coordinateLng = (customer
|
|
153
151
|
? typeof marker?.customer?.location?.lng === 'number' && !Number.isNaN(marker?.customer?.location?.lng)
|
|
154
152
|
? marker?.customer?.location?.lng
|
|
155
|
-
:
|
|
153
|
+
: 0
|
|
156
154
|
: typeof marker?.business?.location?.lng === 'number' && !Number.isNaN(marker?.business?.location?.lng)
|
|
157
155
|
? marker?.business?.location?.lng
|
|
158
|
-
: initialPosition?.longitude || 0
|
|
159
|
-
) ?? 0;
|
|
156
|
+
: 0) ?? (initialPosition?.longitude || 0)
|
|
160
157
|
|
|
161
158
|
useEffect(() => {
|
|
162
159
|
if (
|
|
@@ -254,7 +251,7 @@ const MapViewComponent = (props: MapViewParams) => {
|
|
|
254
251
|
return (
|
|
255
252
|
<SafeAreaView style={{ flex: 1 }}>
|
|
256
253
|
<View style={{ flex: 1 }}>
|
|
257
|
-
{!isLoadingBusinessMarkers && isFocused
|
|
254
|
+
{!isLoadingBusinessMarkers && isFocused ? (
|
|
258
255
|
<View style={{ flex: 1 }}>
|
|
259
256
|
<MapView
|
|
260
257
|
ref={mapRef}
|
|
@@ -274,42 +271,44 @@ const MapViewComponent = (props: MapViewParams) => {
|
|
|
274
271
|
onTouchStart={() => (following.current = false)}
|
|
275
272
|
>
|
|
276
273
|
<>
|
|
277
|
-
{Object.values(markerGroups).map((marker: any) => (
|
|
274
|
+
{Object.values(markerGroups).length ? (Object.values(markerGroups).map((marker: any) => (
|
|
278
275
|
<RenderMarker
|
|
279
276
|
key={marker[0]?.business_id}
|
|
280
277
|
marker={marker[0]}
|
|
281
278
|
orderIds={marker.map((order: any) => order.id).join(', ')}
|
|
282
279
|
/>
|
|
283
|
-
))}
|
|
284
|
-
{Object.values(customerMarkerGroups).map((marker: any) => (
|
|
280
|
+
))) : null}
|
|
281
|
+
{Object.values(customerMarkerGroups).length ? (Object.values(customerMarkerGroups).map((marker: any) => (
|
|
285
282
|
<RenderMarker
|
|
286
283
|
key={marker[0]?.customer_id}
|
|
287
284
|
marker={marker[0]}
|
|
288
285
|
orderIds={marker.map((order: any) => order.id).join(', ')}
|
|
289
286
|
customer
|
|
290
287
|
/>
|
|
291
|
-
))}
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
<View style={styles.view}>
|
|
305
|
-
<OIcon
|
|
306
|
-
style={styles.image}
|
|
307
|
-
src={{ uri: user.photo }}
|
|
308
|
-
width={25}
|
|
309
|
-
height={25}
|
|
288
|
+
))) : null}
|
|
289
|
+
{typeof location.lat === 'number' && !Number.isNaN(location.lat) && typeof location.lng === 'number' && !Number.isNaN(location.lng) ? (
|
|
290
|
+
<Marker
|
|
291
|
+
coordinate={{
|
|
292
|
+
latitude: typeof location.lat === 'number' && !Number.isNaN(location.lat) ? location.lat : 0,
|
|
293
|
+
longitude: typeof location.lng === 'number' && !Number.isNaN(location.lng) ? location.lng : 0,
|
|
294
|
+
}}
|
|
295
|
+
title={t('YOUR_LOCATION', 'Your Location')}
|
|
296
|
+
>
|
|
297
|
+
<Icon
|
|
298
|
+
name="map-marker"
|
|
299
|
+
size={50}
|
|
300
|
+
color={theme.colors.primary}
|
|
310
301
|
/>
|
|
311
|
-
|
|
312
|
-
|
|
302
|
+
<View style={styles.view}>
|
|
303
|
+
<OIcon
|
|
304
|
+
style={styles.image}
|
|
305
|
+
src={{ uri: user.photo }}
|
|
306
|
+
width={25}
|
|
307
|
+
height={25}
|
|
308
|
+
/>
|
|
309
|
+
</View>
|
|
310
|
+
</Marker>
|
|
311
|
+
) : null}
|
|
313
312
|
</>
|
|
314
313
|
</MapView>
|
|
315
314
|
<OFab
|
|
@@ -333,7 +332,7 @@ const MapViewComponent = (props: MapViewParams) => {
|
|
|
333
332
|
}}
|
|
334
333
|
/>
|
|
335
334
|
</View>
|
|
336
|
-
)}
|
|
335
|
+
) : null}
|
|
337
336
|
</View>
|
|
338
337
|
<View>
|
|
339
338
|
<Alert
|