ordering-ui-react-native 0.22.2 → 0.22.3-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 +6 -7
- package/src/DeliveryApp.tsx +43 -1
- package/src/components/BusinessesListing/index.tsx +1 -1
- package/src/components/StripeMethodForm/index.tsx +4 -2
- package/src/components/VerifyPhone/styles.tsx +1 -2
- package/src/context/OfflineActions/index.tsx +236 -0
- package/src/types/index.tsx +2 -1
- package/themes/business/index.tsx +2 -0
- package/themes/business/src/components/AcceptOrRejectOrder/index.tsx +9 -6
- package/themes/business/src/components/AcceptOrRejectOrder/styles.tsx +1 -0
- package/themes/business/src/components/BusinessController/index.tsx +8 -3
- package/themes/business/src/components/BusinessProductList/index.tsx +2 -1
- package/themes/business/src/components/Chat/index.tsx +15 -3
- package/themes/business/src/components/DriverMap/index.tsx +49 -27
- package/themes/business/src/components/FloatingButton/index.tsx +3 -2
- package/themes/business/src/components/GoogleMap/index.tsx +15 -8
- package/themes/business/src/components/LanguageSelector/index.tsx +2 -3
- package/themes/business/src/components/LanguageSelector/lang_country.json +515 -70
- package/themes/business/src/components/LogoutButton/index.tsx +1 -1
- package/themes/business/src/components/MapView/index.tsx +36 -17
- package/themes/business/src/components/NewOrderNotification/index.tsx +40 -27
- package/themes/business/src/components/OrderDetails/Business.tsx +54 -37
- package/themes/business/src/components/OrderDetails/Delivery.tsx +138 -55
- package/themes/business/src/components/OrderDetails/OrderContentComponent.tsx +125 -43
- package/themes/business/src/components/OrderDetails/OrderHeaderComponent.tsx +62 -24
- package/themes/business/src/components/OrderDetails/styles.tsx +39 -3
- package/themes/business/src/components/OrderDetails/usePrinterCommands.tsx +138 -64
- package/themes/business/src/components/OrderDetailsLogistic/index.tsx +3 -2
- package/themes/business/src/components/OrderSummary/index.tsx +210 -65
- package/themes/business/src/components/OrdersListManager/index.tsx +13 -1
- package/themes/business/src/components/OrdersOption/index.tsx +217 -156
- package/themes/business/src/components/PhoneInputNumber/index.tsx +8 -5
- package/themes/business/src/components/PreviousMessages/index.tsx +26 -3
- package/themes/business/src/components/PreviousOrders/OrderItem.tsx +39 -16
- package/themes/business/src/components/PreviousOrders/index.tsx +76 -66
- package/themes/business/src/components/PrinterEdition/MessageAlert.tsx +33 -0
- package/themes/business/src/components/PrinterEdition/index.tsx +431 -0
- package/themes/business/src/components/PrinterEdition/printerList.tsx +23 -0
- package/themes/business/src/components/PrinterEdition/styles.tsx +61 -0
- package/themes/business/src/components/PrinterSettings/index.tsx +173 -154
- package/themes/business/src/components/PrinterSettings/styles.tsx +20 -0
- package/themes/business/src/components/ReviewCustomer/index.tsx +2 -0
- package/themes/business/src/components/StoresList/index.tsx +2 -2
- package/themes/business/src/components/UserProfileForm/index.tsx +16 -17
- package/themes/business/src/components/WebsocketStatus/index.tsx +2 -2
- package/themes/business/src/components/shared/OTextarea.tsx +8 -9
- package/themes/business/src/layouts/SafeAreaContainer.tsx +35 -19
- package/themes/business/src/types/index.tsx +14 -5
- package/themes/business/src/utils/index.tsx +25 -1
- package/themes/doordash/src/components/BusinessesListing/index.tsx +1 -1
- package/themes/doordash/src/components/LoginForm/index.tsx +1 -2
- package/themes/instacart/src/components/BusinessesListing/index.tsx +1 -1
- package/themes/kiosk/src/components/Checkout/index.tsx +6 -0
- package/themes/kiosk/src/components/NavBar/index.tsx +14 -14
- package/themes/kiosk/src/components/OptionCard/index.tsx +1 -1
- package/themes/kiosk/src/components/OrderTypeCardSelector/index.tsx +8 -10
- package/themes/kiosk/src/components/shared/OButton.tsx +5 -18
- package/themes/original/index.tsx +11 -0
- package/themes/original/src/components/AddressForm/index.tsx +32 -17
- package/themes/original/src/components/AddressList/index.tsx +8 -7
- package/themes/original/src/components/AnalyticsSegment/index.tsx +6 -6
- package/themes/original/src/components/AppleLogin/index.tsx +4 -4
- package/themes/original/src/components/BusinessBasicInformation/index.tsx +5 -8
- package/themes/original/src/components/BusinessController/index.tsx +5 -5
- package/themes/original/src/components/BusinessItemAccordion/index.tsx +13 -5
- package/themes/original/src/components/BusinessListingSearch/BusinessSearchFooter.tsx +2 -3
- package/themes/original/src/components/BusinessListingSearch/BusinessSearchHeader.tsx +1 -3
- package/themes/original/src/components/BusinessListingSearch/index.tsx +1 -2
- package/themes/original/src/components/BusinessPreorder/index.tsx +44 -32
- package/themes/original/src/components/BusinessProductsList/SubcategoriesComponent/index.tsx +73 -70
- package/themes/original/src/components/BusinessProductsList/index.tsx +6 -7
- package/themes/original/src/components/BusinessProductsList/styles.tsx +0 -3
- package/themes/original/src/components/BusinessProductsListing/index.tsx +18 -6
- package/themes/original/src/components/BusinessTypeFilter/index.tsx +9 -8
- package/themes/original/src/components/BusinessesListing/Layout/Appointment/index.tsx +2 -1
- package/themes/original/src/components/BusinessesListing/Layout/Original/index.tsx +1 -1
- package/themes/original/src/components/BusinessesListing/Layout/Original/styles.tsx +1 -1
- package/themes/original/src/components/BusinessesListing/index.tsx +0 -1
- package/themes/original/src/components/Cart/index.tsx +38 -14
- package/themes/original/src/components/CartContent/index.tsx +2 -4
- package/themes/original/src/components/Checkout/index.tsx +112 -58
- package/themes/original/src/components/CitiesControl/index.tsx +0 -3
- package/themes/original/src/components/CouponControl/index.tsx +1 -3
- package/themes/original/src/components/DriverTips/index.tsx +1 -3
- package/themes/original/src/components/Favorite/index.tsx +1 -5
- package/themes/original/src/components/FavoriteList/index.tsx +0 -1
- package/themes/original/src/components/ForgotPasswordForm/index.tsx +5 -7
- package/themes/original/src/components/GiftCard/GiftCardUI/index.tsx +15 -17
- package/themes/original/src/components/GiftCard/PurchaseGiftCard/index.tsx +3 -7
- package/themes/original/src/components/GiftCard/RedeemGiftCard/index.tsx +24 -32
- package/themes/original/src/components/GiftCard/SendGiftCard/index.tsx +7 -9
- package/themes/original/src/components/GiftCard/VerticalGiftCardOrdersLayout/index.tsx +11 -12
- package/themes/original/src/components/GoogleMap/index.tsx +39 -18
- package/themes/original/src/components/Help/index.tsx +2 -0
- package/themes/original/src/components/HighestRatedBusinesses/index.tsx +1 -1
- package/themes/original/src/components/Home/index.tsx +3 -11
- package/themes/original/src/components/LoginForm/Otp/index.tsx +0 -3
- package/themes/original/src/components/LoginForm/index.tsx +4 -7
- package/themes/original/src/components/MessageListing/index.tsx +2 -1
- package/themes/original/src/components/Messages/index.tsx +29 -17
- package/themes/original/src/components/MomentOption/TimeListItem.tsx +56 -0
- package/themes/original/src/components/MomentOption/index.tsx +79 -56
- package/themes/original/src/components/MomentSelector/index.tsx +1 -1
- package/themes/original/src/components/MultiCartsPaymethodsAndWallets/index.tsx +7 -3
- package/themes/original/src/components/MultiCheckout/index.tsx +55 -27
- package/themes/original/src/components/MultiOrdersDetails/index.tsx +1 -0
- package/themes/original/src/components/MyOrders/index.tsx +2 -2
- package/themes/original/src/components/NavBar/index.tsx +7 -4
- package/themes/original/src/components/NetworkError/index.tsx +0 -5
- package/themes/original/src/components/NotFoundSource/index.tsx +0 -3
- package/themes/original/src/components/OrderDetails/OrderEta.tsx +4 -3
- package/themes/original/src/components/OrderDetails/OrderHistory.tsx +13 -10
- package/themes/original/src/components/OrderDetails/index.tsx +44 -21
- package/themes/original/src/components/OrderDetails/styles.tsx +0 -1
- package/themes/original/src/components/OrderProgress/index.tsx +5 -4
- package/themes/original/src/components/OrderSummary/index.tsx +29 -10
- package/themes/original/src/components/OrderTypeSelector/index.tsx +7 -6
- package/themes/original/src/components/OrdersOption/index.tsx +3 -6
- package/themes/original/src/components/PaymentOptionStripe/index.tsx +0 -5
- package/themes/original/src/components/PaymentOptionWallet/index.tsx +56 -56
- package/themes/original/src/components/PaymentOptions/index.tsx +10 -8
- package/themes/original/src/components/PlaceSpot/index.tsx +1 -3
- package/themes/original/src/components/PreviousOrders/index.tsx +1 -2
- package/themes/original/src/components/ProductForm/ActionButton.tsx +17 -20
- package/themes/original/src/components/ProductForm/index.tsx +107 -102
- package/themes/original/src/components/ProductItemAccordion/index.tsx +51 -44
- package/themes/original/src/components/ProductItemAccordion/styles.tsx +3 -4
- package/themes/original/src/components/ProductOptionSubOption/index.tsx +16 -8
- package/themes/original/src/components/ProfessionalProfile/index.tsx +4 -5
- package/themes/original/src/components/Promotions/index.tsx +6 -9
- package/themes/original/src/components/ReviewDriver/index.tsx +1 -1
- package/themes/original/src/components/ReviewOrder/index.tsx +2 -2
- package/themes/original/src/components/ReviewProducts/index.tsx +1 -1
- package/themes/original/src/components/ReviewTrigger/index.tsx +2 -2
- package/themes/original/src/components/ServiceForm/index.tsx +52 -54
- package/themes/original/src/components/Sessions/index.tsx +3 -3
- package/themes/original/src/components/SignupForm/index.tsx +86 -78
- package/themes/original/src/components/SingleOrderCard/index.tsx +6 -4
- package/themes/original/src/components/SingleProductCard/index.tsx +3 -4
- package/themes/original/src/components/SingleProductCard/styles.tsx +0 -3
- package/themes/original/src/components/StripeCardForm/index.tsx +0 -3
- package/themes/original/src/components/StripeCardsList/index.tsx +10 -3
- package/themes/original/src/components/StripeElementsForm/index.tsx +76 -62
- package/themes/original/src/components/StripeElementsForm/naked.tsx +48 -1
- package/themes/original/src/components/StripeRedirectForm/index.tsx +0 -3
- package/themes/original/src/components/TaxInformation/index.tsx +3 -2
- package/themes/original/src/components/UpsellingProducts/UpsellingContent.tsx +10 -7
- package/themes/original/src/components/UpsellingProducts/UpsellingLayout.tsx +8 -3
- package/themes/original/src/components/UserDetails/index.tsx +17 -16
- package/themes/original/src/components/UserFormDetails/index.tsx +159 -133
- package/themes/original/src/components/UserProfile/index.tsx +9 -1
- package/themes/original/src/components/UserVerification/index.tsx +14 -4
- package/themes/original/src/components/Wallets/index.tsx +6 -3
- package/themes/original/src/components/WebsocketStatus/index.tsx +1 -4
- package/themes/original/src/components/shared/OAlert.tsx +2 -1
- package/themes/original/src/components/shared/OButton.tsx +5 -4
- package/themes/original/src/components/shared/OInput.tsx +4 -8
- package/themes/original/src/components/shared/OModal.tsx +7 -2
- package/themes/original/src/types/index.tsx +5 -1
- package/themes/original/src/utils/index.tsx +30 -1
- package/themes/uber-eats/src/components/BusinessesListing/index.tsx +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React, { useState, useEffect, useRef } from 'react';
|
|
1
|
+
import React, { useState, useEffect, useRef, useCallback } from 'react';
|
|
2
2
|
import { Dimensions, Platform, SafeAreaView, StyleSheet, View } from 'react-native';
|
|
3
3
|
import MapView, {
|
|
4
4
|
PROVIDER_GOOGLE,
|
|
@@ -30,7 +30,6 @@ export const DriverMap = (props: GoogleMapsParams) => {
|
|
|
30
30
|
isBusinessMarker,
|
|
31
31
|
isToFollow,
|
|
32
32
|
handleViewActionOrder,
|
|
33
|
-
updateDriverPosition,
|
|
34
33
|
driverUpdateLocation,
|
|
35
34
|
setDriverUpdateLocation,
|
|
36
35
|
} = props;
|
|
@@ -70,11 +69,26 @@ export const DriverMap = (props: GoogleMapsParams) => {
|
|
|
70
69
|
stopFollowUserLocation,
|
|
71
70
|
} = useLocation();
|
|
72
71
|
|
|
73
|
-
const
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
72
|
+
const parsedInitialPosition = useCallback(() => {
|
|
73
|
+
return {
|
|
74
|
+
latitude: typeof initialPosition.latitude === 'string' ? parseFloat(initialPosition.latitude) || 0 : initialPosition.latitude || 0,
|
|
75
|
+
longitude: typeof initialPosition.longitude === 'string' ? parseFloat(initialPosition.longitude) || 0 : initialPosition.longitude || 0,
|
|
76
|
+
}
|
|
77
|
+
}, [JSON.stringify(initialPosition)])
|
|
78
|
+
|
|
79
|
+
const parsedUserLocation = useCallback(() => {
|
|
80
|
+
return {
|
|
81
|
+
latitude: typeof userLocation?.latitude === 'string' ? parseFloat(userLocation?.latitude) || 0 : userLocation?.latitude || 0,
|
|
82
|
+
longitude: typeof userLocation?.longitude === 'string' ? parseFloat(userLocation?.longitude) || 0 : userLocation?.longitude || 0
|
|
83
|
+
}
|
|
84
|
+
}, [JSON.stringify(userLocation)])
|
|
85
|
+
|
|
86
|
+
const parsedDestination = useCallback(() => {
|
|
87
|
+
return {
|
|
88
|
+
latitude: typeof location?.lat === 'string' ? parseFloat(location?.lat) || 0 : location?.lat || 0,
|
|
89
|
+
longitude: typeof location?.lng === 'string' ? parseFloat(location?.lng) || 0 : location?.lng || 0
|
|
90
|
+
}
|
|
91
|
+
}, [JSON.stringify(location)])
|
|
78
92
|
|
|
79
93
|
useEffect(() => {
|
|
80
94
|
if (isToFollow) {
|
|
@@ -162,21 +176,21 @@ export const DriverMap = (props: GoogleMapsParams) => {
|
|
|
162
176
|
if (driverUpdateLocation.error) return;
|
|
163
177
|
|
|
164
178
|
calculateDistance(
|
|
165
|
-
{ lat:
|
|
166
|
-
|
|
179
|
+
{ lat: parsedUserLocation()?.latitude, lng: parsedUserLocation()?.longitude },
|
|
180
|
+
parsedDestination(),
|
|
167
181
|
);
|
|
168
182
|
// geocodePosition(userLocation);
|
|
169
183
|
|
|
170
184
|
if (!following.current) return;
|
|
171
185
|
fitCoordinates();
|
|
172
186
|
|
|
173
|
-
const { latitude, longitude } =
|
|
187
|
+
const { latitude, longitude } = parsedUserLocation();
|
|
174
188
|
|
|
175
189
|
mapRef.current?.animateCamera({
|
|
176
190
|
center: { latitude, longitude },
|
|
177
191
|
});
|
|
178
192
|
|
|
179
|
-
}, [userLocation]);
|
|
193
|
+
}, [JSON.stringify(userLocation)]);
|
|
180
194
|
|
|
181
195
|
const handleArrowBack: any = () => {
|
|
182
196
|
setDriverUpdateLocation?.({
|
|
@@ -222,6 +236,11 @@ export const DriverMap = (props: GoogleMapsParams) => {
|
|
|
222
236
|
19: theme.colors.statusOrderBlue,
|
|
223
237
|
20: theme.colors.statusOrderBlue,
|
|
224
238
|
21: theme.colors.statusOrderBlue,
|
|
239
|
+
22: theme.colors.statusOrderBlue,
|
|
240
|
+
23: theme.colors.statusOrderBlue,
|
|
241
|
+
24: theme.colors.statusOrderBlue,
|
|
242
|
+
25: theme.colors.statusOrderBlue,
|
|
243
|
+
26: theme.colors.statusOrderBlue,
|
|
225
244
|
//GREEN
|
|
226
245
|
1: theme.colors.statusOrderGreen,
|
|
227
246
|
11: theme.colors.statusOrderGreen,
|
|
@@ -242,8 +261,8 @@ export const DriverMap = (props: GoogleMapsParams) => {
|
|
|
242
261
|
[
|
|
243
262
|
{ latitude: location.lat, longitude: location.lng },
|
|
244
263
|
{
|
|
245
|
-
latitude:
|
|
246
|
-
longitude:
|
|
264
|
+
latitude: parsedInitialPosition()?.latitude,
|
|
265
|
+
longitude: parsedInitialPosition()?.longitude,
|
|
247
266
|
},
|
|
248
267
|
],
|
|
249
268
|
{
|
|
@@ -256,7 +275,7 @@ export const DriverMap = (props: GoogleMapsParams) => {
|
|
|
256
275
|
|
|
257
276
|
useEffect(() => {
|
|
258
277
|
const interval = setInterval(() => {
|
|
259
|
-
if (
|
|
278
|
+
if (parsedInitialPosition()?.latitude !== 0 && autoFit.current) {
|
|
260
279
|
if (mapRef.current) {
|
|
261
280
|
fitCoordinates();
|
|
262
281
|
autoFit.current = false;
|
|
@@ -264,7 +283,7 @@ export const DriverMap = (props: GoogleMapsParams) => {
|
|
|
264
283
|
}
|
|
265
284
|
}, 1000);
|
|
266
285
|
return () => clearInterval(interval);
|
|
267
|
-
}, [
|
|
286
|
+
}, [parsedInitialPosition()]);
|
|
268
287
|
|
|
269
288
|
const fitCoordinatesZoom = () => {
|
|
270
289
|
following.current = false;
|
|
@@ -347,8 +366,8 @@ export const DriverMap = (props: GoogleMapsParams) => {
|
|
|
347
366
|
ref={mapRef}
|
|
348
367
|
provider={PROVIDER_GOOGLE}
|
|
349
368
|
initialRegion={{
|
|
350
|
-
latitude:
|
|
351
|
-
longitude:
|
|
369
|
+
latitude: parsedInitialPosition()?.latitude,
|
|
370
|
+
longitude: parsedInitialPosition()?.longitude,
|
|
352
371
|
latitudeDelta: 0.001,
|
|
353
372
|
longitudeDelta: 0.001 * ASPECT_RATIO,
|
|
354
373
|
}}
|
|
@@ -370,8 +389,8 @@ export const DriverMap = (props: GoogleMapsParams) => {
|
|
|
370
389
|
<>
|
|
371
390
|
<Marker
|
|
372
391
|
coordinate={{
|
|
373
|
-
latitude:
|
|
374
|
-
longitude:
|
|
392
|
+
latitude: parsedDestination()?.latitude,
|
|
393
|
+
longitude: parsedDestination()?.longitude
|
|
375
394
|
}}
|
|
376
395
|
title={location.title}>
|
|
377
396
|
<Icon
|
|
@@ -388,7 +407,10 @@ export const DriverMap = (props: GoogleMapsParams) => {
|
|
|
388
407
|
/>
|
|
389
408
|
</View>
|
|
390
409
|
</Marker>
|
|
391
|
-
<Marker coordinate={
|
|
410
|
+
<Marker coordinate={{
|
|
411
|
+
latitude: userLocation?.latitude,
|
|
412
|
+
longitude: userLocation?.longitude
|
|
413
|
+
}}>
|
|
392
414
|
<View style={styles.driverIcon}>
|
|
393
415
|
<OIcon
|
|
394
416
|
style={styles.image}
|
|
@@ -402,8 +424,8 @@ export const DriverMap = (props: GoogleMapsParams) => {
|
|
|
402
424
|
) : (
|
|
403
425
|
<Marker
|
|
404
426
|
coordinate={{
|
|
405
|
-
latitude:
|
|
406
|
-
longitude:
|
|
427
|
+
latitude: parsedUserLocation()?.latitude,
|
|
428
|
+
longitude: parsedUserLocation()?.longitude
|
|
407
429
|
}}
|
|
408
430
|
title={markerTitle || t('YOUR_LOCATION', 'Your Location')}
|
|
409
431
|
/>
|
|
@@ -515,10 +537,10 @@ export const DriverMap = (props: GoogleMapsParams) => {
|
|
|
515
537
|
animationIn: 'slideInUp'
|
|
516
538
|
}}
|
|
517
539
|
options={{
|
|
518
|
-
latitude:
|
|
519
|
-
longitude:
|
|
520
|
-
sourceLatitude:
|
|
521
|
-
sourceLongitude:
|
|
540
|
+
latitude: parsedDestination()?.latitude,
|
|
541
|
+
longitude: parsedDestination()?.longitude,
|
|
542
|
+
sourceLatitude: parsedUserLocation()?.latitude,
|
|
543
|
+
sourceLongitude: parsedUserLocation()?.longitude,
|
|
522
544
|
naverCallerName: 'com.deliveryapp',
|
|
523
545
|
dialogTitle: t('SHOW_IN_OTHER_MAPS', 'Show in other maps'),
|
|
524
546
|
dialogMessage: t('WHAT_APP_WOULD_YOU_USE', 'What app would you like to use?'),
|
|
@@ -540,7 +562,7 @@ export const DriverMap = (props: GoogleMapsParams) => {
|
|
|
540
562
|
secondButton={true}
|
|
541
563
|
firstColorCustom={theme.colors.red}
|
|
542
564
|
secondColorCustom={theme.colors.green}
|
|
543
|
-
widthButton={isHideRejectButtons ? '100%': '45%'}
|
|
565
|
+
widthButton={isHideRejectButtons ? '100%' : '45%'}
|
|
544
566
|
isPadding
|
|
545
567
|
isHideRejectButtons={isHideRejectButtons}
|
|
546
568
|
/>
|
|
@@ -25,14 +25,15 @@ const FloatingButtonUI = (props: FloatingButtonParams) => {
|
|
|
25
25
|
secondButton,
|
|
26
26
|
widthButton,
|
|
27
27
|
isPadding,
|
|
28
|
-
isHideRejectButtons
|
|
28
|
+
isHideRejectButtons,
|
|
29
|
+
principalButtonColor
|
|
29
30
|
} = props;
|
|
30
31
|
|
|
31
32
|
const theme = useTheme();
|
|
32
33
|
|
|
33
34
|
const styles = StyleSheet.create({
|
|
34
35
|
primaryBtn: {
|
|
35
|
-
backgroundColor: theme.colors.primary,
|
|
36
|
+
backgroundColor: principalButtonColor ?? theme.colors.primary,
|
|
36
37
|
},
|
|
37
38
|
secodaryBtn: {
|
|
38
39
|
backgroundColor: theme.colors.textSecondary,
|
|
@@ -50,12 +50,16 @@ export const GoogleMap = (props: GoogleMapsParams) => {
|
|
|
50
50
|
const ASPECT_RATIO = width / height;
|
|
51
51
|
const [isMapReady, setIsMapReady] = useState(false);
|
|
52
52
|
const [markerPosition, setMarkerPosition] = useState({
|
|
53
|
-
latitude: locations
|
|
54
|
-
|
|
53
|
+
latitude: locations
|
|
54
|
+
? typeof locations[locations.length - 1].lat === 'string' ? parseFloat(locations[locations.length - 1].lat) || 0 : locations[locations.length - 1].lat || 0
|
|
55
|
+
: typeof location?.lat === 'string' ? parseFloat(location?.lat) || 0 : location?.lat || 0,
|
|
56
|
+
longitude: locations
|
|
57
|
+
? typeof locations[locations.length - 1].lng === 'string' ? parseFloat(locations[locations.length - 1].lng) || 0 : locations[locations.length - 1].lng || 0
|
|
58
|
+
: typeof location?.lng === 'string' ? parseFloat(location?.lng) || 0 : location?.lng || 0,
|
|
55
59
|
});
|
|
56
60
|
const [region, setRegion] = useState({
|
|
57
|
-
latitude: location
|
|
58
|
-
longitude: location
|
|
61
|
+
latitude: typeof location?.lat === 'string' ? parseFloat(location?.lat) || 0 : location?.lat || 0,
|
|
62
|
+
longitude: typeof location?.lng === 'string' ? parseFloat(location?.lng) || 0 : location?.lng || 0,
|
|
59
63
|
latitudeDelta: 0.001,
|
|
60
64
|
longitudeDelta: 0.001 * ASPECT_RATIO,
|
|
61
65
|
});
|
|
@@ -78,12 +82,15 @@ export const GoogleMap = (props: GoogleMapsParams) => {
|
|
|
78
82
|
let MARKERS =
|
|
79
83
|
locations &&
|
|
80
84
|
locations.map((location: { lat: number; lng: number; level: number }) => {
|
|
81
|
-
return location.level === 4 && driverLocation?.lat
|
|
85
|
+
return location.level === 4 && driverLocation?.lat && driverLocation?.lng
|
|
82
86
|
? {
|
|
83
|
-
latitude: driverLocation?.lat,
|
|
84
|
-
longitude: driverLocation?.lng,
|
|
87
|
+
latitude: typeof driverLocation?.lat === 'string' ? parseFloat(driverLocation?.lat) || 0 : driverLocation?.lat,
|
|
88
|
+
longitude: typeof driverLocation?.lng === 'string' ? parseFloat(driverLocation?.lng) || 0 : driverLocation?.lng,
|
|
85
89
|
}
|
|
86
|
-
: {
|
|
90
|
+
: {
|
|
91
|
+
latitude: typeof location?.lat === 'string' ? parseFloat(location?.lat) || 0 : location?.lat,
|
|
92
|
+
longitude: typeof location?.lng === 'string' ? parseFloat(location?.lng) || 0 : location?.lng
|
|
93
|
+
};
|
|
87
94
|
});
|
|
88
95
|
|
|
89
96
|
const handleArrowBack: any = () => {
|
|
@@ -25,8 +25,7 @@ const LanguageSelectorUI = (props: LanguageSelectorParams) => {
|
|
|
25
25
|
value: language?.code,
|
|
26
26
|
label: language?.name,
|
|
27
27
|
inputLabel: language?.code.toUpperCase(),
|
|
28
|
-
countryCode: langCountries.find(item => item.value == language?.code)
|
|
29
|
-
?.countryCode,
|
|
28
|
+
countryCode: langCountries.find(item => item.value == language?.code)?.countryCode,
|
|
30
29
|
};
|
|
31
30
|
});
|
|
32
31
|
|
|
@@ -50,7 +49,7 @@ const LanguageSelectorUI = (props: LanguageSelectorParams) => {
|
|
|
50
49
|
},
|
|
51
50
|
});
|
|
52
51
|
|
|
53
|
-
return (
|
|
52
|
+
return !languagesState?.loading && languagesState?.languages?.length > 1 && (
|
|
54
53
|
<Container style={{ backgroundColor: theme.colors.inputChat }}>
|
|
55
54
|
{languagesState?.languages && (
|
|
56
55
|
<CountryPicker
|