ordering-ui-react-native 0.18.55 → 0.18.56-crash-driver-1

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 (266) hide show
  1. package/package.json +6 -4
  2. package/src/components/BusinessInformation/index.tsx +10 -9
  3. package/src/components/PaymentOptionsWebView/index.tsx +30 -8
  4. package/src/components/PhoneInputNumber/index.tsx +6 -2
  5. package/src/components/StripeMethodForm/index.tsx +60 -55
  6. package/src/components/shared/OToast.tsx +3 -2
  7. package/src/types/index.tsx +3 -1
  8. package/src/utils/index.tsx +2 -2
  9. package/themes/business/index.tsx +6 -0
  10. package/themes/business/src/components/AcceptOrRejectOrder/index.tsx +15 -8
  11. package/themes/business/src/components/BusinessController/index.tsx +19 -17
  12. package/themes/business/src/components/BusinessProductList/AccordionDropdown.tsx +63 -0
  13. package/themes/business/src/components/BusinessProductList/IterateCategories.tsx +108 -0
  14. package/themes/business/src/components/BusinessProductList/ProductList.tsx +196 -0
  15. package/themes/business/src/components/BusinessProductList/index.tsx +196 -0
  16. package/themes/business/src/components/BusinessProductList/styles.tsx +10 -0
  17. package/themes/business/src/components/Chat/index.tsx +48 -19
  18. package/themes/business/src/components/DriverMap/index.tsx +36 -23
  19. package/themes/business/src/components/DriverSchedule/index.tsx +45 -8
  20. package/themes/business/src/components/FloatingButton/index.tsx +34 -31
  21. package/themes/business/src/components/GoogleMap/index.tsx +15 -8
  22. package/themes/business/src/components/Home/index.tsx +5 -1
  23. package/themes/business/src/components/LanguageSelector/index.tsx +1 -2
  24. package/themes/business/src/components/LanguageSelector/lang_country.json +515 -70
  25. package/themes/business/src/components/LoginForm/index.tsx +2 -2
  26. package/themes/business/src/components/LogoutButton/index.tsx +1 -1
  27. package/themes/business/src/components/MapView/index.tsx +28 -17
  28. package/themes/business/src/components/MessagesOption/index.tsx +22 -94
  29. package/themes/business/src/components/NewOrderNotification/index.tsx +162 -106
  30. package/themes/business/src/components/NotFoundSource/index.tsx +2 -2
  31. package/themes/business/src/components/OrderDetails/Business.tsx +53 -3
  32. package/themes/business/src/components/OrderDetails/Delivery.tsx +209 -13
  33. package/themes/business/src/components/OrderDetails/OrderContentComponent.tsx +107 -75
  34. package/themes/business/src/components/OrderDetails/OrderHeaderComponent.tsx +79 -41
  35. package/themes/business/src/components/OrderDetails/usePrinterCommands.tsx +220 -0
  36. package/themes/business/src/components/OrderDetailsLogistic/index.tsx +7 -2
  37. package/themes/business/src/components/OrderMessage/index.tsx +1 -1
  38. package/themes/business/src/components/OrderSummary/index.tsx +245 -82
  39. package/themes/business/src/components/OrdersListManager/index.tsx +7 -2
  40. package/themes/business/src/components/OrdersListManager/utils.tsx +1 -1
  41. package/themes/business/src/components/OrdersOption/index.tsx +125 -48
  42. package/themes/business/src/components/PhoneInputNumber/index.tsx +8 -5
  43. package/themes/business/src/components/PreviousMessages/FooterMessageComponent.tsx +103 -0
  44. package/themes/business/src/components/PreviousMessages/index.tsx +97 -55
  45. package/themes/business/src/components/PreviousOrders/OrderItem.tsx +43 -41
  46. package/themes/business/src/components/PreviousOrders/OrderList.tsx +93 -0
  47. package/themes/business/src/components/PreviousOrders/OrdersGroupedItem.tsx +1 -1
  48. package/themes/business/src/components/PreviousOrders/index.tsx +195 -221
  49. package/themes/business/src/components/PreviousOrders/styles.tsx +10 -0
  50. package/themes/business/src/components/PrinterEdition/index.tsx +363 -0
  51. package/themes/business/src/components/PrinterEdition/styles.tsx +61 -0
  52. package/themes/business/src/components/PrinterSettings/index.tsx +267 -0
  53. package/themes/business/src/components/PrinterSettings/styles.tsx +30 -0
  54. package/themes/business/src/components/ProductItemAccordion/index.tsx +2 -2
  55. package/themes/business/src/components/ReviewCustomer/index.tsx +1 -1
  56. package/themes/business/src/components/SearchBar/index.tsx +2 -1
  57. package/themes/business/src/components/Sessions/index.tsx +187 -0
  58. package/themes/business/src/components/Sessions/styles.tsx +20 -0
  59. package/themes/business/src/components/StoresList/index.tsx +4 -3
  60. package/themes/business/src/components/UserFormDetails/index.tsx +111 -107
  61. package/themes/business/src/components/UserProfileForm/index.tsx +103 -53
  62. package/themes/business/src/components/WebsocketStatus/index.tsx +171 -0
  63. package/themes/business/src/components/WebsocketStatus/styles.tsx +28 -0
  64. package/themes/business/src/components/shared/OInput.tsx +2 -0
  65. package/themes/business/src/hooks/useLocation.tsx +5 -4
  66. package/themes/business/src/types/index.tsx +21 -1
  67. package/themes/business/src/utils/index.tsx +5 -0
  68. package/themes/kiosk/src/components/Checkout/index.tsx +5 -3
  69. package/themes/kiosk/src/components/CustomerName/index.tsx +1 -1
  70. package/themes/kiosk/src/components/Intro/index.tsx +16 -1
  71. package/themes/kiosk/src/components/LoginForm/index.tsx +131 -101
  72. package/themes/kiosk/src/components/PaymentOptions/index.tsx +57 -121
  73. package/themes/original/index.tsx +11 -3
  74. package/themes/original/src/components/AddressDetails/index.tsx +20 -10
  75. package/themes/original/src/components/AddressForm/index.tsx +41 -20
  76. package/themes/original/src/components/AddressForm/styles.tsx +1 -1
  77. package/themes/original/src/components/AddressList/index.tsx +22 -11
  78. package/themes/original/src/components/AddressList/styles.tsx +4 -4
  79. package/themes/original/src/components/AnalyticsSegment/index.tsx +10 -7
  80. package/themes/original/src/components/AppleLogin/styles.tsx +3 -1
  81. package/themes/original/src/components/BusinessBasicInformation/index.tsx +8 -11
  82. package/themes/original/src/components/BusinessBasicInformation/styles.tsx +1 -1
  83. package/themes/original/src/components/BusinessController/index.tsx +40 -43
  84. package/themes/original/src/components/BusinessController/styles.tsx +12 -12
  85. package/themes/original/src/components/BusinessInformation/index.tsx +45 -17
  86. package/themes/original/src/components/BusinessInformation/styles.tsx +2 -2
  87. package/themes/original/src/components/BusinessItemAccordion/index.tsx +11 -7
  88. package/themes/original/src/components/BusinessListingSearch/BusinessSearchFooter.tsx +317 -0
  89. package/themes/original/src/components/BusinessListingSearch/BusinessSearchHeader.tsx +96 -0
  90. package/themes/original/src/components/BusinessListingSearch/MaxSectionItem/index.tsx +1 -1
  91. package/themes/original/src/components/BusinessListingSearch/index.tsx +57 -361
  92. package/themes/original/src/components/BusinessListingSearch/styles.tsx +1 -1
  93. package/themes/original/src/components/BusinessPreorder/index.tsx +9 -7
  94. package/themes/original/src/components/BusinessProductsCategories/index.tsx +2 -3
  95. package/themes/original/src/components/BusinessProductsList/index.tsx +5 -4
  96. package/themes/original/src/components/BusinessProductsListing/index.tsx +67 -28
  97. package/themes/original/src/components/BusinessProductsListing/styles.tsx +3 -4
  98. package/themes/original/src/components/BusinessReviews/index.tsx +1 -1
  99. package/themes/original/src/components/BusinessesListing/Layout/Appointment/index.tsx +1 -1
  100. package/themes/original/src/components/BusinessesListing/Layout/Appointment/styles.tsx +5 -5
  101. package/themes/original/src/components/BusinessesListing/Layout/Original/FlatListBusinessListFooter.tsx +69 -0
  102. package/themes/original/src/components/BusinessesListing/Layout/Original/FlatListBusinessListHeader.tsx +406 -0
  103. package/themes/original/src/components/BusinessesListing/Layout/Original/FlatListBusinessListing.tsx +76 -0
  104. package/themes/original/src/components/BusinessesListing/Layout/Original/index.tsx +30 -404
  105. package/themes/original/src/components/BusinessesListing/Layout/Original/styles.tsx +2 -2
  106. package/themes/original/src/components/Cart/index.tsx +51 -40
  107. package/themes/original/src/components/CartContent/index.tsx +98 -54
  108. package/themes/original/src/components/CartStoresListing/styles.tsx +2 -2
  109. package/themes/original/src/components/Checkout/index.tsx +308 -75
  110. package/themes/original/src/components/Checkout/styles.tsx +17 -0
  111. package/themes/original/src/components/CitiesControl/styles.tsx +1 -1
  112. package/themes/original/src/components/DatePicker/index.tsx +33 -0
  113. package/themes/original/src/components/DatePicker/styles.tsx +20 -0
  114. package/themes/original/src/components/DriverTips/index.tsx +6 -3
  115. package/themes/original/src/components/FacebookLogin/styles.tsx +3 -1
  116. package/themes/original/src/components/Favorite/index.tsx +8 -4
  117. package/themes/original/src/components/Favorite/styles.tsx +0 -2
  118. package/themes/original/src/components/FloatingButton/styles.tsx +1 -1
  119. package/themes/original/src/components/ForgotPasswordForm/index.tsx +5 -0
  120. package/themes/original/src/components/GPSButton/index.tsx +7 -5
  121. package/themes/original/src/components/GiftCard/GiftCardOrdersList/index.tsx +64 -0
  122. package/themes/original/src/components/GiftCard/GiftCardOrdersList/styles.tsx +8 -0
  123. package/themes/original/src/components/GiftCard/GiftCardUI/index.tsx +8 -3
  124. package/themes/original/src/components/GiftCard/PurchaseGiftCard/index.tsx +36 -3
  125. package/themes/original/src/components/GiftCard/PurchaseGiftCard/styles.tsx +1 -1
  126. package/themes/original/src/components/GiftCard/RedeemGiftCard/index.tsx +84 -8
  127. package/themes/original/src/components/GiftCard/RedeemGiftCard/styles.tsx +1 -1
  128. package/themes/original/src/components/GiftCard/SendGiftCard/index.tsx +2 -2
  129. package/themes/original/src/components/GiftCard/SendGiftCard/styles.tsx +1 -1
  130. package/themes/original/src/components/GiftCard/SingleGiftCard/index.tsx +101 -0
  131. package/themes/original/src/components/GiftCard/SingleGiftCard/styles.tsx +4 -0
  132. package/themes/original/src/components/GiftCard/VerticalGiftCardOrdersLayout/index.tsx +83 -0
  133. package/themes/original/src/components/GiftCard/VerticalGiftCardOrdersLayout/styles.tsx +9 -0
  134. package/themes/original/src/components/GoogleLogin/styles.tsx +1 -1
  135. package/themes/original/src/components/GoogleMap/index.tsx +52 -5
  136. package/themes/original/src/components/Help/index.tsx +7 -0
  137. package/themes/original/src/components/HelpAccountAndPayment/index.tsx +5 -0
  138. package/themes/original/src/components/HelpGuide/index.tsx +5 -0
  139. package/themes/original/src/components/HelpOrder/index.tsx +5 -0
  140. package/themes/original/src/components/HighestRatedBusinesses/index.tsx +1 -1
  141. package/themes/original/src/components/HighestRatedBusinesses/styles.tsx +1 -1
  142. package/themes/original/src/components/Home/index.tsx +3 -2
  143. package/themes/original/src/components/LastOrder/index.tsx +2 -1
  144. package/themes/original/src/components/LastOrders/index.tsx +2 -1
  145. package/themes/original/src/components/LoginForm/Otp/index.tsx +79 -25
  146. package/themes/original/src/components/LoginForm/index.tsx +38 -14
  147. package/themes/original/src/components/MessageListing/index.tsx +6 -0
  148. package/themes/original/src/components/Messages/index.tsx +9 -3
  149. package/themes/original/src/components/Messages/styles.tsx +1 -1
  150. package/themes/original/src/components/MomentOption/index.tsx +20 -5
  151. package/themes/original/src/components/MomentSelector/index.tsx +1 -1
  152. package/themes/original/src/components/MultiCart/index.tsx +1 -1
  153. package/themes/original/src/components/MultiCartsPaymethodsAndWallets/index.tsx +48 -15
  154. package/themes/original/src/components/MultiCheckout/index.tsx +295 -56
  155. package/themes/original/src/components/MultiCheckout/styles.tsx +20 -1
  156. package/themes/original/src/components/MultiOrdersDetails/index.tsx +21 -16
  157. package/themes/original/src/components/MyOrders/index.tsx +37 -39
  158. package/themes/original/src/components/NavBar/index.tsx +15 -14
  159. package/themes/original/src/components/NetworkError/index.tsx +2 -3
  160. package/themes/original/src/components/NetworkError/styles.tsx +2 -2
  161. package/themes/original/src/components/Notifications/index.tsx +9 -8
  162. package/themes/original/src/components/Notifications/styles.tsx +0 -1
  163. package/themes/original/src/components/OrderDetails/OrderEta.tsx +21 -6
  164. package/themes/original/src/components/OrderDetails/OrderHistory.tsx +14 -5
  165. package/themes/original/src/components/OrderDetails/index.tsx +718 -667
  166. package/themes/original/src/components/OrderDetails/styles.tsx +24 -7
  167. package/themes/original/src/components/OrderProgress/index.tsx +50 -14
  168. package/themes/original/src/components/OrderProgress/styles.tsx +1 -1
  169. package/themes/original/src/components/OrderSummary/index.tsx +26 -34
  170. package/themes/original/src/components/OrderTypeSelector/index.tsx +5 -0
  171. package/themes/original/src/components/OrdersOption/PreviousBusinessOrdered/styles.tsx +1 -1
  172. package/themes/original/src/components/OrdersOption/PreviousProductsOrdered/styles.tsx +1 -1
  173. package/themes/original/src/components/OrdersOption/index.tsx +14 -6
  174. package/themes/original/src/components/OrdersOption/styles.tsx +1 -1
  175. package/themes/original/src/components/PageBanner/index.tsx +3 -0
  176. package/themes/original/src/components/PaymentOptionCard/index.tsx +182 -0
  177. package/themes/original/src/components/PaymentOptionStripe/styles.tsx +3 -0
  178. package/themes/original/src/components/PaymentOptions/index.tsx +118 -37
  179. package/themes/original/src/components/PhoneInputNumber/index.tsx +15 -1
  180. package/themes/original/src/components/PreviousOrders/index.tsx +2 -0
  181. package/themes/original/src/components/ProductForm/ActionButton.tsx +122 -0
  182. package/themes/original/src/components/ProductForm/ExtraOptions.tsx +56 -0
  183. package/themes/original/src/components/ProductForm/index.tsx +193 -267
  184. package/themes/original/src/components/ProductForm/styles.tsx +1 -1
  185. package/themes/original/src/components/ProductItemAccordion/index.tsx +55 -42
  186. package/themes/original/src/components/ProductItemAccordion/styles.tsx +3 -4
  187. package/themes/original/src/components/ProductOptionSubOption/index.tsx +120 -79
  188. package/themes/original/src/components/ProductOptionSubOption/styles.tsx +10 -9
  189. package/themes/original/src/components/ProfessionalProfile/styles.tsx +3 -3
  190. package/themes/original/src/components/Promotions/index.tsx +13 -11
  191. package/themes/original/src/components/Promotions/styles.tsx +0 -2
  192. package/themes/original/src/components/ReviewDriver/index.tsx +5 -0
  193. package/themes/original/src/components/ReviewDriver/styles.tsx +1 -1
  194. package/themes/original/src/components/ReviewOrder/index.tsx +5 -0
  195. package/themes/original/src/components/ReviewOrder/styles.tsx +1 -1
  196. package/themes/original/src/components/ReviewProducts/index.tsx +5 -0
  197. package/themes/original/src/components/ReviewProducts/styles.tsx +1 -1
  198. package/themes/original/src/components/ScheduleAccordion/index.tsx +3 -3
  199. package/themes/original/src/components/ServiceForm/index.tsx +2 -2
  200. package/themes/original/src/components/ServiceForm/styles.tsx +4 -4
  201. package/themes/original/src/components/Sessions/index.tsx +5 -0
  202. package/themes/original/src/components/SignupForm/index.tsx +76 -60
  203. package/themes/original/src/components/SingleOrderCard/index.tsx +6 -5
  204. package/themes/original/src/components/SingleProductCard/index.tsx +5 -4
  205. package/themes/original/src/components/SingleProductCard/styles.tsx +0 -5
  206. package/themes/original/src/components/StripeCardsList/index.tsx +26 -8
  207. package/themes/original/src/components/StripeElementsForm/index.tsx +80 -62
  208. package/themes/original/src/components/StripeElementsForm/naked.tsx +59 -1
  209. package/themes/original/src/components/UpsellingProducts/UpsellingContent.tsx +170 -0
  210. package/themes/original/src/components/UpsellingProducts/UpsellingLayout.tsx +91 -0
  211. package/themes/original/src/components/UpsellingProducts/index.tsx +15 -199
  212. package/themes/original/src/components/UpsellingProducts/styles.tsx +19 -0
  213. package/themes/original/src/components/UserFormDetails/index.tsx +128 -79
  214. package/themes/original/src/components/UserFormDetails/styles.tsx +8 -1
  215. package/themes/original/src/components/UserProfile/index.tsx +5 -4
  216. package/themes/original/src/components/UserProfileForm/index.tsx +35 -36
  217. package/themes/original/src/components/UserVerification/index.tsx +55 -50
  218. package/themes/original/src/components/WalletTransactionItem/index.tsx +2 -2
  219. package/themes/original/src/components/WalletTransactions/styles.tsx +1 -0
  220. package/themes/original/src/components/Wallets/index.tsx +35 -49
  221. package/themes/original/src/components/Wallets/styles.tsx +3 -4
  222. package/themes/original/src/components/WebsocketStatus/index.tsx +172 -0
  223. package/themes/original/src/components/WebsocketStatus/styles.tsx +28 -0
  224. package/themes/original/src/components/shared/HeaderTitle.tsx +1 -1
  225. package/themes/original/src/components/shared/OButton.tsx +5 -5
  226. package/themes/original/src/components/shared/OInput.tsx +7 -4
  227. package/themes/original/src/components/shared/OModal.tsx +12 -14
  228. package/themes/original/src/layouts/Container.tsx +5 -3
  229. package/themes/original/src/types/index.tsx +13 -2
  230. package/themes/original/src/utils/index.tsx +124 -22
  231. package/src/navigators/BottomNavigator.tsx +0 -117
  232. package/src/navigators/CheckoutNavigator.tsx +0 -66
  233. package/src/navigators/HomeNavigator.tsx +0 -202
  234. package/src/navigators/NavigationRef.tsx +0 -7
  235. package/src/navigators/RootNavigator.tsx +0 -269
  236. package/src/pages/Account.tsx +0 -34
  237. package/src/pages/AddressForm.tsx +0 -62
  238. package/src/pages/AddressList.tsx +0 -24
  239. package/src/pages/BusinessProductsList.tsx +0 -81
  240. package/src/pages/BusinessesListing.tsx +0 -43
  241. package/src/pages/CartList.tsx +0 -49
  242. package/src/pages/Checkout.tsx +0 -101
  243. package/src/pages/ForgotPassword.tsx +0 -24
  244. package/src/pages/Help.tsx +0 -23
  245. package/src/pages/HelpAccountAndPayment.tsx +0 -23
  246. package/src/pages/HelpGuide.tsx +0 -23
  247. package/src/pages/HelpOrder.tsx +0 -23
  248. package/src/pages/Home.tsx +0 -36
  249. package/src/pages/IntroductoryTutorial.tsx +0 -170
  250. package/src/pages/Login.tsx +0 -47
  251. package/src/pages/MomentOption.tsx +0 -30
  252. package/src/pages/MultiCheckout.tsx +0 -31
  253. package/src/pages/MultiOrdersDetails.tsx +0 -27
  254. package/src/pages/MyOrders.tsx +0 -40
  255. package/src/pages/NetworkError.tsx +0 -24
  256. package/src/pages/NotFound.tsx +0 -22
  257. package/src/pages/OrderDetails.tsx +0 -25
  258. package/src/pages/ProductDetails.tsx +0 -55
  259. package/src/pages/Profile.tsx +0 -36
  260. package/src/pages/ReviewDriver.tsx +0 -30
  261. package/src/pages/ReviewOrder.tsx +0 -32
  262. package/src/pages/ReviewProducts.tsx +0 -30
  263. package/src/pages/Sessions.tsx +0 -22
  264. package/src/pages/Signup.tsx +0 -53
  265. package/src/pages/SpinnerLoader.tsx +0 -10
  266. package/src/pages/Splash.tsx +0 -21
