ordering-ui-react-native 0.22.21 → 0.22.22-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.
Files changed (164) hide show
  1. package/package.json +6 -7
  2. package/src/DeliveryApp.tsx +43 -1
  3. package/src/components/BusinessesListing/index.tsx +1 -1
  4. package/src/components/Checkout/index.tsx +40 -39
  5. package/src/components/StripeMethodForm/index.tsx +4 -2
  6. package/src/components/VerifyPhone/styles.tsx +1 -2
  7. package/src/context/OfflineActions/index.tsx +236 -0
  8. package/src/types/index.tsx +2 -1
  9. package/themes/business/index.tsx +2 -0
  10. package/themes/business/src/components/AcceptOrRejectOrder/index.tsx +9 -6
  11. package/themes/business/src/components/AcceptOrRejectOrder/styles.tsx +1 -0
  12. package/themes/business/src/components/BusinessController/index.tsx +8 -3
  13. package/themes/business/src/components/BusinessProductList/index.tsx +3 -2
  14. package/themes/business/src/components/Chat/index.tsx +15 -3
  15. package/themes/business/src/components/DriverMap/index.tsx +49 -26
  16. package/themes/business/src/components/FloatingButton/index.tsx +3 -2
  17. package/themes/business/src/components/GoogleMap/index.tsx +15 -8
  18. package/themes/business/src/components/LanguageSelector/index.tsx +2 -3
  19. package/themes/business/src/components/LanguageSelector/lang_country.json +515 -70
  20. package/themes/business/src/components/LogoutButton/index.tsx +1 -1
  21. package/themes/business/src/components/MapView/index.tsx +36 -17
  22. package/themes/business/src/components/NewOrderNotification/index.tsx +38 -19
  23. package/themes/business/src/components/OrderDetails/Business.tsx +47 -27
  24. package/themes/business/src/components/OrderDetails/Delivery.tsx +134 -53
  25. package/themes/business/src/components/OrderDetails/OrderContentComponent.tsx +128 -41
  26. package/themes/business/src/components/OrderDetails/OrderHeaderComponent.tsx +45 -18
  27. package/themes/business/src/components/OrderDetails/styles.tsx +39 -3
  28. package/themes/business/src/components/OrderDetails/usePrinterCommands.tsx +17 -16
  29. package/themes/business/src/components/OrderDetailsLogistic/index.tsx +3 -2
  30. package/themes/business/src/components/OrderSummary/index.tsx +6 -4
  31. package/themes/business/src/components/OrdersListManager/index.tsx +13 -1
  32. package/themes/business/src/components/OrdersOption/index.tsx +217 -156
  33. package/themes/business/src/components/PhoneInputNumber/index.tsx +8 -5
  34. package/themes/business/src/components/PreviousMessages/index.tsx +26 -3
  35. package/themes/business/src/components/PreviousOrders/OrderItem.tsx +39 -16
  36. package/themes/business/src/components/PreviousOrders/index.tsx +74 -66
  37. package/themes/business/src/components/PrinterEdition/MessageAlert.tsx +33 -0
  38. package/themes/business/src/components/PrinterEdition/index.tsx +431 -0
  39. package/themes/business/src/components/PrinterEdition/printerList.tsx +23 -0
  40. package/themes/business/src/components/PrinterEdition/styles.tsx +61 -0
  41. package/themes/business/src/components/PrinterSettings/index.tsx +162 -174
  42. package/themes/business/src/components/PrinterSettings/styles.tsx +14 -1
  43. package/themes/business/src/components/ProductItemAccordion/index.tsx +3 -2
  44. package/themes/business/src/components/ReviewCustomer/index.tsx +2 -0
  45. package/themes/business/src/components/StoresList/index.tsx +2 -2
  46. package/themes/business/src/components/UserProfileForm/index.tsx +55 -22
  47. package/themes/business/src/components/UserProfileForm/styles.tsx +7 -0
  48. package/themes/business/src/components/WebsocketStatus/index.tsx +2 -2
  49. package/themes/business/src/components/shared/OTextarea.tsx +8 -9
  50. package/themes/business/src/config/currency.tsx +1010 -0
  51. package/themes/business/src/hooks/useLocation.tsx +16 -12
  52. package/themes/business/src/layouts/SafeAreaContainer.tsx +35 -19
  53. package/themes/business/src/types/index.tsx +16 -4
  54. package/themes/business/src/utils/index.tsx +33 -3
  55. package/themes/doordash/src/components/BusinessesListing/index.tsx +1 -1
  56. package/themes/doordash/src/components/LoginForm/index.tsx +1 -2
  57. package/themes/instacart/src/components/BusinessesListing/index.tsx +1 -1
  58. package/themes/kiosk/src/components/Checkout/index.tsx +6 -0
  59. package/themes/kiosk/src/components/NavBar/index.tsx +14 -14
  60. package/themes/kiosk/src/components/OptionCard/index.tsx +1 -1
  61. package/themes/kiosk/src/components/OrderTypeCardSelector/index.tsx +8 -10
  62. package/themes/kiosk/src/components/shared/OButton.tsx +5 -18
  63. package/themes/original/index.tsx +11 -0
  64. package/themes/original/src/components/AddressForm/index.tsx +32 -17
  65. package/themes/original/src/components/AddressList/index.tsx +8 -7
  66. package/themes/original/src/components/AppleLogin/index.tsx +4 -4
  67. package/themes/original/src/components/BusinessBasicInformation/index.tsx +5 -8
  68. package/themes/original/src/components/BusinessItemAccordion/index.tsx +13 -5
  69. package/themes/original/src/components/BusinessListingSearch/BusinessSearchFooter.tsx +103 -92
  70. package/themes/original/src/components/BusinessListingSearch/BusinessSearchHeader.tsx +8 -6
  71. package/themes/original/src/components/BusinessListingSearch/index.tsx +1 -2
  72. package/themes/original/src/components/BusinessPreorder/index.tsx +46 -28
  73. package/themes/original/src/components/BusinessProductsList/SubcategoriesComponent/index.tsx +73 -70
  74. package/themes/original/src/components/BusinessProductsList/index.tsx +6 -7
  75. package/themes/original/src/components/BusinessProductsList/styles.tsx +0 -3
  76. package/themes/original/src/components/BusinessProductsListing/index.tsx +10 -6
  77. package/themes/original/src/components/BusinessTypeFilter/index.tsx +9 -8
  78. package/themes/original/src/components/BusinessesListing/Layout/Appointment/index.tsx +2 -1
  79. package/themes/original/src/components/BusinessesListing/Layout/Original/styles.tsx +1 -1
  80. package/themes/original/src/components/BusinessesListing/index.tsx +0 -1
  81. package/themes/original/src/components/Cart/index.tsx +46 -14
  82. package/themes/original/src/components/CartContent/index.tsx +2 -4
  83. package/themes/original/src/components/Checkout/index.tsx +127 -77
  84. package/themes/original/src/components/CitiesControl/index.tsx +0 -3
  85. package/themes/original/src/components/CouponControl/index.tsx +1 -3
  86. package/themes/original/src/components/DriverTips/index.tsx +1 -3
  87. package/themes/original/src/components/Favorite/index.tsx +1 -5
  88. package/themes/original/src/components/FavoriteList/index.tsx +0 -1
  89. package/themes/original/src/components/ForgotPasswordForm/index.tsx +5 -7
  90. package/themes/original/src/components/GiftCard/GiftCardUI/index.tsx +15 -17
  91. package/themes/original/src/components/GiftCard/PurchaseGiftCard/index.tsx +3 -7
  92. package/themes/original/src/components/GiftCard/RedeemGiftCard/index.tsx +24 -32
  93. package/themes/original/src/components/GiftCard/SendGiftCard/index.tsx +7 -9
  94. package/themes/original/src/components/GiftCard/VerticalGiftCardOrdersLayout/index.tsx +11 -12
  95. package/themes/original/src/components/GoogleMap/index.tsx +39 -18
  96. package/themes/original/src/components/Help/index.tsx +2 -0
  97. package/themes/original/src/components/HighestRatedBusinesses/index.tsx +1 -1
  98. package/themes/original/src/components/Home/index.tsx +3 -11
  99. package/themes/original/src/components/LoginForm/Otp/index.tsx +0 -3
  100. package/themes/original/src/components/LoginForm/index.tsx +12 -9
  101. package/themes/original/src/components/MessageListing/index.tsx +2 -1
  102. package/themes/original/src/components/Messages/index.tsx +27 -19
  103. package/themes/original/src/components/MomentOption/TimeListItem.tsx +56 -0
  104. package/themes/original/src/components/MomentOption/index.tsx +80 -51
  105. package/themes/original/src/components/MomentSelector/index.tsx +5 -2
  106. package/themes/original/src/components/MultiCartsPaymethodsAndWallets/index.tsx +7 -3
  107. package/themes/original/src/components/MultiCheckout/index.tsx +55 -27
  108. package/themes/original/src/components/MultiOrdersDetails/index.tsx +1 -0
  109. package/themes/original/src/components/MyOrders/index.tsx +2 -2
  110. package/themes/original/src/components/NavBar/index.tsx +7 -4
  111. package/themes/original/src/components/NetworkError/index.tsx +0 -5
  112. package/themes/original/src/components/NotFoundSource/index.tsx +0 -3
  113. package/themes/original/src/components/OrderDetails/OrderEta.tsx +4 -3
  114. package/themes/original/src/components/OrderDetails/OrderHistory.tsx +16 -11
  115. package/themes/original/src/components/OrderDetails/index.tsx +44 -21
  116. package/themes/original/src/components/OrderDetails/styles.tsx +0 -1
  117. package/themes/original/src/components/OrderProgress/index.tsx +4 -3
  118. package/themes/original/src/components/OrderSummary/index.tsx +29 -10
  119. package/themes/original/src/components/OrderTypeSelector/index.tsx +7 -6
  120. package/themes/original/src/components/OrdersOption/index.tsx +3 -6
  121. package/themes/original/src/components/PaymentOptionStripe/index.tsx +0 -5
  122. package/themes/original/src/components/PaymentOptionWallet/index.tsx +56 -56
  123. package/themes/original/src/components/PaymentOptions/index.tsx +4 -3
  124. package/themes/original/src/components/PhoneInputNumber/index.tsx +92 -7
  125. package/themes/original/src/components/PlaceSpot/index.tsx +1 -3
  126. package/themes/original/src/components/PreviousOrders/index.tsx +1 -2
  127. package/themes/original/src/components/ProductForm/ActionButton.tsx +17 -20
  128. package/themes/original/src/components/ProductForm/index.tsx +107 -102
  129. package/themes/original/src/components/ProductItemAccordion/index.tsx +50 -43
  130. package/themes/original/src/components/ProductItemAccordion/styles.tsx +0 -3
  131. package/themes/original/src/components/ProductOptionSubOption/index.tsx +16 -8
  132. package/themes/original/src/components/ProfessionalProfile/index.tsx +4 -5
  133. package/themes/original/src/components/Promotions/index.tsx +6 -9
  134. package/themes/original/src/components/ReviewDriver/index.tsx +1 -1
  135. package/themes/original/src/components/ReviewOrder/index.tsx +2 -2
  136. package/themes/original/src/components/ReviewProducts/index.tsx +1 -1
  137. package/themes/original/src/components/ReviewTrigger/index.tsx +2 -2
  138. package/themes/original/src/components/ServiceForm/index.tsx +52 -54
  139. package/themes/original/src/components/Sessions/index.tsx +3 -3
  140. package/themes/original/src/components/SignupForm/index.tsx +102 -88
  141. package/themes/original/src/components/SingleOrderCard/index.tsx +6 -4
  142. package/themes/original/src/components/SingleProductCard/index.tsx +5 -5
  143. package/themes/original/src/components/SingleProductCard/styles.tsx +0 -3
  144. package/themes/original/src/components/StripeCardForm/index.tsx +0 -3
  145. package/themes/original/src/components/StripeCardsList/index.tsx +16 -3
  146. package/themes/original/src/components/StripeElementsForm/index.tsx +76 -62
  147. package/themes/original/src/components/StripeElementsForm/naked.tsx +48 -1
  148. package/themes/original/src/components/StripeRedirectForm/index.tsx +0 -3
  149. package/themes/original/src/components/TaxInformation/index.tsx +3 -2
  150. package/themes/original/src/components/UpsellingProducts/UpsellingContent.tsx +10 -7
  151. package/themes/original/src/components/UpsellingProducts/UpsellingLayout.tsx +8 -3
  152. package/themes/original/src/components/UserDetails/index.tsx +17 -16
  153. package/themes/original/src/components/UserFormDetails/index.tsx +164 -135
  154. package/themes/original/src/components/UserProfile/index.tsx +9 -1
  155. package/themes/original/src/components/UserVerification/index.tsx +15 -4
  156. package/themes/original/src/components/Wallets/index.tsx +6 -3
  157. package/themes/original/src/components/WebsocketStatus/index.tsx +1 -4
  158. package/themes/original/src/components/shared/OAlert.tsx +2 -1
  159. package/themes/original/src/components/shared/OButton.tsx +5 -4
  160. package/themes/original/src/components/shared/OInput.tsx +4 -8
  161. package/themes/original/src/components/shared/OModal.tsx +7 -2
  162. package/themes/original/src/types/index.tsx +10 -3
  163. package/themes/original/src/utils/index.tsx +30 -1
  164. package/themes/uber-eats/src/components/BusinessesListing/index.tsx +1 -1
