ordering-ui-react-native 0.16.83 → 0.16.84-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 (219) hide show
  1. package/package.json +5 -5
  2. package/src/DeliveryApp.tsx +43 -1
  3. package/src/components/ActiveOrders/styles.tsx +8 -14
  4. package/src/components/BusinessInformation/index.tsx +19 -4
  5. package/src/components/BusinessInformation/styles.tsx +2 -2
  6. package/src/components/BusinessProductsList/index.tsx +10 -10
  7. package/src/components/BusinessesListing/index.tsx +1 -1
  8. package/src/components/LanguageSelector/index.tsx +21 -16
  9. package/src/components/Messages/index.tsx +2 -2
  10. package/src/components/OrderCreating/index.tsx +1 -21
  11. package/src/components/OrdersOption/index.tsx +54 -56
  12. package/src/components/PaymentOptionsWebView/index.tsx +119 -120
  13. package/src/components/SingleProductReview/index.tsx +7 -4
  14. package/src/components/VerifyPhone/styles.tsx +1 -2
  15. package/src/components/shared/OToast.tsx +4 -4
  16. package/src/utils/index.tsx +2 -1
  17. package/themes/business/index.tsx +2 -0
  18. package/themes/business/src/components/AcceptOrRejectOrder/index.tsx +260 -238
  19. package/themes/business/src/components/AcceptOrRejectOrder/styles.tsx +6 -4
  20. package/themes/business/src/components/BusinessController/index.tsx +2 -2
  21. package/themes/business/src/components/Chat/index.tsx +31 -31
  22. package/themes/business/src/components/DriverMap/index.tsx +22 -9
  23. package/themes/business/src/components/GoogleMap/index.tsx +58 -57
  24. package/themes/business/src/components/LoginForm/Otp/index.tsx +120 -0
  25. package/themes/business/src/components/LoginForm/Otp/styles.tsx +7 -0
  26. package/themes/business/src/components/LoginForm/index.tsx +236 -80
  27. package/themes/business/src/components/LoginForm/styles.tsx +10 -0
  28. package/themes/business/src/components/MapView/index.tsx +19 -8
  29. package/themes/business/src/components/MessagesOption/index.tsx +11 -1
  30. package/themes/business/src/components/NewOrderNotification/index.tsx +31 -41
  31. package/themes/business/src/components/OrderDetails/Delivery.tsx +4 -3
  32. package/themes/business/src/components/OrderDetails/OrderContentComponent.tsx +96 -50
  33. package/themes/business/src/components/OrderDetails/OrderHeaderComponent.tsx +3 -3
  34. package/themes/business/src/components/OrderDetailsLogistic/index.tsx +195 -0
  35. package/themes/business/src/components/OrderDetailsLogistic/styles.tsx +5 -0
  36. package/themes/business/src/components/OrdersOption/index.tsx +63 -73
  37. package/themes/business/src/components/OrdersOption/styles.tsx +5 -1
  38. package/themes/business/src/components/OrdersOptionBusiness/index.tsx +15 -1
  39. package/themes/business/src/components/OrdersOptionCity/index.tsx +15 -1
  40. package/themes/business/src/components/OrdersOptionDate/index.tsx +19 -6
  41. package/themes/business/src/components/OrdersOptionDelivery/index.tsx +15 -1
  42. package/themes/business/src/components/OrdersOptionDriver/index.tsx +15 -1
  43. package/themes/business/src/components/OrdersOptionPaymethod/index.tsx +15 -1
  44. package/themes/business/src/components/OrdersOptionStatus/index.tsx +10 -1
  45. package/themes/business/src/components/PreviousMessages/index.tsx +17 -18
  46. package/themes/business/src/components/PreviousOrders/OrderItem.tsx +250 -0
  47. package/themes/business/src/components/PreviousOrders/OrdersGroupedItem.tsx +115 -0
  48. package/themes/business/src/components/PreviousOrders/index.tsx +447 -247
  49. package/themes/business/src/components/PreviousOrders/styles.tsx +31 -3
  50. package/themes/business/src/components/ProductItemAccordion/index.tsx +27 -3
  51. package/themes/business/src/components/ReviewCustomer/index.tsx +39 -15
  52. package/themes/business/src/components/shared/ODropDown.tsx +42 -8
  53. package/themes/business/src/components/shared/ODropDownCalendar.tsx +36 -7
  54. package/themes/business/src/components/shared/OLink.tsx +33 -13
  55. package/themes/business/src/components/shared/OModal.tsx +16 -9
  56. package/themes/business/src/components/shared/OText.tsx +8 -2
  57. package/themes/business/src/types/index.tsx +35 -3
  58. package/themes/business/src/utils/index.tsx +53 -0
  59. package/themes/doordash/src/components/BusinessesListing/index.tsx +1 -1
  60. package/themes/doordash/src/components/LoginForm/index.tsx +1 -2
  61. package/themes/instacart/src/components/BusinessesListing/index.tsx +1 -1
  62. package/themes/kiosk/src/components/BusinessesListing/index.tsx +2 -1
  63. package/themes/kiosk/src/components/Checkout/index.tsx +6 -0
  64. package/themes/kiosk/src/components/LoginForm/Otp/index.tsx +92 -0
  65. package/themes/kiosk/src/components/LoginForm/Otp/styles.tsx +7 -0
  66. package/themes/kiosk/src/components/LoginForm/index.tsx +473 -151
  67. package/themes/kiosk/src/components/LoginForm/styles.tsx +14 -1
  68. package/themes/kiosk/src/components/NavBar/index.tsx +14 -14
  69. package/themes/kiosk/src/components/OptionCard/index.tsx +1 -1
  70. package/themes/kiosk/src/components/OrderTypeCardSelector/index.tsx +8 -10
  71. package/themes/kiosk/src/components/PhoneInputNumber/index.tsx +1 -0
  72. package/themes/kiosk/src/components/PhoneInputNumber/styles.tsx +1 -3
  73. package/themes/kiosk/src/components/ProductForm/index.tsx +1 -14
  74. package/themes/kiosk/src/components/shared/OButton.tsx +5 -18
  75. package/themes/kiosk/src/components/shared/OModal.tsx +14 -11
  76. package/themes/kiosk/src/layouts/Container.tsx +7 -1
  77. package/themes/kiosk/src/types/index.d.ts +13 -0
  78. package/themes/kiosk/src/utils/index.tsx +15 -0
  79. package/themes/original/index.tsx +8 -0
  80. package/themes/original/src/components/AddressDetails/index.tsx +10 -8
  81. package/themes/original/src/components/AddressForm/index.tsx +155 -139
  82. package/themes/original/src/components/AddressList/index.tsx +18 -18
  83. package/themes/original/src/components/AddressList/styles.tsx +4 -2
  84. package/themes/original/src/components/AppleLogin/index.tsx +4 -4
  85. package/themes/original/src/components/BusinessBasicInformation/index.tsx +118 -76
  86. package/themes/original/src/components/BusinessController/index.tsx +101 -70
  87. package/themes/original/src/components/BusinessController/styles.tsx +14 -9
  88. package/themes/original/src/components/BusinessInformation/index.tsx +10 -31
  89. package/themes/original/src/components/BusinessItemAccordion/index.tsx +12 -6
  90. package/themes/original/src/components/BusinessListingSearch/BusinessControllerSkeletons/index.tsx +57 -0
  91. package/themes/original/src/components/BusinessListingSearch/MaxSectionItem/index.tsx +59 -0
  92. package/themes/original/src/components/BusinessListingSearch/MaxSectionItem/styles.tsx +13 -0
  93. package/themes/original/src/components/BusinessListingSearch/index.tsx +102 -155
  94. package/themes/original/src/components/BusinessListingSearch/styles.tsx +10 -12
  95. package/themes/original/src/components/BusinessPreorder/index.tsx +96 -15
  96. package/themes/original/src/components/BusinessProductsList/index.tsx +11 -8
  97. package/themes/original/src/components/BusinessProductsList/styles.tsx +0 -3
  98. package/themes/original/src/components/BusinessProductsListing/index.tsx +564 -495
  99. package/themes/original/src/components/BusinessProductsListing/styles.tsx +13 -12
  100. package/themes/original/src/components/BusinessTypeFilter/index.tsx +3 -2
  101. package/themes/original/src/components/BusinessesListing/Layout/Appointment/index.tsx +2 -1
  102. package/themes/original/src/components/BusinessesListing/Layout/Original/index.tsx +116 -81
  103. package/themes/original/src/components/BusinessesListing/Layout/Original/styles.tsx +1 -9
  104. package/themes/original/src/components/BusinessesListing/index.tsx +6 -6
  105. package/themes/original/src/components/Cart/index.tsx +83 -42
  106. package/themes/original/src/components/CartContent/index.tsx +80 -18
  107. package/themes/original/src/components/CartContent/styles.tsx +11 -1
  108. package/themes/original/src/components/Checkout/index.tsx +74 -86
  109. package/themes/original/src/components/Checkout/styles.tsx +4 -2
  110. package/themes/original/src/components/CitiesControl/index.tsx +89 -0
  111. package/themes/original/src/components/CitiesControl/styles.tsx +17 -0
  112. package/themes/original/src/components/DriverTips/index.tsx +52 -37
  113. package/themes/original/src/components/DriverTips/styles.tsx +2 -1
  114. package/themes/original/src/components/Favorite/index.tsx +7 -4
  115. package/themes/original/src/components/Favorite/styles.tsx +1 -1
  116. package/themes/original/src/components/FavoriteList/index.tsx +70 -80
  117. package/themes/original/src/components/FloatingButton/index.tsx +1 -2
  118. package/themes/original/src/components/FloatingButton/styles.tsx +1 -1
  119. package/themes/original/src/components/GPSButton/index.tsx +20 -19
  120. package/themes/original/src/components/GPSButton/styles.ts +3 -3
  121. package/themes/original/src/components/GoogleMap/index.tsx +10 -1
  122. package/themes/original/src/components/Help/index.tsx +8 -8
  123. package/themes/original/src/components/HelpAccountAndPayment/index.tsx +14 -20
  124. package/themes/original/src/components/HelpAccountAndPayment/styles.tsx +6 -0
  125. package/themes/original/src/components/HelpGuide/index.tsx +13 -12
  126. package/themes/original/src/components/HelpGuide/styles.tsx +6 -0
  127. package/themes/original/src/components/HelpOrder/index.tsx +12 -20
  128. package/themes/original/src/components/HelpOrder/styles.tsx +8 -1
  129. package/themes/original/src/components/LanguageSelector/index.tsx +19 -14
  130. package/themes/original/src/components/LastOrder/index.tsx +1 -34
  131. package/themes/original/src/components/LoginForm/Otp/index.tsx +89 -73
  132. package/themes/original/src/components/LoginForm/Otp/styles.tsx +0 -1
  133. package/themes/original/src/components/LoginForm/index.tsx +28 -8
  134. package/themes/original/src/components/LottieAnimation/index.tsx +78 -0
  135. package/themes/original/src/components/MessageListing/index.tsx +7 -40
  136. package/themes/original/src/components/Messages/index.tsx +42 -26
  137. package/themes/original/src/components/MomentOption/index.tsx +195 -88
  138. package/themes/original/src/components/MultiCart/index.tsx +50 -0
  139. package/themes/original/src/components/MultiCartsPaymethodsAndWallets/index.tsx +92 -93
  140. package/themes/original/src/components/MultiCheckout/index.tsx +179 -77
  141. package/themes/original/src/components/MultiOrdersDetails/SingleOrderCard.tsx +37 -224
  142. package/themes/original/src/components/MultiOrdersDetails/index.tsx +85 -34
  143. package/themes/original/src/components/MultiOrdersDetails/styles.tsx +1 -1
  144. package/themes/original/src/components/MyOrders/index.tsx +66 -17
  145. package/themes/original/src/components/NavBar/index.tsx +7 -6
  146. package/themes/original/src/components/NetworkError/index.tsx +5 -3
  147. package/themes/original/src/components/NotFoundSource/index.tsx +2 -1
  148. package/themes/original/src/components/Notifications/index.tsx +144 -0
  149. package/themes/original/src/components/Notifications/styles.tsx +20 -0
  150. package/themes/original/src/components/OrderDetails/index.tsx +108 -218
  151. package/themes/original/src/components/OrderDetails/styles.tsx +10 -1
  152. package/themes/original/src/components/OrderItAgain/index.tsx +46 -43
  153. package/themes/original/src/components/OrderProgress/index.tsx +82 -106
  154. package/themes/original/src/components/OrderProgress/styles.tsx +5 -0
  155. package/themes/original/src/components/OrderSummary/index.tsx +2 -2
  156. package/themes/original/src/components/OrderTypeSelector/index.tsx +13 -6
  157. package/themes/original/src/components/OrdersOption/PreviousBusinessOrdered/index.tsx +93 -97
  158. package/themes/original/src/components/OrdersOption/PreviousProductsOrdered/index.tsx +3 -0
  159. package/themes/original/src/components/OrdersOption/index.tsx +83 -91
  160. package/themes/original/src/components/PageBanner/index.tsx +146 -0
  161. package/themes/original/src/components/PageBanner/styles.tsx +11 -0
  162. package/themes/original/src/components/PaymentOptionStripe/styles.tsx +1 -1
  163. package/themes/original/src/components/PaymentOptionWallet/index.tsx +56 -56
  164. package/themes/original/src/components/PaymentOptions/index.tsx +2 -2
  165. package/themes/original/src/components/PhoneInputNumber/index.tsx +1 -1
  166. package/themes/original/src/components/PlaceSpot/index.tsx +12 -6
  167. package/themes/original/src/components/PreviousOrders/index.tsx +3 -2
  168. package/themes/original/src/components/ProductForm/index.tsx +240 -256
  169. package/themes/original/src/components/ProductForm/styles.tsx +5 -8
  170. package/themes/original/src/components/ProductItemAccordion/index.tsx +199 -128
  171. package/themes/original/src/components/ProductOptionSubOption/index.tsx +18 -10
  172. package/themes/original/src/components/ProductOptionSubOption/styles.tsx +1 -2
  173. package/themes/original/src/components/ProfessionalFilter/SingleProfessionalCard/index.tsx +108 -0
  174. package/themes/original/src/components/ProfessionalFilter/index.tsx +20 -49
  175. package/themes/original/src/components/ProfessionalProfile/index.tsx +54 -14
  176. package/themes/original/src/components/Promotions/index.tsx +234 -220
  177. package/themes/original/src/components/Promotions/styles.tsx +7 -2
  178. package/themes/original/src/components/ReviewDriver/index.tsx +3 -3
  179. package/themes/original/src/components/ReviewOrder/index.tsx +43 -11
  180. package/themes/original/src/components/ReviewOrder/styles.tsx +7 -0
  181. package/themes/original/src/components/ReviewProducts/index.tsx +8 -5
  182. package/themes/original/src/components/ReviewTrigger/index.tsx +27 -9
  183. package/themes/original/src/components/ReviewTrigger/styles.tsx +8 -1
  184. package/themes/original/src/components/ScheduleAccordion/index.tsx +68 -0
  185. package/themes/original/src/components/ScheduleAccordion/styles.tsx +14 -0
  186. package/themes/original/src/components/ServiceForm/index.tsx +377 -270
  187. package/themes/original/src/components/Sessions/index.tsx +11 -8
  188. package/themes/original/src/components/Sessions/styles.tsx +5 -0
  189. package/themes/original/src/components/SignupForm/index.tsx +78 -66
  190. package/themes/original/src/components/SingleOrderCard/index.tsx +125 -56
  191. package/themes/original/src/components/SingleOrderCard/styles.tsx +10 -8
  192. package/themes/original/src/components/SingleProductCard/index.tsx +112 -77
  193. package/themes/original/src/components/SingleProductCard/styles.tsx +14 -13
  194. package/themes/original/src/components/SingleProductReview/index.tsx +38 -5
  195. package/themes/original/src/components/SingleProductReview/styles.tsx +12 -0
  196. package/themes/original/src/components/StripeCardsList/index.tsx +1 -1
  197. package/themes/original/src/components/StripeElementsForm/index.tsx +4 -1
  198. package/themes/original/src/components/UpsellingProducts/index.tsx +244 -215
  199. package/themes/original/src/components/UpsellingProducts/styles.tsx +12 -1
  200. package/themes/original/src/components/UserDetails/index.tsx +5 -3
  201. package/themes/original/src/components/UserFormDetails/index.tsx +50 -54
  202. package/themes/original/src/components/UserProfile/index.tsx +58 -35
  203. package/themes/original/src/components/UserProfile/styles.ts +17 -0
  204. package/themes/original/src/components/UserProfileForm/index.tsx +21 -28
  205. package/themes/original/src/components/UserProfileForm/styles.tsx +7 -0
  206. package/themes/original/src/components/WalletTransactions/index.tsx +76 -0
  207. package/themes/original/src/components/WalletTransactions/styles.tsx +13 -0
  208. package/themes/original/src/components/Wallets/index.tsx +177 -164
  209. package/themes/original/src/components/Wallets/styles.tsx +12 -8
  210. package/themes/original/src/components/shared/CardAnimation.tsx +47 -0
  211. package/themes/original/src/components/shared/HeaderTitle.tsx +8 -3
  212. package/themes/original/src/components/shared/OBottomPopup.tsx +1 -1
  213. package/themes/original/src/components/shared/OButton.tsx +9 -4
  214. package/themes/original/src/components/shared/OIcon.tsx +8 -1
  215. package/themes/original/src/components/shared/OInput.tsx +10 -1
  216. package/themes/original/src/layouts/Container.tsx +13 -9
  217. package/themes/original/src/types/index.tsx +42 -7
  218. package/themes/original/src/utils/index.tsx +321 -58
  219. package/themes/uber-eats/src/components/BusinessesListing/index.tsx +1 -1