@@ -4,7 +4,6 @@ import FontAwesome from 'react-native-vector-icons/FontAwesome';
4
4
  import { CODES } from 'ordering-components/native'
5
5
  import { ORDER_TYPES } from '../config/constants';
6
6
  import { useTheme } from 'styled-components/native';
7
- import ReactNativeHapticFeedback from "react-native-haptic-feedback";
8
7
 
9
8
  const [languageState, t] = useLanguage();
10
9
  const theme = useTheme()
@@ -259,7 +258,7 @@ export const sortInputFields = ({ fields, values }: any) => {
259
258
 
260
259
  fieldsBase.forEach((f: any) => {
261
260
  fieldsArray && fieldsArray.forEach((field: any) => {
262
- if (f === field.code) {
261
+ if (f === (field.validation_field?.code || field?.code)) {
263
262
  fieldsSorted.push(field)
264
263
  }
265
264
  })
@@ -384,7 +383,7 @@ export const getOrderStatus = (s: string) => {
384
383
  key: 0,
385
384
  value: t('PENDING', 'Pending'),
386
385
  slug: 'PENDING',
387
- percentage: 0.25,
386
+ percentage: 0.1,
388
387
  image: theme.images.order.status0,
389
388
  },
390
389
  {
@@ -412,7 +411,7 @@ export const getOrderStatus = (s: string) => {
412
411
  key: 4,
413
412
  value: t('PREPARATION_COMPLETED', 'Preparation Completed'),
414
413
  slug: 'PREPARATION_COMPLETED',
415
- percentage: 0.7,
414
+ percentage: 0.2,
416
415
  image: theme.images.order.status4,
417
416
  },
418
417
  {
@@ -433,21 +432,21 @@ export const getOrderStatus = (s: string) => {
433
432
  key: 7,
434
433
  value: t('ACCEPTED_BY_BUSINESS', 'Accepted by business'),
435
434
  slug: 'ACCEPTED_BY_BUSINESS',
436
- percentage: 0.35,
435
+ percentage: 0.15,
437
436
  image: theme.images.order.status7,
438
437
  },
439
438
  {
440
439
  key: 8,
441
440
  value: t('ACCEPTED_BY_DRIVER', 'Accepted by driver'),
442
441
  slug: 'ACCEPTED_BY_DRIVER',
443
- percentage: 0.45,
442
+ percentage: 0.4,
444
443
  image: theme.images.order.status8,
445
444
  },
446
445
  {
447
446
  key: 9,
448
447
  value: t('PICK_UP_COMPLETED_BY_DRIVER', 'Pick up completed by driver'),
449
448
  slug: 'PICK_UP_COMPLETED_BY_DRIVER',
450
- percentage: 0.8,
449
+ percentage: 0.7,
451
450
  image: theme.images.order.status9,
452
451
  },
453
452
  {
@@ -485,7 +484,7 @@ export const getOrderStatus = (s: string) => {
485
484
  key: 14,
486
485
  value: t('ORDER_NOT_READY', 'Order not ready'),
487
486
  slug: 'ORDER_NOT_READY',
488
- percentage: 0,
487
+ percentage: 0.15,
489
488
  image: theme.images.order.status13,
490
489
  },
491
490
  {
@@ -522,7 +521,7 @@ export const getOrderStatus = (s: string) => {
522
521
  'Driver almost arrived to business',
523
522
  ),
524
523
  slug: 'DRIVER_ALMOST_ARRIVED_TO_BUSINESS',
525
- percentage: 0.15,
524
+ percentage: 0.5,
526
525
  image: theme.images.order.status3,
527
526
  },
528
527
  {
@@ -552,21 +551,21 @@ export const getOrderStatus = (s: string) => {
552
551
  'Customer arrived to business',
553
552
  ),
554
553
  slug: 'ORDER_CUSTOMER_ARRIVED_BUSINESS',
555
- percentage: 0.95,
554
+ percentage: 0.9,
556
555
  image: theme.images.order.status7,
557
556
  },
558
557
  {
559
558
  key: 22,
560
559
  value: t('ORDER_LOOKING_FOR_DRIVER', 'Looking for driver'),
561
560
  slug: 'ORDER_LOOKING_FOR_DRIVER',
562
- percentage: 0.35,
561
+ percentage: 0.3,
563
562
  image: theme.images.order.status8
564
563
  },
565
564
  {
566
565
  key: 23,
567
566
  value: t('ORDER_DRIVER_ON_WAY', 'Driver on way'),
568
567
  slug: 'ORDER_DRIVER_ON_WAY',
569
- percentage: 0.45,
568
+ percentage: 0.8,
570
569
  image: theme.images.order.status8
571
570
  }
572
571
  ];
@@ -576,6 +575,119 @@ export const getOrderStatus = (s: string) => {
576
575
  return objectStatus && objectStatus;
577
576
  }
578
577
 
578
+ export const getOrderStatuPickUp = (s: any) => {
579
+ const status = parseInt(s);
580
+ const orderStatus = [
581
+ {
582
+ key: 0,
583
+ value: t('PENDING', 'Pending'),
584
+ slug: 'PENDING',
585
+ percentage: 0.1,
586
+ image: theme.images.order.status0,
587
+ },
588
+ {
589
+ key: 1,
590
+ value: t('COMPLETED', 'Completed'),
591
+ slug: 'COMPLETED',
592
+ percentage: 1,
593
+ image: theme.images.order.status1,
594
+ },
595
+ {
596
+ key: 2,
597
+ value: t('REJECTED', 'Rejected'),
598
+ slug: 'REJECTED',
599
+ percentage: 0,
600
+ image: theme.images.order.status2,
601
+ },
602
+ {
603
+ key: 4,
604
+ value: t('PREPARATION_COMPLETED', 'Preparation Completed'),
605
+ slug: 'PREPARATION_COMPLETED',
606
+ percentage: 0.5,
607
+ image: theme.images.order.status4,
608
+ },
609
+ {
610
+ key: 5,
611
+ value: t('REJECTED_BY_BUSINESS', 'Rejected by business'),
612
+ slug: 'REJECTED_BY_BUSINESS',
613
+ percentage: 0,
614
+ image: theme.images.order.status5,
615
+ },
616
+ {
617
+ key: 7,
618
+ value: t('ACCEPTED_BY_BUSINESS', 'Accepted by business'),
619
+ slug: 'ACCEPTED_BY_BUSINESS',
620
+ percentage: 0.3,
621
+ image: theme.images.order.status7,
622
+ },
623
+ {
624
+ key: 13,
625
+ value: t('PREORDER', 'PreOrder'),
626
+ slug: 'PREORDER',
627
+ percentage: 0,
628
+ image: theme.images.order.status13,
629
+ },
630
+ {
631
+ key: 14,
632
+ value: t('ORDER_NOT_READY', 'Order not ready'),
633
+ slug: 'ORDER_NOT_READY',
634
+ percentage: 0.3,
635
+ image: theme.images.order.status13,
636
+ },
637
+ {
638
+ key: 15,
639
+ value: t(
640
+ 'ORDER_PICKEDUP_COMPLETED_BY_CUSTOMER',
641
+ 'Order picked up completed by customer',
642
+ ),
643
+ slug: 'ORDER_PICKEDUP_COMPLETED_BY_CUSTOMER',
644
+ percentage: 1,
645
+ image: theme.images.order.status1,
646
+ },
647
+ {
648
+ key: 16,
649
+ value: t('CANCELLED_BY_CUSTOMER', 'Cancelled by customer'),
650
+ slug: 'CANCELLED_BY_CUSTOMER',
651
+ percentage: 0,
652
+ image: theme.images.order.status2,
653
+ },
654
+ {
655
+ key: 17,
656
+ value: t(
657
+ 'ORDER_NOT_PICKEDUP_BY_CUSTOMER',
658
+ 'Order not picked up by customer',
659
+ ),
660
+ slug: 'ORDER_NOT_PICKEDUP_BY_CUSTOMER',
661
+ percentage: 0,
662
+ image: theme.images.order.status2,
663
+ },
664
+ {
665
+ key: 20,
666
+ value: t(
667
+ 'ORDER_CUSTOMER_ALMOST_ARRIVED_BUSINESS',
668
+ 'Customer almost arrived to business',
669
+ ),
670
+ slug: 'ORDER_CUSTOMER_ALMOST_ARRIVED_BUSINESS',
671
+ percentage: 0.7,
672
+ image: theme.images.order.status7,
673
+ },
674
+ {
675
+ key: 21,
676
+ value: t(
677
+ 'ORDER_CUSTOMER_ARRIVED_BUSINESS',
678
+ 'Customer arrived to business',
679
+ ),
680
+ slug: 'ORDER_CUSTOMER_ARRIVED_BUSINESS',
681
+ percentage: 0.9,
682
+ image: theme.images.order.status7,
683
+ }
684
+ ];
685
+
686
+ const objectStatus = orderStatus.find((o) => o.key === status);
687
+
688
+ return objectStatus && objectStatus;
689
+ }
690
+
579
691
  /**
580
692
  * Function to get brightness of color.
581
693
  */
@@ -613,13 +725,3 @@ export const lightenDarkenColor = (color: any) => {
613
725
  return false
614
726
  }
615
727
  }
616
-
617
- export const vibrateApp = (impact ?: string) => {
618
- const options = {
619
- enableVibrateFallback: true,
620
- ignoreAndroidSystemSettings: false
621
- };
622
-
623
- ReactNativeHapticFeedback.trigger(impact || "impactLight", options);
624
-
625
- }
@@ -1,117 +0,0 @@
1
- import React from 'react'
2
- import { View, Platform, PlatformIOSStatic } from 'react-native'
3
- import { useOrder } from 'ordering-components/native'
4
- import { createMaterialBottomTabNavigator } from '@react-navigation/material-bottom-tabs'
5
- import MaterialCommunityIcon from 'react-native-vector-icons/MaterialCommunityIcons'
6
- import MaterialIcon from 'react-native-vector-icons/MaterialIcons'
7
- import styled from 'styled-components/native'
8
-
9
- import { OText } from '../components/shared'
10
- import BusinessList from '../pages/BusinessesListing'
11
- import MyOrders from '../pages/MyOrders'
12
- import CartList from '../pages/CartList'
13
- import Profile from '../pages/Profile'
14
- import { useTheme } from 'styled-components/native'
15
-
16
- const CartsLenght = styled.View`
17
- width: 25px;
18
- height: 25px;
19
- background-color: ${(props: any) => props.theme.colors.primary};
20
- display: flex;
21
- justify-content: center;
22
- align-items: center;
23
- position: absolute;
24
- right: 0;
25
- `
26
-
27
- const Tab = createMaterialBottomTabNavigator();
28
-
29
- const BottomNavigator = () => {
30
- const theme = useTheme()
31
- const [{ carts }] = useOrder()
32
- const cartsList = (carts && Object.values(carts).filter((cart: any) => cart.products.length > 0)) || []
33
- const isIos = Platform.OS === 'ios'
34
- const platformIOS = Platform as PlatformIOSStatic
35
- const androidStyles = isIos
36
- ? platformIOS.isPad
37
- ? { paddingBottom: 30 }
38
- : {}
39
- : {height: 40, position: 'relative', bottom: 15}
40
- return (
41
- <Tab.Navigator
42
- initialRouteName="BusinessList"
43
- activeColor={theme.colors.primary}
44
- barStyle={{ backgroundColor: theme.colors.white, ...androidStyles }}
45
- labeled={false}
46
- inactiveColor={theme.colors.disabled}
47
- >
48
- <Tab.Screen
49
- name="BusinessList"
50
- component={BusinessList}
51
- options={{
52
- tabBarIcon:
53
- ({ color }: any) => (
54
- <View style={{ width: 50, height: 50, justifyContent: !isIos ? 'flex-start' : 'space-evenly', position: 'relative', bottom: !isIos ? 10 : 0 }}>
55
- <MaterialCommunityIcon name='home' size={46} color={color} />
56
- </View>
57
- )
58
- }}
59
- />
60
- <Tab.Screen
61
- name="MyOrders"
62
- component={MyOrders}
63
- options={
64
- {
65
- tabBarIcon:
66
- ({ color }: any) => (
67
- <View style={{ width: 50, height: 50, justifyContent: !isIos ? 'flex-start' : 'space-evenly', position: 'relative', bottom: !isIos ? 10 : 0 }}>
68
- <MaterialIcon name='format-list-bulleted' size={46} color={color} />
69
- </View>
70
- ),
71
- }}
72
- />
73
- <Tab.Screen
74
- name="Cart"
75
- component={CartList}
76
- options={{
77
- tabBarIcon:
78
- ({ color }: any) => (
79
- <View style={{
80
- width: 50,
81
- height: 50,
82
- justifyContent: !isIos ? 'flex-start' : 'space-evenly',
83
- position: 'relative',
84
- bottom: !isIos ? 10 : 0
85
- }}
86
- >
87
- <MaterialIcon name='shopping-basket' size={46} color={color} />
88
- {cartsList.length > 0 && (
89
- <CartsLenght style={{ borderRadius: 100 / 2 }}>
90
- <OText
91
- color={theme.colors.white}
92
- >
93
- {cartsList.length}
94
- </OText>
95
- </CartsLenght>
96
- )}
97
- </View>
98
- )
99
- }}
100
- />
101
- <Tab.Screen
102
- name="Profile"
103
- component={Profile}
104
- options={{
105
- tabBarIcon:
106
- ({ color }: any) => (
107
- <View style={{ width: 50, height: 50, justifyContent: !isIos ? 'flex-start' : 'space-evenly', position: 'relative', bottom: !isIos ? 10 : 0 }}>
108
- <MaterialIcon name='person' size={46} color={color} />
109
- </View>
110
- )
111
- }}
112
- />
113
- </Tab.Navigator>
114
- );
115
- }
116
-
117
- export default BottomNavigator
@@ -1,66 +0,0 @@
1
- import React from 'react';
2
- import { createStackNavigator } from "@react-navigation/stack";
3
-
4
- import AddressList from '../pages/AddressList'
5
- import AddressForm from '../pages/AddressForm'
6
- import CartList from '../pages/CartList'
7
- import CheckoutPage from '../pages/Checkout';
8
- import BusinessProductsList from '../pages/BusinessProductsList';
9
- import MultiCheckout from '../pages/MultiCheckout';
10
-
11
- const Stack = createStackNavigator();
12
-
13
- const CheckoutNavigator = (props: any) => {
14
- const {
15
- navigation,
16
- route
17
- } = props;
18
-
19
- const cartUuid = route?.params?.cartUuid
20
-
21
- const checkoutProps = {
22
- navigation,
23
- route,
24
- cartUuid: route?.params?.cartUuid
25
- }
26
-
27
- return (
28
- <Stack.Navigator>
29
- {!cartUuid && (
30
- <Stack.Screen
31
- name="Cart"
32
- component={CartList}
33
- options={{ headerShown: false }}
34
- />
35
- )}
36
- <Stack.Screen
37
- name="CheckoutPage"
38
- children={() => <CheckoutPage {...checkoutProps} />}
39
- options={{ headerShown: false }}
40
- />
41
- <Stack.Screen
42
- name="Business"
43
- component={BusinessProductsList}
44
- options={{ headerShown: false }}
45
- />
46
- <Stack.Screen
47
- name="AddressList"
48
- component={AddressList}
49
- options={{ headerShown: false }}
50
- initialParams={{isFromCheckout: true}}
51
- />
52
- <Stack.Screen
53
- name="AddressForm"
54
- component={AddressForm}
55
- options={{ headerShown: false }}
56
- />
57
- <Stack.Screen
58
- name="MultiCheckout"
59
- children={() => <MultiCheckout {...checkoutProps} />}
60
- options={{ headerShown: false }}
61
- />
62
- </Stack.Navigator>
63
- );
64
- }
65
-
66
- export default CheckoutNavigator;
@@ -1,202 +0,0 @@
1
- import * as React from 'react';
2
- import { AppState } from 'react-native'
3
- import { createStackNavigator } from "@react-navigation/stack";
4
- import { useSession, useOrder, useWebsocket } from 'ordering-components/native';
5
- import BottomNavigator from '../navigators/BottomNavigator';
6
- import RootNavigator from '../navigators/RootNavigator';
7
- import CheckoutNavigator from '../navigators/CheckoutNavigator';
8
- import BackgroundTimer from 'react-native-background-timer';
9
-
10
- import AddressList from '../pages/AddressList';
11
- import AddressForm from '../pages/AddressForm';
12
- import OrderDetails from '../pages/OrderDetails';
13
- import BusinessProductsList from '../pages/BusinessProductsList';
14
- import ReviewOrder from '../pages/ReviewOrder'
15
- import ReviewProducts from '../pages/ReviewProducts';
16
- import ReviewDriver from '../pages/ReviewDriver'
17
- import MomentOption from '../pages/MomentOption'
18
- import Account from '../pages/Account'
19
- import Help from '../pages/Help'
20
- import HelpOrder from '../pages/HelpOrder'
21
- import HelpGuide from '../pages/HelpGuide'
22
- import HelpAccountAndPayment from '../pages/HelpAccountAndPayment'
23
- import Sessions from '../pages/Sessions';
24
- import Splash from '../pages/Splash';
25
- import ProductDetails from '../pages/ProductDetails';
26
- import MultiOrdersDetails from '../pages/MultiOrdersDetails';
27
- const Stack = createStackNavigator();
28
-
29
- const HomeNavigator = (e : any) => {
30
- const [orderState] = useOrder();
31
- const [{ auth, user }] = useSession();
32
- const socket = useWebsocket();
33
-
34
- const appState = React.useRef(AppState.currentState);
35
- let interval: any
36
-
37
- const _handleAppStateChange = (nextAppState: any) => {
38
- if (appState.current.match(/inactive|background/) && nextAppState === 'active') {
39
- BackgroundTimer.clearInterval(interval)
40
- }else{
41
- interval = BackgroundTimer.setInterval(()=>{
42
- const ordersRoom = user?.level === 0 ? 'orders' : `orders_${user?.id}`
43
- socket.join(ordersRoom)
44
- }, 5000)
45
- appState.current = nextAppState;
46
- }
47
- }
48
-
49
- React.useEffect (() => {
50
- AppState.addEventListener('change', _handleAppStateChange);
51
- return () => {
52
- AppState.removeEventListener('change', _handleAppStateChange);
53
- };
54
- },[])
55
-
56
- return (
57
- <Stack.Navigator>
58
- {!orderState.loading || (orderState?.options?.user_id && orderState.loading) || orderState?.options?.address?.location ? (
59
- <>
60
- {auth ? (
61
- <>
62
- {Object.keys(orderState?.carts).length === 0 && !orderState?.options?.address?.location && !orderState.loading ? (
63
- <>
64
- <Stack.Screen
65
- name="AddressListInitial"
66
- component={AddressList}
67
- options={{ headerShown: false }}
68
- initialParams={{ afterSignup: true }}
69
- />
70
- <Stack.Screen
71
- name="AddressFormInitial"
72
- component={AddressForm}
73
- options={{ headerShown: false }}
74
- initialParams={{ afterSignup: true }}
75
- />
76
- </>
77
- ) : (
78
- <>
79
- {!!Object.keys(e?.route?.params?.productLogin || {})?.length && (
80
- <Stack.Screen
81
- name="BusinessAfterLogin"
82
- component={BusinessProductsList}
83
- options={{headerShown: false}}
84
- initialParams={{productLogin: e?.route?.params?.productLogin}}
85
- />
86
- )}
87
- <Stack.Screen
88
- name='BottomTab'
89
- component={BottomNavigator}
90
- options={{ headerShown: false }}
91
- />
92
- <Stack.Screen
93
- name="CheckoutNavigator"
94
- component={CheckoutNavigator}
95
- options={{ headerShown: false }}
96
- />
97
- <Stack.Screen
98
- name="OrderDetails"
99
- component={OrderDetails}
100
- options={{ headerShown: false }}
101
- />
102
- <Stack.Screen
103
- name="Business"
104
- component={BusinessProductsList}
105
- options={{ headerShown: false }}
106
- />
107
- <Stack.Screen
108
- name="ProductDetails"
109
- component={ProductDetails}
110
- options={{ headerShown: false }}
111
- />
112
- <Stack.Screen
113
- name="ReviewOrder"
114
- component={ReviewOrder}
115
- options={{ headerShown: false }}
116
- />
117
- <Stack.Screen
118
- name="ReviewProducts"
119
- component={ReviewProducts}
120
- options={{ headerShown: false }}
121
- />
122
- <Stack.Screen
123
- name="ReviewDriver"
124
- component={ReviewDriver}
125
- options={{ headerShown: false }}
126
- />
127
- <Stack.Screen
128
- name='MomentOption'
129
- component={MomentOption}
130
- options={{ headerShown: false }}
131
- />
132
- <Stack.Screen
133
- name="AddressList"
134
- component={AddressList}
135
- options={{ headerShown: false }}
136
- initialParams={{ afterSignup: false }}
137
- />
138
- <Stack.Screen
139
- name="AddressForm"
140
- component={AddressForm}
141
- options={{ headerShown: false }}
142
- initialParams={{ afterSignup: false }}
143
- />
144
- <Stack.Screen
145
- name="Account"
146
- component={Account}
147
- options={{ headerShown: false }}
148
- />
149
- <Stack.Screen
150
- name="Help"
151
- component={Help}
152
- options={{ headerShown: false }}
153
- />
154
- <Stack.Screen
155
- name="HelpOrder"
156
- component={HelpOrder}
157
- options={{ headerShown: false }}
158
- />
159
- <Stack.Screen
160
- name="HelpGuide"
161
- component={HelpGuide}
162
- options={{ headerShown: false }}
163
- />
164
- <Stack.Screen
165
- name="HelpAccountAndPayment"
166
- component={HelpAccountAndPayment}
167
- options={{ headerShown: false }}
168
- />
169
- <Stack.Screen
170
- name="Sessions"
171
- component={Sessions}
172
- options={{ headerShown: false }}
173
- />
174
- <Stack.Screen
175
- name="MultiOrdersDetails"
176
- component={MultiOrdersDetails}
177
- options={{ headerShown: false }}
178
- />
179
- </>
180
- )}
181
- </>
182
- )
183
- : (
184
- <Stack.Screen
185
- name='root'
186
- component={RootNavigator}
187
- options={{ headerShown: false }}
188
- />
189
- )}
190
- </>
191
- ) : (
192
- <Stack.Screen
193
- name="Splash"
194
- component={Splash}
195
- options={{ headerShown: false }}
196
- />
197
- )}
198
- </Stack.Navigator>
199
- );
200
- }
201
-
202
- export default HomeNavigator;
@@ -1,7 +0,0 @@
1
- import * as React from 'react';
2
-
3
- export const navigationRef: any = React.createRef();
4
-
5
- export const navigate = (name: string, params: any) => {
6
- navigationRef.current?.navigate(name, params);
7
- }