ordering-ui-react-native 0.16.75 → 0.16.76-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 (216) hide show
  1. package/package.json +6 -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 +2 -2
  11. package/src/components/OrdersOption/index.tsx +54 -56
  12. package/src/components/PaymentOptions/index.tsx +298 -347
  13. package/src/components/PaymentOptionsWebView/index.tsx +119 -120
  14. package/src/components/SingleProductReview/index.tsx +7 -4
  15. package/src/components/VerifyPhone/styles.tsx +1 -2
  16. package/src/components/shared/OToast.tsx +4 -4
  17. package/src/types/@fatnlazycat/react-native-recaptcha-v3/index.d.ts +1 -0
  18. package/src/utils/index.tsx +2 -1
  19. package/themes/business/src/components/AcceptOrRejectOrder/index.tsx +260 -238
  20. package/themes/business/src/components/AcceptOrRejectOrder/styles.tsx +6 -4
  21. package/themes/business/src/components/BusinessController/index.tsx +2 -2
  22. package/themes/business/src/components/Chat/index.tsx +31 -31
  23. package/themes/business/src/components/DriverMap/index.tsx +7 -5
  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 +332 -140
  27. package/themes/business/src/components/LoginForm/styles.tsx +10 -0
  28. package/themes/business/src/components/MapView/index.tsx +14 -3
  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/OrderContentComponent.tsx +70 -43
  32. package/themes/business/src/components/OrderDetails/OrderHeaderComponent.tsx +3 -3
  33. package/themes/business/src/components/OrdersOption/index.tsx +63 -73
  34. package/themes/business/src/components/OrdersOption/styles.tsx +5 -1
  35. package/themes/business/src/components/OrdersOptionBusiness/index.tsx +15 -1
  36. package/themes/business/src/components/OrdersOptionCity/index.tsx +15 -1
  37. package/themes/business/src/components/OrdersOptionDate/index.tsx +19 -6
  38. package/themes/business/src/components/OrdersOptionDelivery/index.tsx +15 -1
  39. package/themes/business/src/components/OrdersOptionDriver/index.tsx +15 -1
  40. package/themes/business/src/components/OrdersOptionPaymethod/index.tsx +15 -1
  41. package/themes/business/src/components/OrdersOptionStatus/index.tsx +10 -1
  42. package/themes/business/src/components/PreviousMessages/index.tsx +17 -18
  43. package/themes/business/src/components/PreviousOrders/OrderItem.tsx +250 -0
  44. package/themes/business/src/components/PreviousOrders/OrdersGroupedItem.tsx +115 -0
  45. package/themes/business/src/components/PreviousOrders/index.tsx +440 -245
  46. package/themes/business/src/components/PreviousOrders/styles.tsx +31 -3
  47. package/themes/business/src/components/ProductItemAccordion/index.tsx +24 -5
  48. package/themes/business/src/components/ReviewCustomer/index.tsx +39 -15
  49. package/themes/business/src/components/shared/ODropDown.tsx +42 -8
  50. package/themes/business/src/components/shared/ODropDownCalendar.tsx +36 -7
  51. package/themes/business/src/components/shared/OLink.tsx +33 -13
  52. package/themes/business/src/components/shared/OText.tsx +8 -2
  53. package/themes/business/src/types/index.tsx +29 -3
  54. package/themes/business/src/utils/index.tsx +26 -0
  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/BusinessesListing/index.tsx +2 -1
  59. package/themes/kiosk/src/components/Checkout/index.tsx +6 -0
  60. package/themes/kiosk/src/components/LoginForm/Otp/index.tsx +92 -0
  61. package/themes/kiosk/src/components/LoginForm/Otp/styles.tsx +7 -0
  62. package/themes/kiosk/src/components/LoginForm/index.tsx +545 -112
  63. package/themes/kiosk/src/components/LoginForm/styles.tsx +18 -0
  64. package/themes/kiosk/src/components/NavBar/index.tsx +14 -14
  65. package/themes/kiosk/src/components/OptionCard/index.tsx +1 -1
  66. package/themes/kiosk/src/components/OrderTypeCardSelector/index.tsx +8 -10
  67. package/themes/kiosk/src/components/PhoneInputNumber/index.tsx +1 -0
  68. package/themes/kiosk/src/components/PhoneInputNumber/styles.tsx +1 -3
  69. package/themes/kiosk/src/components/ProductForm/index.tsx +1 -14
  70. package/themes/kiosk/src/components/shared/OButton.tsx +5 -18
  71. package/themes/kiosk/src/components/shared/OModal.tsx +14 -11
  72. package/themes/kiosk/src/layouts/Container.tsx +7 -1
  73. package/themes/kiosk/src/types/index.d.ts +15 -0
  74. package/themes/kiosk/src/utils/index.tsx +15 -0
  75. package/themes/original/index.tsx +8 -0
  76. package/themes/original/src/components/AddressDetails/index.tsx +10 -8
  77. package/themes/original/src/components/AddressForm/index.tsx +155 -139
  78. package/themes/original/src/components/AddressList/index.tsx +18 -18
  79. package/themes/original/src/components/AddressList/styles.tsx +4 -2
  80. package/themes/original/src/components/AppleLogin/index.tsx +4 -4
  81. package/themes/original/src/components/BusinessBasicInformation/index.tsx +47 -22
  82. package/themes/original/src/components/BusinessController/index.tsx +101 -70
  83. package/themes/original/src/components/BusinessController/styles.tsx +14 -9
  84. package/themes/original/src/components/BusinessInformation/index.tsx +10 -31
  85. package/themes/original/src/components/BusinessItemAccordion/index.tsx +12 -6
  86. package/themes/original/src/components/BusinessListingSearch/BusinessControllerSkeletons/index.tsx +57 -0
  87. package/themes/original/src/components/BusinessListingSearch/MaxSectionItem/index.tsx +59 -0
  88. package/themes/original/src/components/BusinessListingSearch/MaxSectionItem/styles.tsx +13 -0
  89. package/themes/original/src/components/BusinessListingSearch/index.tsx +104 -155
  90. package/themes/original/src/components/BusinessListingSearch/styles.tsx +10 -12
  91. package/themes/original/src/components/BusinessProductsList/SubcategoriesComponent/index.tsx +87 -0
  92. package/themes/original/src/components/BusinessProductsList/SubcategoriesComponent/styles.tsx +12 -0
  93. package/themes/original/src/components/BusinessProductsList/index.tsx +26 -52
  94. package/themes/original/src/components/BusinessProductsList/styles.tsx +0 -3
  95. package/themes/original/src/components/BusinessProductsListing/index.tsx +563 -493
  96. package/themes/original/src/components/BusinessProductsListing/styles.tsx +13 -12
  97. package/themes/original/src/components/BusinessTypeFilter/index.tsx +3 -2
  98. package/themes/original/src/components/BusinessesListing/Layout/Appointment/index.tsx +2 -1
  99. package/themes/original/src/components/BusinessesListing/Layout/Original/index.tsx +116 -81
  100. package/themes/original/src/components/BusinessesListing/Layout/Original/styles.tsx +1 -9
  101. package/themes/original/src/components/BusinessesListing/index.tsx +7 -6
  102. package/themes/original/src/components/Cart/index.tsx +75 -40
  103. package/themes/original/src/components/CartContent/index.tsx +80 -18
  104. package/themes/original/src/components/CartContent/styles.tsx +11 -1
  105. package/themes/original/src/components/Checkout/index.tsx +102 -108
  106. package/themes/original/src/components/Checkout/styles.tsx +4 -3
  107. package/themes/original/src/components/CitiesControl/index.tsx +89 -0
  108. package/themes/original/src/components/CitiesControl/styles.tsx +17 -0
  109. package/themes/original/src/components/DriverTips/index.tsx +47 -37
  110. package/themes/original/src/components/DriverTips/styles.tsx +2 -1
  111. package/themes/original/src/components/Favorite/index.tsx +7 -4
  112. package/themes/original/src/components/Favorite/styles.tsx +1 -1
  113. package/themes/original/src/components/FavoriteList/index.tsx +70 -80
  114. package/themes/original/src/components/FloatingButton/index.tsx +1 -2
  115. package/themes/original/src/components/FloatingButton/styles.tsx +1 -1
  116. package/themes/original/src/components/GPSButton/index.tsx +20 -19
  117. package/themes/original/src/components/GPSButton/styles.ts +3 -3
  118. package/themes/original/src/components/GoogleMap/index.tsx +10 -1
  119. package/themes/original/src/components/Help/index.tsx +8 -8
  120. package/themes/original/src/components/HelpAccountAndPayment/index.tsx +14 -20
  121. package/themes/original/src/components/HelpAccountAndPayment/styles.tsx +6 -0
  122. package/themes/original/src/components/HelpGuide/index.tsx +13 -12
  123. package/themes/original/src/components/HelpGuide/styles.tsx +6 -0
  124. package/themes/original/src/components/HelpOrder/index.tsx +12 -20
  125. package/themes/original/src/components/HelpOrder/styles.tsx +8 -1
  126. package/themes/original/src/components/LanguageSelector/index.tsx +19 -14
  127. package/themes/original/src/components/LastOrder/index.tsx +1 -34
  128. package/themes/original/src/components/LoginForm/Otp/index.tsx +89 -73
  129. package/themes/original/src/components/LoginForm/Otp/styles.tsx +0 -1
  130. package/themes/original/src/components/LoginForm/index.tsx +98 -41
  131. package/themes/original/src/components/LottieAnimation/index.tsx +78 -0
  132. package/themes/original/src/components/MessageListing/index.tsx +7 -40
  133. package/themes/original/src/components/Messages/index.tsx +42 -26
  134. package/themes/original/src/components/MomentOption/index.tsx +23 -14
  135. package/themes/original/src/components/MultiCart/index.tsx +50 -0
  136. package/themes/original/src/components/MultiCartsPaymethodsAndWallets/index.tsx +92 -93
  137. package/themes/original/src/components/MultiCheckout/index.tsx +158 -77
  138. package/themes/original/src/components/MultiOrdersDetails/SingleOrderCard.tsx +37 -224
  139. package/themes/original/src/components/MultiOrdersDetails/index.tsx +85 -34
  140. package/themes/original/src/components/MultiOrdersDetails/styles.tsx +1 -1
  141. package/themes/original/src/components/MyOrders/index.tsx +66 -17
  142. package/themes/original/src/components/NavBar/index.tsx +7 -6
  143. package/themes/original/src/components/NetworkError/index.tsx +5 -3
  144. package/themes/original/src/components/NotFoundSource/index.tsx +2 -1
  145. package/themes/original/src/components/Notifications/index.tsx +144 -0
  146. package/themes/original/src/components/Notifications/styles.tsx +20 -0
  147. package/themes/original/src/components/OrderDetails/index.tsx +108 -218
  148. package/themes/original/src/components/OrderDetails/styles.tsx +10 -1
  149. package/themes/original/src/components/OrderItAgain/index.tsx +46 -43
  150. package/themes/original/src/components/OrderProgress/index.tsx +81 -105
  151. package/themes/original/src/components/OrderProgress/styles.tsx +5 -0
  152. package/themes/original/src/components/OrderSummary/index.tsx +2 -2
  153. package/themes/original/src/components/OrderTypeSelector/index.tsx +13 -6
  154. package/themes/original/src/components/OrdersOption/PreviousBusinessOrdered/index.tsx +93 -97
  155. package/themes/original/src/components/OrdersOption/PreviousProductsOrdered/index.tsx +3 -0
  156. package/themes/original/src/components/OrdersOption/index.tsx +86 -92
  157. package/themes/original/src/components/PageBanner/index.tsx +146 -0
  158. package/themes/original/src/components/PageBanner/styles.tsx +11 -0
  159. package/themes/original/src/components/PaymentOptionStripe/styles.tsx +1 -1
  160. package/themes/original/src/components/PaymentOptionWallet/index.tsx +56 -56
  161. package/themes/original/src/components/PaymentOptions/index.tsx +1 -1
  162. package/themes/original/src/components/PhoneInputNumber/index.tsx +1 -1
  163. package/themes/original/src/components/PlaceSpot/index.tsx +16 -6
  164. package/themes/original/src/components/PreviousOrders/index.tsx +3 -2
  165. package/themes/original/src/components/ProductForm/index.tsx +240 -254
  166. package/themes/original/src/components/ProductForm/styles.tsx +5 -8
  167. package/themes/original/src/components/ProductItemAccordion/index.tsx +199 -128
  168. package/themes/original/src/components/ProductOptionSubOption/index.tsx +18 -10
  169. package/themes/original/src/components/ProductOptionSubOption/styles.tsx +1 -2
  170. package/themes/original/src/components/ProfessionalFilter/SingleProfessionalCard/index.tsx +108 -0
  171. package/themes/original/src/components/ProfessionalFilter/index.tsx +20 -49
  172. package/themes/original/src/components/ProfessionalProfile/index.tsx +20 -9
  173. package/themes/original/src/components/Promotions/index.tsx +234 -220
  174. package/themes/original/src/components/Promotions/styles.tsx +7 -2
  175. package/themes/original/src/components/ReviewDriver/index.tsx +3 -3
  176. package/themes/original/src/components/ReviewOrder/index.tsx +43 -11
  177. package/themes/original/src/components/ReviewOrder/styles.tsx +7 -0
  178. package/themes/original/src/components/ReviewProducts/index.tsx +8 -5
  179. package/themes/original/src/components/ReviewTrigger/index.tsx +27 -9
  180. package/themes/original/src/components/ReviewTrigger/styles.tsx +8 -1
  181. package/themes/original/src/components/ScheduleAccordion/index.tsx +68 -0
  182. package/themes/original/src/components/ScheduleAccordion/styles.tsx +14 -0
  183. package/themes/original/src/components/ServiceForm/index.tsx +360 -265
  184. package/themes/original/src/components/Sessions/index.tsx +11 -8
  185. package/themes/original/src/components/Sessions/styles.tsx +5 -0
  186. package/themes/original/src/components/SignupForm/index.tsx +150 -100
  187. package/themes/original/src/components/SingleOrderCard/index.tsx +125 -56
  188. package/themes/original/src/components/SingleOrderCard/styles.tsx +10 -8
  189. package/themes/original/src/components/SingleProductCard/index.tsx +116 -79
  190. package/themes/original/src/components/SingleProductCard/styles.tsx +14 -13
  191. package/themes/original/src/components/SingleProductReview/index.tsx +38 -5
  192. package/themes/original/src/components/SingleProductReview/styles.tsx +12 -0
  193. package/themes/original/src/components/StripeCardsList/index.tsx +1 -1
  194. package/themes/original/src/components/StripeElementsForm/index.tsx +3 -0
  195. package/themes/original/src/components/UpsellingProducts/index.tsx +244 -215
  196. package/themes/original/src/components/UpsellingProducts/styles.tsx +12 -1
  197. package/themes/original/src/components/UserDetails/index.tsx +5 -3
  198. package/themes/original/src/components/UserFormDetails/index.tsx +50 -54
  199. package/themes/original/src/components/UserProfile/index.tsx +58 -35
  200. package/themes/original/src/components/UserProfile/styles.ts +17 -0
  201. package/themes/original/src/components/UserProfileForm/index.tsx +21 -28
  202. package/themes/original/src/components/UserProfileForm/styles.tsx +7 -0
  203. package/themes/original/src/components/WalletTransactions/index.tsx +76 -0
  204. package/themes/original/src/components/WalletTransactions/styles.tsx +13 -0
  205. package/themes/original/src/components/Wallets/index.tsx +177 -164
  206. package/themes/original/src/components/Wallets/styles.tsx +12 -8
  207. package/themes/original/src/components/shared/CardAnimation.tsx +47 -0
  208. package/themes/original/src/components/shared/HeaderTitle.tsx +8 -3
  209. package/themes/original/src/components/shared/OBottomPopup.tsx +6 -4
  210. package/themes/original/src/components/shared/OButton.tsx +9 -4
  211. package/themes/original/src/components/shared/OIcon.tsx +8 -1
  212. package/themes/original/src/components/shared/OInput.tsx +10 -1
  213. package/themes/original/src/layouts/Container.tsx +13 -9
  214. package/themes/original/src/types/index.tsx +42 -7
  215. package/themes/original/src/utils/index.tsx +322 -58
  216. 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
  ))}