@@ -44,33 +44,6 @@ import { USER_TYPE } from '../../config/constants';
44
44
 
45
45
  import SignatureScreen from 'react-native-signature-canvas';
46
46
 
47
- const ORDER_STATUS: any = {
48
- 0: 'ORDER_STATUS_PENDING',
49
- 1: 'ORDERS_COMPLETED',
50
- 2: 'ORDER_REJECTED',
51
- 3: 'ORDER_STATUS_IN_BUSINESS',
52
- 4: 'ORDER_READY',
53
- 5: 'ORDER_REJECTED_RESTAURANT',
54
- 6: 'ORDER_STATUS_CANCELLEDBYDRIVER',
55
- 7: 'ORDER_STATUS_ACCEPTEDBYRESTAURANT',
56
- 8: 'ORDER_CONFIRMED_ACCEPTED_BY_DRIVER',
57
- 9: 'ORDER_PICKUP_COMPLETED_BY_DRIVER',
58
- 10: 'ORDER_PICKUP_FAILED_BY_DRIVER',
59
- 11: 'ORDER_DELIVERY_COMPLETED_BY_DRIVER',
60
- 12: 'ORDER_DELIVERY_FAILED_BY_DRIVER',
61
- 13: 'PREORDER',
62
- 14: 'ORDER_NOT_READY',
63
- 15: 'ORDER_PICKEDUP_COMPLETED_BY_CUSTOMER',
64
- 16: 'ORDER_STATUS_CANCELLED_BY_CUSTOMER',
65
- 17: 'ORDER_NOT_PICKEDUP_BY_CUSTOMER',
66
- 18: 'ORDER_DRIVER_ALMOST_ARRIVED_BUSINESS',
67
- 19: 'ORDER_DRIVER_ALMOST_ARRIVED_CUSTOMER',
68
- 20: 'ORDER_CUSTOMER_ALMOST_ARRIVED_BUSINESS',
69
- 21: 'ORDER_CUSTOMER_ARRIVED_BUSINESS',
70
- 22: 'ORDER_LOOKING_FOR_DRIVER',
71
- 23: 'ORDER_DRIVER_ON_WAY'
72
- }
73
-
74
47
  const filterSpecialStatus = ['prepared_in', 'delivered_in', 'delivery_datetime']