@@ -36,6 +36,7 @@ import {
36
36
  useSession,
37
37
  useUtils,
38
38
  useLanguage,
39
+ useConfig
39
40
  } from 'ordering-components/native';
40
41
  import { Header, TitleHeader, Wrapper, QuickMessageContainer } from './styles';
41
42
  import { OIcon, OIconButton, OText, OButton } from '../shared';
@@ -68,8 +69,9 @@ const ChatUI = (props: MessagesParams) => {
68
69
  const [, t] = useLanguage();
69
70
  const [, { showToast }] = useToast();
70
71
  const theme = useTheme();
72
+ const [{ configs }] = useConfig();
71
73
  const [messageList, setMessageList] = useState<any>([])
72
- const previousStatus = [1, 2, 5, 6, 10, 11, 12, 16, 17]
74
+ const previousStatus = [1, 2, 5, 6, 10, 11, 12, 15, 16, 17]
73
75
  const chatDisabled = previousStatus.includes(order?.status)
74
76
 
75
77
  const ORDER_STATUS: any = {
@@ -96,7 +98,10 @@ const ChatUI = (props: MessagesParams) => {
96
98
  20: t('ORDER_CUSTOMER_ALMOST_ARRIVED_BUSINESS', 'Order customer almost arrived to business'),
97
99
  21: t('ORDER_CUSTOMER_ARRIVED_BUSINESS', 'Order customer arrived to business'),
98
100
  22: t('ORDER_LOOKING_FOR_DRIVER', 'Order looking for driver'),
99
- 23: t('ORDER_DRIVER_ON_WAY', 'Driver on way')
101
+ 23: t('ORDER_DRIVER_ON_WAY', 'Driver on way'),
102
+ 24: t('ORDER_DRIVER_WAITING_FOR_ORDER', 'Driver waiting for order'),
103
+ 25: t('ORDER_ACCEPTED_BY_DRIVER_COMPANY', 'Accepted by driver company'),
104
+ 26: t('ORDER_DRIVER_ARRIVED_CUSTOMER', 'Driver arrived to customer')
100
105
  }
101
106
 
102
107
  const getLogisticTag = (status: any) => {
@@ -498,6 +503,7 @@ const ChatUI = (props: MessagesParams) => {
498
503
 
499
504
  const firstMessage = {
500
505
  _id: 0,
506
+ type: 0,
501
507
  text: console,
502
508
  createdAt: parseDate(order?.created_at, { outputFormat: 'YYYY-MM-DD HH:mm:ss' }),
503
509
  system: true,
@@ -517,6 +523,7 @@ const ChatUI = (props: MessagesParams) => {
517
523
  text: message.type === 1 ? messageConsole(message) : message.comment,
518
524
  createdAt: message.type !== 0 && parseDate(message?.created_at, { outputFormat: 'YYYY-MM-DD HH:mm:ss' }),
519
525
  image: message.source,
526
+ type: message.type,
520
527
  system: message.type === 1,
521
528
  user: {
522
529
  _id: message.author?.id,
@@ -537,7 +544,12 @@ const ChatUI = (props: MessagesParams) => {
537
544
  newMessages = [...newMessages, newMessage];
538
545
  }
539
546
  });
540
- setFormattedMessages([...newMessages.reverse()]);
547
+ let _arrayMessages = [...newMessages.reverse()]
548
+
549
+ if (configs?.order_logbook_enabled?.value === '0' && user?.level === 4) {
550
+ _arrayMessages = _arrayMessages.filter(msg => msg.type !== 1 && msg.type !== 0)
551
+ }
552
+ setFormattedMessages(_arrayMessages);
541
553
  }, [messages?.messages?.length]);
542
554
 
543
555
  useEffect(() => {
@@ -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,
@@ -69,11 +69,26 @@ export const DriverMap = (props: GoogleMapsParams) => {
69
69
  stopFollowUserLocation,
70
70
  } = useLocation();
71
71
 
72
- const origin = {
73
- latitude: initialPosition.latitude,
74
- longitude: initialPosition.longitude,
75
- };
76
- const destination = { latitude: location.lat, longitude: location.lng };
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)])
77
92
 
78
93
  useEffect(() => {
79
94
  if (isToFollow) {
@@ -161,21 +176,21 @@ export const DriverMap = (props: GoogleMapsParams) => {
161
176
  if (driverUpdateLocation.error) return;
162
177
 
163
178
  calculateDistance(
164
- { lat: userLocation.latitude, lng: userLocation.longitude },
165
- destination,
179
+ { lat: parsedUserLocation()?.latitude, lng: parsedUserLocation()?.longitude },
180
+ parsedDestination(),
166
181
  );
167
182
  // geocodePosition(userLocation);
168
183
 
169
184
  if (!following.current) return;
170
185
  fitCoordinates();
171
186
 
172
- const { latitude, longitude } = userLocation;
187
+ const { latitude, longitude } = parsedUserLocation();
173
188
 
174
189
  mapRef.current?.animateCamera({
175
190
  center: { latitude, longitude },
176
191
  });
177
192
 
178
- }, [userLocation]);
193
+ }, [JSON.stringify(userLocation)]);
179
194
 
180
195
  const handleArrowBack: any = () => {
181
196
  setDriverUpdateLocation?.({
@@ -221,6 +236,11 @@ export const DriverMap = (props: GoogleMapsParams) => {
221
236
  19: theme.colors.statusOrderBlue,
222
237
  20: theme.colors.statusOrderBlue,
223
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,
224
244
  //GREEN
225
245
  1: theme.colors.statusOrderGreen,
226
246
  11: theme.colors.statusOrderGreen,
@@ -241,8 +261,8 @@ export const DriverMap = (props: GoogleMapsParams) => {
241
261
  [
242
262
  { latitude: location.lat, longitude: location.lng },
243
263
  {
244
- latitude: initialPosition.latitude,
245
- longitude: initialPosition.longitude,
264
+ latitude: parsedInitialPosition()?.latitude,
265
+ longitude: parsedInitialPosition()?.longitude,
246
266
  },
247
267
  ],
248
268
  {
@@ -255,7 +275,7 @@ export const DriverMap = (props: GoogleMapsParams) => {
255
275
 
256
276
  useEffect(() => {
257
277
  const interval = setInterval(() => {
258
- if (initialPosition.latitude !== 0 && autoFit.current) {
278
+ if (parsedInitialPosition()?.latitude !== 0 && autoFit.current) {
259
279
  if (mapRef.current) {
260
280
  fitCoordinates();
261
281
  autoFit.current = false;
@@ -263,7 +283,7 @@ export const DriverMap = (props: GoogleMapsParams) => {
263
283
  }
264
284
  }, 1000);
265
285
  return () => clearInterval(interval);
266
- }, [initialPosition]);
286
+ }, [parsedInitialPosition()]);
267
287
 
268
288
  const fitCoordinatesZoom = () => {
269
289
  following.current = false;
@@ -346,8 +366,8 @@ export const DriverMap = (props: GoogleMapsParams) => {
346
366
  ref={mapRef}
347
367
  provider={PROVIDER_GOOGLE}
348
368
  initialRegion={{
349
- latitude: initialPosition.latitude,
350
- longitude: initialPosition.longitude,
369
+ latitude: parsedInitialPosition()?.latitude,
370
+ longitude: parsedInitialPosition()?.longitude,
351
371
  latitudeDelta: 0.001,
352
372
  longitudeDelta: 0.001 * ASPECT_RATIO,
353
373
  }}
@@ -369,8 +389,8 @@ export const DriverMap = (props: GoogleMapsParams) => {
369
389
  <>
370
390
  <Marker
371
391
  coordinate={{
372
- latitude: location.lat,
373
- longitude: location.lng,
392
+ latitude: parsedDestination()?.latitude,
393
+ longitude: parsedDestination()?.longitude
374
394
  }}
375
395
  title={location.title}>
376
396
  <Icon
@@ -387,7 +407,10 @@ export const DriverMap = (props: GoogleMapsParams) => {
387
407
  />
388
408
  </View>
389
409
  </Marker>
390
- <Marker coordinate={userLocation}>
410
+ <Marker coordinate={{
411
+ latitude: userLocation?.latitude,
412
+ longitude: userLocation?.longitude
413
+ }}>
391
414
  <View style={styles.driverIcon}>
392
415
  <OIcon
393
416
  style={styles.image}
@@ -401,8 +424,8 @@ export const DriverMap = (props: GoogleMapsParams) => {
401
424
  ) : (
402
425
  <Marker
403
426
  coordinate={{
404
- latitude: userLocation.latitude,
405
- longitude: userLocation.longitude,
427
+ latitude: parsedUserLocation()?.latitude,
428
+ longitude: parsedUserLocation()?.longitude
406
429
  }}
407
430
  title={markerTitle || t('YOUR_LOCATION', 'Your Location')}
408
431
  />
@@ -514,10 +537,10 @@ export const DriverMap = (props: GoogleMapsParams) => {
514
537
  animationIn: 'slideInUp'
515
538
  }}
516
539
  options={{
517
- latitude: destination.latitude,
518
- longitude: destination.longitude,
519
- sourceLatitude: userLocation.latitude,
520
- sourceLongitude: userLocation.longitude,
540
+ latitude: parsedDestination()?.latitude,
541
+ longitude: parsedDestination()?.longitude,
542
+ sourceLatitude: parsedUserLocation()?.latitude,
543
+ sourceLongitude: parsedUserLocation()?.longitude,
521
544
  naverCallerName: 'com.deliveryapp',
522
545
  dialogTitle: t('SHOW_IN_OTHER_MAPS', 'Show in other maps'),
523
546
  dialogMessage: t('WHAT_APP_WOULD_YOU_USE', 'What app would you like to use?'),
@@ -539,7 +562,7 @@ export const DriverMap = (props: GoogleMapsParams) => {
539
562
  secondButton={true}
540
563
  firstColorCustom={theme.colors.red}
541
564
  secondColorCustom={theme.colors.green}
542
- widthButton={isHideRejectButtons ? '100%': '45%'}
565
+ widthButton={isHideRejectButtons ? '100%' : '45%'}
543
566
  isPadding
544
567
  isHideRejectButtons={isHideRejectButtons}
545
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 ? locations[locations.length - 1].lat : location.lat,
54
- longitude: locations ? locations[locations.length - 1].lng : location.lng,
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.lat,
58
- longitude: location.lng,
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
- : { latitude: location.lat, longitude: location.lng };
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