@@ -13,6 +13,7 @@ import { useTheme } from 'styled-components/native';
13
13
  import { useLocation } from '../../hooks/useLocation';
14
14
  import { FloatingButton } from '../FloatingButton';
15
15
  import { showLocation } from 'react-native-map-link';
16
+ import { transformDistance } from '../../utils';
16
17
 
17
18
  export const DriverMap = (props: GoogleMapsParams) => {
18
19
  const {
@@ -56,6 +57,7 @@ export const DriverMap = (props: GoogleMapsParams) => {
56
57
  content: Array<string>;
57
58
  key?: string | null;
58
59
  }>({ open: false, content: [], key: null });
60
+ const distanceUnit = configState?.configs?.distance_unit?.value
59
61
 
60
62
  const {
61
63
  hasLocation,
@@ -475,9 +477,10 @@ export const DriverMap = (props: GoogleMapsParams) => {
475
477
  src={theme.images.general.arrow_distance}
476
478
  style={styles.arrowDistance}
477
479
  />
478
- <OText size={12} numberOfLines={3}>{`${(
479
- distancesFromTwoPlacesKm * 3280.84
480
- ).toFixed(0)} ${t('FT', 'Ft')}`}</OText>
480
+ <OText size={12} numberOfLines={3}>
481
+ {`${transformDistance(distancesFromTwoPlacesKm, distanceUnit)} ${t(distanceUnit.toUpperCase(), distanceUnit)}`}
482
+ </OText>
483
+
481
484
  </View>
482
485
  <View style={{ width: '75%', paddingRight: 20 }}>
483
486
  <OText
@@ -485,8 +488,7 @@ export const DriverMap = (props: GoogleMapsParams) => {
485
488
  size={13}
486
489
  numberOfLines={2}
487
490
  adjustsFontSizeToFit>
488
- {`${travelTime.toFixed(2)} - ${isMin ? t('MINNUTES', 'mins') : t('HOURS', 'hours')
489
- } ${distancesFromTwoPlacesKm.toFixed(2)} km`}
491
+ {`${travelTime.toFixed(2)} - ${isMin ? t('MINNUTES', 'mins') : t('HOURS', 'hours')}`}
490
492
  </OText>
491
493
  </View>
492
494
  </View>
@@ -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
+ `