75
48
 
76
49
  const ChatUI = (props: MessagesParams) => {
@@ -97,6 +70,33 @@ const ChatUI = (props: MessagesParams) => {
97
70
  const theme = useTheme();
98
71
  const [messageList, setMessageList] = useState<any>([])
99
72
 
73
+ const ORDER_STATUS: any = {
74
+ 0: t('ORDER_STATUS_PENDING', 'Order status pending'),
75
+ 1: t('ORDERS_COMPLETED', 'Order completed'),
76
+ 2: t('ORDER_REJECTED', 'Order rejected'),
77
+ 3: t('ORDER_STATUS_IN_BUSINESS', 'Order status in business'),
78
+ 4: t('ORDER_READY', 'Order ready'),
79
+ 5: t('ORDER_REJECTED_RESTAURANT', 'Order rejected by restaurant'),
80
+ 6: t('ORDER_STATUS_CANCELLEDBYDRIVER', 'Order status cancelled by driver'),
81
+ 7: t('ORDER_STATUS_ACCEPTEDBYRESTAURANT', 'Order status accepted by restaurant'),
82
+ 8: t('ORDER_CONFIRMED_ACCEPTED_BY_DRIVER', 'Order confirmed accepted by driver'),
83
+ 9: t('ORDER_PICKUP_COMPLETED_BY_DRIVER', 'Order pickup completed by driver'),
84
+ 10: t('ORDER_PICKUP_FAILED_BY_DRIVER', 'Order pickup failed by driver'),
85
+ 11: t('ORDER_DELIVERY_COMPLETED_BY_DRIVER', 'Order delivery completed by driver'),
86
+ 12: t('ORDER_DELIVERY_FAILED_BY_DRIVER', 'Order delivery failed by driver'),
87
+ 13: t('PREORDER', 'Preorder'),
88
+ 14: t('ORDER_NOT_READY', 'Order not ready'),
89
+ 15: t('ORDER_PICKEDUP_COMPLETED_BY_CUSTOMER', 'Order picked up completed by customer'),
90
+ 16: t('ORDER_STATUS_CANCELLED_BY_CUSTOMER', 'Order status cancelled by customer'),
91
+ 17: t('ORDER_NOT_PICKEDUP_BY_CUSTOMER', 'Order not picked up by customer'),
92
+ 18: t('ORDER_DRIVER_ALMOST_ARRIVED_BUSINESS', 'Order driver almost arrived to business'),
93
+ 19: t('ORDER_DRIVER_ALMOST_ARRIVED_CUSTOMER', 'Order driver almost arrived to customer'),
94
+ 20: t('ORDER_CUSTOMER_ALMOST_ARRIVED_BUSINESS', 'Order customer almost arrived to business'),
95
+ 21: t('ORDER_CUSTOMER_ARRIVED_BUSINESS', 'Order customer arrived to business'),
96
+ 22: t('ORDER_LOOKING_FOR_DRIVER', 'Order looking for driver'),
97
+ 23: t('ORDER_DRIVER_ON_WAY', 'Driver on way')
98
+ }
99
+
100
100
  const storeMessageList: any = [
101
101
  { key: 'store_message_1', text: t('STORE_MESSAGE_1', 'store_message_1') },
102
102
  { key: 'store_message_2', text: t('STORE_MESSAGE_2', 'store_message_2') },
@@ -377,7 +377,7 @@ const ChatUI = (props: MessagesParams) => {
377
377
  ?
378
378
  `${t('ORDER', 'Order')} ${t(message.change.attribute.toUpperCase(), message.change.attribute.replace('_', ' '))} ${t('CHANGED_FROM', 'Changed from')} ${filterSpecialStatus.includes(message.change.attribute) ?
379
379
  `${message.change.old === null ? '0' : message.change.old} ${t('TO', 'to')} ${message.change.new} ${t('MINUTES', 'Minutes')}` :
380
- `${message.change.old !== null && t(ORDER_STATUS[parseInt(message.change.old, 10)])} ${t('TO', 'to')} ${t(ORDER_STATUS[parseInt(message.change.new, 10)])}`
380
+ `${message.change.old !== null && ORDER_STATUS[parseInt(message.change.old, 10)]} ${t('TO', 'to')} ${ORDER_STATUS[parseInt(message.change.new, 10)]}`
381
381
  }`
382
382
  : message.change.new
383
383
  ?
@@ -472,7 +472,7 @@ const ChatUI = (props: MessagesParams) => {
472
472
  const firstMessage = {
473
473
  _id: 0,
474
474
  text: console,
475
- createdAt: order?.created_at,
475
+ createdAt: parseDate(order?.created_at, { outputFormat: 'YYYY-MM-DD HH:mm:ss' }),
476
476
  system: true,
477
477
  };
478
478
  messages?.messages.map((message: any) => {
@@ -488,7 +488,7 @@ const ChatUI = (props: MessagesParams) => {
488
488
  newMessage = {
489
489
  _id: message.id,
490
490
  text: message.type === 1 ? messageConsole(message) : message.comment,
491
- createdAt: message.type !== 0 && message.created_at,
491
+ createdAt: message.type !== 0 && parseDate(message?.created_at, { outputFormat: 'YYYY-MM-DD HH:mm:ss' }),
492
492
  image: message.source,
493
493
  system: message.type === 1,
494
494
  user: {
@@ -742,7 +742,7 @@ const ChatUI = (props: MessagesParams) => {
742
742
  color: '#414954'
743
743
  }}
744
744
  style={{ ...styles.editButton }}
745
- onClick={() => handleClickQuickMessage(quickMessage.text)}
745
+ onClick={() => handleClickQuickMessage(message?.length > 0 ? ' ' + quickMessage.text : quickMessage.text)}
746
746
  />
747
747
  </React.Fragment>
748
748
  ))}
@@ -12,7 +12,8 @@ import Icon from 'react-native-vector-icons/FontAwesome5';
12
12
  import { useTheme } from 'styled-components/native';
13
13
  import { useLocation } from '../../hooks/useLocation';
14
14
  import { FloatingButton } from '../FloatingButton';
15
- import { showLocation } from 'react-native-map-link';
15
+ import { Popup } from 'react-native-map-link';
16
+ import { transformDistance } from '../../utils';
16
17
 
17
18
  export const DriverMap = (props: GoogleMapsParams) => {
18
19
  const {
@@ -47,6 +48,7 @@ export const DriverMap = (props: GoogleMapsParams) => {
47
48
  const [distancesFromTwoPlacesKm, setDistancesFromTwoPlacesKm] = useState(0);
48
49
  const [isMin, setIsMin] = useState(false);
49
50
  const [{ parseDate }] = useUtils();
51
+ const [popUp, setPopUp] = useState<boolean>(false);
50
52
  const mapErrors: any = {
51
53
  ERROR_NOT_FOUND_ADDRESS: "Sorry, we couldn't find an address",
52
54
  ERROR_MAX_LIMIT_LOCATION_TO: 'Sorry, You can only set the position to',
@@ -56,6 +58,7 @@ export const DriverMap = (props: GoogleMapsParams) => {
56
58
  content: Array<string>;
57
59
  key?: string | null;
58
60
  }>({ open: false, content: [], key: null });
61
+ const distanceUnit = configState?.configs?.distance_unit?.value
59
62
 
60
63
  const {
61
64
  hasLocation,
@@ -475,9 +478,10 @@ export const DriverMap = (props: GoogleMapsParams) => {
475
478
  src={theme.images.general.arrow_distance}
476
479
  style={styles.arrowDistance}
477
480
  />
478
- <OText size={12} numberOfLines={3}>{`${(
479
- distancesFromTwoPlacesKm * 3280.84
480
- ).toFixed(0)} ${t('FT', 'Ft')}`}</OText>
481
+ <OText size={12} numberOfLines={3}>
482
+ {`${transformDistance(distancesFromTwoPlacesKm, distanceUnit)} ${t(distanceUnit.toUpperCase(), distanceUnit)}`}
483
+ </OText>
484
+
481
485
  </View>
482
486
  <View style={{ width: '75%', paddingRight: 20 }}>
483
487
  <OText
@@ -485,8 +489,7 @@ export const DriverMap = (props: GoogleMapsParams) => {
485
489
  size={13}
486
490
  numberOfLines={2}
487
491
  adjustsFontSizeToFit>
488
- {`${travelTime.toFixed(2)} - ${isMin ? t('MINNUTES', 'mins') : t('HOURS', 'hours')
489
- } ${distancesFromTwoPlacesKm.toFixed(2)} km`}
492
+ {`${travelTime.toFixed(2)} - ${isMin ? t('MINNUTES', 'mins') : t('HOURS', 'hours')}`}
490
493
  </OText>
491
494
  </View>
492
495
  </View>
@@ -499,7 +502,18 @@ export const DriverMap = (props: GoogleMapsParams) => {
499
502
  imgRightSrc=''
500
503
  textStyle={{ color: theme.colors.white }}
501
504
  style={styles.showButton}
502
- onClick={() => showLocation({
505
+ onClick={() => setPopUp(true)}
506
+ text={t('SHOW_IN_OTHER_MAPS', 'Show in other maps')}
507
+ />
508
+ <Popup
509
+ isVisible={popUp}
510
+ onCancelPressed={() => setPopUp(false)}
511
+ onAppPressed={() => setPopUp(false)}
512
+ onBackButtonPressed={() => setPopUp(false)}
513
+ modalProps={{
514
+ animationIn: 'slideInUp'
515
+ }}
516
+ options={{
503
517
  latitude: destination.latitude,
504
518
  longitude: destination.longitude,
505
519
  sourceLatitude: userLocation.latitude,
@@ -508,8 +522,7 @@ export const DriverMap = (props: GoogleMapsParams) => {
508
522
  dialogTitle: t('SHOW_IN_OTHER_MAPS', 'Show in other maps'),
509
523
  dialogMessage: t('WHAT_APP_WOULD_YOU_USE', 'What app would you like to use?'),
510
524
  cancelText: t('CANCEL', 'Cancel'),
511
- })}
512
- text={t('SHOW_IN_OTHER_MAPS', 'Show in other maps')}
525
+ }}
513
526
  />
514
527
  </View>
515
528
  {showAcceptOrReject && (
@@ -80,9 +80,9 @@ export const GoogleMap = (props: GoogleMapsParams) => {
80
80
  locations.map((location: { lat: number; lng: number; level: number }) => {
81
81
  return location.level === 4 && driverLocation?.lat
82
82
  ? {
83
- latitude: driverLocation?.lat,
84
- longitude: driverLocation?.lng,
85
- }
83
+ latitude: driverLocation?.lat,
84
+ longitude: driverLocation?.lng,
85
+ }
86
86
  : { latitude: location.lat, longitude: location.lng };
87
87
  });
88
88
 
@@ -107,7 +107,7 @@ export const GoogleMap = (props: GoogleMapsParams) => {
107
107
  }
108
108
  let data = null;
109
109
  const details = {
110
- geometry: { location: { lat: pos.latitude, lng: pos.longitude } },
110
+ geometry: { location: { lat: pos?.latitude, lng: pos?.longitude } },
111
111
  };
112
112
  if (isSetInputs) {
113
113
  data = {
@@ -165,8 +165,8 @@ export const GoogleMap = (props: GoogleMapsParams) => {
165
165
  const lat1 = pointA.lat;
166
166
  const lon1 = pointA.lng;
167
167
 
168
- const lat2 = pointB.latitude;
169
- const lon2 = pointB.longitude;
168
+ const lat2 = pointB?.latitude;
169
+ const lon2 = pointB?.longitude;
170
170
 
171
171
  const R = 6371e3;
172
172
  const φ1 = lat1 * (Math.PI / 180);
@@ -201,11 +201,11 @@ export const GoogleMap = (props: GoogleMapsParams) => {
201
201
  content: !(errKey === 'ERROR_MAX_LIMIT_LOCATION_TO')
202
202
  ? [t(errKey, mapErrors[errKey])]
203
203
  : [
204
- `${t(errKey, mapErrors[errKey])} ${maxLimitLocation} ${t(
205
- 'METTERS',
206
- 'meters',
207
- )}`,
208
- ],
204
+ `${t(errKey, mapErrors[errKey])} ${maxLimitLocation} ${t(
205
+ 'METTERS',
206
+ 'meters',
207
+ )}`,
208
+ ],
209
209
  key: errKey,
210
210
  });
211
211
  };
@@ -237,9 +237,9 @@ export const GoogleMap = (props: GoogleMapsParams) => {
237
237
  MARKERS = locations.map((location: { lat: number; lng: number; level: number }) => {
238
238
  return location.level === 4 && driverLocation?.lat
239
239
  ? {
240
- latitude: driverLocation?.lat,
241
- longitude: driverLocation?.lng,
242
- }
240
+ latitude: driverLocation?.lat,
241
+ longitude: driverLocation?.lng,
242
+ }
243
243
  : { latitude: location.lat, longitude: location.lng };
244
244
  })
245
245
  fitAllMarkers();
@@ -284,7 +284,7 @@ export const GoogleMap = (props: GoogleMapsParams) => {
284
284
  onRegionChangeComplete={
285
285
  !readOnly
286
286
  ? coordinates => handleChangeRegion(coordinates)
287
- : () => {}
287
+ : () => { }
288
288
  }
289
289
  zoomTapEnabled
290
290
  zoomEnabled
@@ -302,12 +302,13 @@ export const GoogleMap = (props: GoogleMapsParams) => {
302
302
  i: number,
303
303
  ) => (
304
304
  <React.Fragment key={i}>
305
- <Marker
306
- coordinate={location}
307
- onPress={() => {
305
+ <Marker
306
+ coordinate={location}
307
+ onPress={() => {
308
308
  mapRef.current?.animateCamera({
309
- center: { latitude: location.latitude, longitude:location.longitude },
310
- })}}
309
+ center: { latitude: location?.latitude, longitude: location?.longitude },
310
+ })
311
+ }}
311
312
  >
312
313
  <Icon
313
314
  name="map-marker"
@@ -328,46 +329,46 @@ export const GoogleMap = (props: GoogleMapsParams) => {
328
329
  <Callout
329
330
  onPress={() => {
330
331
  showLocation({
331
- latitude: location.latitude,
332
- longitude: location.longitude,
333
- sourceLatitude: userLocation.latitude,
334
- sourceLongitude: userLocation.longitude,
335
- naverCallerName: 'com.businessapp',
336
- dialogTitle: t('SHOW_IN_OTHER_MAPS', 'Show in other maps'),
337
- dialogMessage: t('WHAT_APP_WOULD_YOU_USE', 'What app would you like to use?'),
338
- cancelText: t('CANCEL', 'Cancel'),
332
+ latitude: location?.latitude,
333
+ longitude: location?.longitude,
334
+ sourceLatitude: userLocation?.latitude,
335
+ sourceLongitude: userLocation.longitude,
336
+ naverCallerName: 'com.businessapp',
337
+ dialogTitle: t('SHOW_IN_OTHER_MAPS', 'Show in other maps'),
338
+ dialogMessage: t('WHAT_APP_WOULD_YOU_USE', 'What app would you like to use?'),
339
+ cancelText: t('CANCEL', 'Cancel'),
339
340
  })
340
341
  }}
341
342
  >
342
- <View style={{flex: 1,width: 250, paddingRight: 10, paddingLeft: 10, justifyContent:'space-between' }}>
343
- <View style={{flex: 1, marginBottom: 20}}>
344
- <OText size={16} weight={'bold'} style={{paddingTop: 10, marginBottom: 10}}>{locations[i]?.title}</OText>
345
- { locations[i]?.address && (
346
- <>
347
- <OText size={16} >{locations[i]?.address.addressName}</OText>
348
- <OText size={16} >{locations[i]?.address.zipcode}</OText>
349
- </>
350
- )}
351
- </View>
352
- <OButton
353
- text={t('GO_TO_THIS_LOCATION', 'Go to this location')}
354
- imgRightSrc={null}
355
- textStyle={{
356
- color: theme.colors.white,
357
- fontFamily: 'Poppins',
358
- fontStyle: 'normal',
359
- fontWeight: 'normal',
360
- fontSize: 16
361
- }}
362
- style={{
363
- alignContent:'center',
364
- borderRadius: 10,
365
- height: 35,
366
- bottom:10
367
- }}
368
- bgColor={theme.colors.primary}
369
- borderColor={theme.colors.primary}
370
- />
343
+ <View style={{ flex: 1, width: 250, paddingRight: 10, paddingLeft: 10, justifyContent: 'space-between' }}>
344
+ <View style={{ flex: 1, marginBottom: 20 }}>
345
+ <OText size={16} weight={'bold'} style={{ paddingTop: 10, marginBottom: 10 }}>{locations[i]?.title}</OText>
346
+ {locations[i]?.address && (
347
+ <>
348
+ <OText size={16} >{locations[i]?.address.addressName}</OText>
349
+ <OText size={16} >{locations[i]?.address.zipcode}</OText>
350
+ </>
351
+ )}
352
+ </View>
353
+ <OButton
354
+ text={t('GO_TO_THIS_LOCATION', 'Go to this location')}
355
+ imgRightSrc={null}
356
+ textStyle={{
357
+ color: theme.colors.white,
358
+ fontFamily: 'Poppins',
359
+ fontStyle: 'normal',
360
+ fontWeight: 'normal',
361
+ fontSize: 16
362
+ }}
363
+ style={{
364
+ alignContent: 'center',
365
+ borderRadius: 10,
366
+ height: 35,
367
+ bottom: 10
368
+ }}
369
+ bgColor={theme.colors.primary}
370
+ borderColor={theme.colors.primary}
371
+ />
371
372
  </View>
372
373
  </Callout>
373
374
  </Marker>
@@ -0,0 +1,120 @@
1
+ import React, { useEffect, useState } from 'react'
2
+ import { formatSeconds } from '../../../utils'
3
+ import { StyleSheet, TouchableOpacity, Alert } from 'react-native';
4
+ import { useCountdownTimer } from '../../../../../../src/hooks/useCountdownTimer';
5
+ import { useLanguage } from 'ordering-components/native';
6
+ import { OTPContainer } from './styles';
7
+ import { OText, OButton } from '../../shared';
8
+ import OTPInputView from '@twotalltotems/react-native-otp-input'
9
+ import { useTheme } from 'styled-components/native';
10
+ import { otpParams } from '../../../types'
11
+
12
+ export const Otp = (props: otpParams) => {
13
+ const {
14
+ willVerifyOtpState,
15
+ setWillVerifyOtpState,
16
+ onSubmit,
17
+ handleLoginOtp,
18
+ setAlertState,
19
+ pinCount,
20
+ formState
21
+ } = props
22
+
23
+ const theme = useTheme();
24
+ const [, t] = useLanguage();
25
+ const [code, setCode] = useState('')
26
+ const [otpLeftTime, _, resetOtpLeftTime]: any = useCountdownTimer(
27
+ 600, willVerifyOtpState)
28
+
29
+
30
+ const handleOnSubmit = () => {
31
+ setAlertState({
32
+ open: true,
33
+ title: t('CODE_SENT', 'The code has been sent'),
34
+ })
35
+ resetOtpLeftTime()
36
+ onSubmit()
37
+ }
38
+
39
+ useEffect(() => {
40
+ if (otpLeftTime === 0) {
41
+ setAlertState({
42
+ open: true,
43
+ title: t('TIME_IS_UP', 'Time is up'),
44
+ content: t('PLEASE_RESEND_CODE', 'Please resend code again')
45
+ })
46
+ }
47
+ }, [otpLeftTime])
48
+
49
+ useEffect(() => {
50
+ if (!formState?.loading && formState?.result?.error) {
51
+ Alert.alert(
52
+ t('ERROR', 'Error'),
53
+ typeof formState.result?.result === 'string'
54
+ ? formState.result?.result
55
+ : formState.result?.result[0],
56
+ [
57
+ {
58
+ text: t('ACCEPT', 'Accept'),
59
+ onPress: () => {},
60
+ style: 'cancel'
61
+ },
62
+ ],
63
+ { cancelable: false }
64
+ )
65
+
66
+ if (code.length === (pinCount || 6)) {
67
+ setCode('')
68
+ }
69
+
70
+ }
71
+ }, [formState])
72
+
73
+ const loginStyle = StyleSheet.create({
74
+ underlineStyleBase: {
75
+ width: 45,
76
+ height: 60,
77
+ borderWidth: 1,
78
+ fontSize: 16
79
+ },
80
+ underlineStyleHighLighted: {
81
+ borderColor: theme.colors.primary,
82
+ color: theme.colors.primary,
83
+ fontSize: 16
84
+ },
85
+ });
86
+
87
+ return (
88
+ <>
89
+ <OTPContainer>
90
+ <OText size={24}>
91
+ {formatSeconds(otpLeftTime)}
92
+ </OText>
93
+ <OTPInputView
94
+ style={{ width: '100%', height: 150 }}
95
+ pinCount={pinCount || 6}
96
+ codeInputFieldStyle={loginStyle.underlineStyleBase}
97
+ codeInputHighlightStyle={loginStyle.underlineStyleHighLighted}
98
+ onCodeFilled={(code: string) => handleLoginOtp(code)}
99
+ selectionColor={theme.colors.primary}
100
+ editable
101
+ code={code}
102
+ onCodeChanged={(code: string) => setCode(code)}
103
+ />
104
+ <TouchableOpacity onPress={() => handleOnSubmit()} disabled={otpLeftTime > 520}>
105
+ <OText size={16} mBottom={30} color={otpLeftTime > 520 ? theme.colors.disabled : theme.colors.primary}>
106
+ {t('RESEND_CODE', 'Resend code')}
107
+ </OText>
108
+ </TouchableOpacity>
109
+ <OButton
110
+ onClick={() => setWillVerifyOtpState(false)}
111
+ bgColor={theme.colors.white}
112
+ borderColor={theme.colors.primary}
113
+ textStyle={{ color: theme.colors.primary }}
114
+ style={{ borderRadius: 8, width: '100%' }}
115
+ text={t('CANCEL', 'Cancel')}
116
+ />
117
+ </OTPContainer>
118
+ </>
119
+ )
120
+ }
@@ -0,0 +1,7 @@
1
+ import styled from 'styled-components/native';
2
+
3
+ export const OTPContainer = styled.View`
4
+ padding: 20px;
5
+ align-items: center;
6
+ flex: 1
7
+ `