ordering-ui-react-native 0.21.13 → 0.21.14-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 (241) hide show
  1. package/package.json +7 -6
  2. package/src/DeliveryApp.tsx +43 -1
  3. package/src/components/BusinessInformation/index.tsx +10 -9
  4. package/src/components/BusinessesListing/index.tsx +1 -1
  5. package/src/components/PaymentOptionsWebView/index.tsx +1 -0
  6. package/src/components/StripeMethodForm/index.tsx +4 -4
  7. package/src/components/VerifyPhone/styles.tsx +1 -2
  8. package/src/types/index.tsx +2 -1
  9. package/src/utils/index.tsx +2 -2
  10. package/themes/business/index.tsx +4 -0
  11. package/themes/business/src/components/AcceptOrRejectOrder/index.tsx +9 -2
  12. package/themes/business/src/components/BusinessController/index.tsx +19 -17
  13. package/themes/business/src/components/BusinessProductList/AccordionDropdown.tsx +63 -0
  14. package/themes/business/src/components/BusinessProductList/IterateCategories.tsx +108 -0
  15. package/themes/business/src/components/BusinessProductList/ProductList.tsx +196 -0
  16. package/themes/business/src/components/BusinessProductList/index.tsx +196 -0
  17. package/themes/business/src/components/BusinessProductList/styles.tsx +10 -0
  18. package/themes/business/src/components/Chat/index.tsx +41 -13
  19. package/themes/business/src/components/DriverMap/index.tsx +4 -3
  20. package/themes/business/src/components/DriverSchedule/index.tsx +5 -5
  21. package/themes/business/src/components/FloatingButton/index.tsx +34 -31
  22. package/themes/business/src/components/Home/index.tsx +5 -1
  23. package/themes/business/src/components/MapView/index.tsx +11 -7
  24. package/themes/business/src/components/MessagesOption/index.tsx +22 -94
  25. package/themes/business/src/components/NewOrderNotification/index.tsx +163 -113
  26. package/themes/business/src/components/OrderDetails/Business.tsx +50 -2
  27. package/themes/business/src/components/OrderDetails/Delivery.tsx +23 -11
  28. package/themes/business/src/components/OrderDetails/OrderContentComponent.tsx +60 -53
  29. package/themes/business/src/components/OrderDetails/OrderHeaderComponent.tsx +54 -23
  30. package/themes/business/src/components/OrderDetails/usePrinterCommands.tsx +220 -0
  31. package/themes/business/src/components/OrderDetailsLogistic/index.tsx +6 -1
  32. package/themes/business/src/components/OrderSummary/index.tsx +240 -76
  33. package/themes/business/src/components/OrdersListManager/index.tsx +7 -2
  34. package/themes/business/src/components/OrdersListManager/utils.tsx +1 -1
  35. package/themes/business/src/components/OrdersOption/index.tsx +125 -48
  36. package/themes/business/src/components/PreviousMessages/FooterMessageComponent.tsx +103 -0
  37. package/themes/business/src/components/PreviousMessages/index.tsx +97 -55
  38. package/themes/business/src/components/PreviousOrders/OrderItem.tsx +26 -34
  39. package/themes/business/src/components/PreviousOrders/OrderList.tsx +93 -0
  40. package/themes/business/src/components/PreviousOrders/OrdersGroupedItem.tsx +1 -1
  41. package/themes/business/src/components/PreviousOrders/index.tsx +194 -220
  42. package/themes/business/src/components/PreviousOrders/styles.tsx +10 -0
  43. package/themes/business/src/components/PrinterSettings/index.tsx +279 -0
  44. package/themes/business/src/components/PrinterSettings/styles.tsx +17 -0
  45. package/themes/business/src/components/ProductItemAccordion/index.tsx +2 -2
  46. package/themes/business/src/components/ReviewCustomer/index.tsx +2 -0
  47. package/themes/business/src/components/SearchBar/index.tsx +2 -1
  48. package/themes/business/src/components/Sessions/index.tsx +187 -0
  49. package/themes/business/src/components/Sessions/styles.tsx +20 -0
  50. package/themes/business/src/components/StoresList/index.tsx +5 -3
  51. package/themes/business/src/components/UserFormDetails/index.tsx +111 -107
  52. package/themes/business/src/components/UserProfileForm/index.tsx +98 -43
  53. package/themes/business/src/components/WebsocketStatus/index.tsx +171 -0
  54. package/themes/business/src/components/WebsocketStatus/styles.tsx +28 -0
  55. package/themes/business/src/components/shared/OInput.tsx +2 -0
  56. package/themes/business/src/hooks/useLocation.tsx +5 -4
  57. package/themes/business/src/types/index.tsx +21 -1
  58. package/themes/doordash/src/components/BusinessesListing/index.tsx +1 -1
  59. package/themes/doordash/src/components/LoginForm/index.tsx +1 -2
  60. package/themes/instacart/src/components/BusinessesListing/index.tsx +1 -1
  61. package/themes/kiosk/src/components/Checkout/index.tsx +6 -0
  62. package/themes/kiosk/src/components/LoginForm/index.tsx +124 -96
  63. package/themes/kiosk/src/components/NavBar/index.tsx +14 -14
  64. package/themes/kiosk/src/components/OptionCard/index.tsx +1 -1
  65. package/themes/kiosk/src/components/OrderTypeCardSelector/index.tsx +8 -10
  66. package/themes/kiosk/src/components/shared/OButton.tsx +5 -18
  67. package/themes/original/index.tsx +9 -4
  68. package/themes/original/src/components/AddressDetails/index.tsx +20 -10
  69. package/themes/original/src/components/AddressForm/index.tsx +10 -6
  70. package/themes/original/src/components/AddressForm/styles.tsx +1 -1
  71. package/themes/original/src/components/AddressList/index.tsx +4 -7
  72. package/themes/original/src/components/AddressList/styles.tsx +4 -4
  73. package/themes/original/src/components/AnalyticsSegment/index.tsx +6 -6
  74. package/themes/original/src/components/AppleLogin/index.tsx +4 -4
  75. package/themes/original/src/components/BusinessBasicInformation/index.tsx +4 -4
  76. package/themes/original/src/components/BusinessBasicInformation/styles.tsx +1 -1
  77. package/themes/original/src/components/BusinessController/index.tsx +20 -12
  78. package/themes/original/src/components/BusinessController/styles.tsx +8 -7
  79. package/themes/original/src/components/BusinessInformation/styles.tsx +2 -2
  80. package/themes/original/src/components/BusinessItemAccordion/index.tsx +11 -7
  81. package/themes/original/src/components/BusinessListingSearch/BusinessSearchFooter.tsx +317 -0
  82. package/themes/original/src/components/BusinessListingSearch/BusinessSearchHeader.tsx +96 -0
  83. package/themes/original/src/components/BusinessListingSearch/MaxSectionItem/index.tsx +1 -1
  84. package/themes/original/src/components/BusinessListingSearch/index.tsx +56 -361
  85. package/themes/original/src/components/BusinessListingSearch/styles.tsx +1 -1
  86. package/themes/original/src/components/BusinessPreorder/index.tsx +2 -3
  87. package/themes/original/src/components/BusinessProductsCategories/index.tsx +1 -1
  88. package/themes/original/src/components/BusinessProductsList/index.tsx +3 -3
  89. package/themes/original/src/components/BusinessProductsList/styles.tsx +0 -3
  90. package/themes/original/src/components/BusinessProductsListing/index.tsx +51 -20
  91. package/themes/original/src/components/BusinessProductsListing/styles.tsx +3 -4
  92. package/themes/original/src/components/BusinessReviews/index.tsx +1 -1
  93. package/themes/original/src/components/BusinessesListing/Layout/Appointment/index.tsx +1 -1
  94. package/themes/original/src/components/BusinessesListing/Layout/Appointment/styles.tsx +5 -5
  95. package/themes/original/src/components/BusinessesListing/Layout/Original/FlatListBusinessListFooter.tsx +69 -0
  96. package/themes/original/src/components/BusinessesListing/Layout/Original/FlatListBusinessListHeader.tsx +406 -0
  97. package/themes/original/src/components/BusinessesListing/Layout/Original/FlatListBusinessListing.tsx +76 -0
  98. package/themes/original/src/components/BusinessesListing/Layout/Original/index.tsx +24 -404
  99. package/themes/original/src/components/BusinessesListing/Layout/Original/styles.tsx +1 -1
  100. package/themes/original/src/components/BusinessesListing/index.tsx +0 -1
  101. package/themes/original/src/components/Cart/index.tsx +32 -9
  102. package/themes/original/src/components/CartContent/index.tsx +96 -58
  103. package/themes/original/src/components/CartStoresListing/styles.tsx +2 -2
  104. package/themes/original/src/components/Checkout/index.tsx +190 -66
  105. package/themes/original/src/components/Checkout/styles.tsx +17 -0
  106. package/themes/original/src/components/CitiesControl/styles.tsx +1 -1
  107. package/themes/original/src/components/DatePicker/index.tsx +33 -0
  108. package/themes/original/src/components/DatePicker/styles.tsx +20 -0
  109. package/themes/original/src/components/Favorite/index.tsx +4 -9
  110. package/themes/original/src/components/Favorite/styles.tsx +0 -2
  111. package/themes/original/src/components/FloatingButton/styles.tsx +1 -1
  112. package/themes/original/src/components/GPSButton/index.tsx +1 -1
  113. package/themes/original/src/components/GiftCard/GiftCardOrdersList/index.tsx +64 -0
  114. package/themes/original/src/components/GiftCard/GiftCardOrdersList/styles.tsx +8 -0
  115. package/themes/original/src/components/GiftCard/GiftCardUI/index.tsx +8 -3
  116. package/themes/original/src/components/GiftCard/PurchaseGiftCard/index.tsx +36 -3
  117. package/themes/original/src/components/GiftCard/PurchaseGiftCard/styles.tsx +1 -1
  118. package/themes/original/src/components/GiftCard/RedeemGiftCard/index.tsx +67 -4
  119. package/themes/original/src/components/GiftCard/RedeemGiftCard/styles.tsx +1 -1
  120. package/themes/original/src/components/GiftCard/SendGiftCard/index.tsx +2 -2
  121. package/themes/original/src/components/GiftCard/SendGiftCard/styles.tsx +1 -1
  122. package/themes/original/src/components/GiftCard/SingleGiftCard/index.tsx +101 -0
  123. package/themes/original/src/components/GiftCard/SingleGiftCard/styles.tsx +4 -0
  124. package/themes/original/src/components/GiftCard/VerticalGiftCardOrdersLayout/index.tsx +83 -0
  125. package/themes/original/src/components/GiftCard/VerticalGiftCardOrdersLayout/styles.tsx +9 -0
  126. package/themes/original/src/components/GoogleMap/index.tsx +6 -5
  127. package/themes/original/src/components/HighestRatedBusinesses/index.tsx +2 -2
  128. package/themes/original/src/components/HighestRatedBusinesses/styles.tsx +1 -1
  129. package/themes/original/src/components/Home/index.tsx +1 -1
  130. package/themes/original/src/components/LastOrder/index.tsx +2 -1
  131. package/themes/original/src/components/LastOrders/index.tsx +2 -1
  132. package/themes/original/src/components/LoginForm/Otp/index.tsx +48 -39
  133. package/themes/original/src/components/LoginForm/index.tsx +5 -0
  134. package/themes/original/src/components/Messages/index.tsx +9 -4
  135. package/themes/original/src/components/Messages/styles.tsx +1 -1
  136. package/themes/original/src/components/MomentOption/index.tsx +3 -3
  137. package/themes/original/src/components/MultiCart/index.tsx +1 -1
  138. package/themes/original/src/components/MultiCheckout/index.tsx +208 -21
  139. package/themes/original/src/components/MultiCheckout/styles.tsx +17 -0
  140. package/themes/original/src/components/MultiOrdersDetails/index.tsx +20 -15
  141. package/themes/original/src/components/MyOrders/index.tsx +24 -29
  142. package/themes/original/src/components/NavBar/index.tsx +3 -1
  143. package/themes/original/src/components/NetworkError/index.tsx +2 -3
  144. package/themes/original/src/components/NetworkError/styles.tsx +2 -2
  145. package/themes/original/src/components/Notifications/index.tsx +4 -8
  146. package/themes/original/src/components/Notifications/styles.tsx +0 -1
  147. package/themes/original/src/components/OrderDetails/OrderHistory.tsx +7 -3
  148. package/themes/original/src/components/OrderDetails/index.tsx +716 -667
  149. package/themes/original/src/components/OrderDetails/styles.tsx +24 -8
  150. package/themes/original/src/components/OrderProgress/index.tsx +28 -6
  151. package/themes/original/src/components/OrderProgress/styles.tsx +1 -1
  152. package/themes/original/src/components/OrderSummary/index.tsx +3 -1
  153. package/themes/original/src/components/OrderTypeSelector/index.tsx +5 -6
  154. package/themes/original/src/components/OrdersOption/PreviousBusinessOrdered/styles.tsx +1 -1
  155. package/themes/original/src/components/OrdersOption/PreviousProductsOrdered/styles.tsx +1 -1
  156. package/themes/original/src/components/OrdersOption/index.tsx +3 -5
  157. package/themes/original/src/components/OrdersOption/styles.tsx +1 -1
  158. package/themes/original/src/components/PageBanner/index.tsx +3 -0
  159. package/themes/original/src/components/PaymentOptionCard/index.tsx +4 -2
  160. package/themes/original/src/components/PaymentOptionStripe/styles.tsx +3 -0
  161. package/themes/original/src/components/PaymentOptionWallet/index.tsx +56 -56
  162. package/themes/original/src/components/PaymentOptions/index.tsx +72 -6
  163. package/themes/original/src/components/PhoneInputNumber/index.tsx +15 -1
  164. package/themes/original/src/components/ProductForm/ActionButton.tsx +120 -0
  165. package/themes/original/src/components/ProductForm/ExtraOptions.tsx +56 -0
  166. package/themes/original/src/components/ProductForm/index.tsx +74 -165
  167. package/themes/original/src/components/ProductItemAccordion/index.tsx +19 -10
  168. package/themes/original/src/components/ProductItemAccordion/styles.tsx +3 -1
  169. package/themes/original/src/components/ProductOptionSubOption/index.tsx +123 -82
  170. package/themes/original/src/components/ProductOptionSubOption/styles.tsx +6 -1
  171. package/themes/original/src/components/ProfessionalProfile/styles.tsx +3 -3
  172. package/themes/original/src/components/Promotions/index.tsx +4 -4
  173. package/themes/original/src/components/Promotions/styles.tsx +0 -2
  174. package/themes/original/src/components/ReviewDriver/styles.tsx +1 -1
  175. package/themes/original/src/components/ReviewOrder/styles.tsx +1 -1
  176. package/themes/original/src/components/ReviewProducts/styles.tsx +1 -1
  177. package/themes/original/src/components/ServiceForm/index.tsx +2 -2
  178. package/themes/original/src/components/ServiceForm/styles.tsx +4 -4
  179. package/themes/original/src/components/SingleOrderCard/index.tsx +5 -4
  180. package/themes/original/src/components/SingleProductCard/index.tsx +2 -2
  181. package/themes/original/src/components/SingleProductCard/styles.tsx +0 -3
  182. package/themes/original/src/components/StripeCardsList/index.tsx +17 -36
  183. package/themes/original/src/components/StripeElementsForm/index.tsx +9 -4
  184. package/themes/original/src/components/UpsellingProducts/UpsellingContent.tsx +170 -0
  185. package/themes/original/src/components/UpsellingProducts/UpsellingLayout.tsx +86 -0
  186. package/themes/original/src/components/UpsellingProducts/index.tsx +15 -199
  187. package/themes/original/src/components/UpsellingProducts/styles.tsx +19 -0
  188. package/themes/original/src/components/UserFormDetails/index.tsx +54 -8
  189. package/themes/original/src/components/UserFormDetails/styles.tsx +7 -0
  190. package/themes/original/src/components/UserProfile/index.tsx +3 -2
  191. package/themes/original/src/components/UserProfileForm/index.tsx +30 -36
  192. package/themes/original/src/components/UserVerification/index.tsx +3 -1
  193. package/themes/original/src/components/WalletTransactions/styles.tsx +1 -0
  194. package/themes/original/src/components/Wallets/index.tsx +8 -9
  195. package/themes/original/src/components/Wallets/styles.tsx +1 -1
  196. package/themes/original/src/components/WebsocketStatus/index.tsx +172 -0
  197. package/themes/original/src/components/WebsocketStatus/styles.tsx +28 -0
  198. package/themes/original/src/components/shared/HeaderTitle.tsx +1 -1
  199. package/themes/original/src/components/shared/OButton.tsx +5 -5
  200. package/themes/original/src/components/shared/OInput.tsx +1 -4
  201. package/themes/original/src/components/shared/OModal.tsx +12 -14
  202. package/themes/original/src/layouts/Container.tsx +5 -3
  203. package/themes/original/src/types/index.tsx +6 -1
  204. package/themes/original/src/utils/index.tsx +124 -0
  205. package/themes/uber-eats/src/components/BusinessesListing/index.tsx +1 -1
  206. package/src/navigators/BottomNavigator.tsx +0 -117
  207. package/src/navigators/CheckoutNavigator.tsx +0 -66
  208. package/src/navigators/HomeNavigator.tsx +0 -202
  209. package/src/navigators/NavigationRef.tsx +0 -7
  210. package/src/navigators/RootNavigator.tsx +0 -269
  211. package/src/pages/Account.tsx +0 -34
  212. package/src/pages/AddressForm.tsx +0 -62
  213. package/src/pages/AddressList.tsx +0 -24
  214. package/src/pages/BusinessProductsList.tsx +0 -81
  215. package/src/pages/BusinessesListing.tsx +0 -43
  216. package/src/pages/CartList.tsx +0 -49
  217. package/src/pages/Checkout.tsx +0 -101
  218. package/src/pages/ForgotPassword.tsx +0 -24
  219. package/src/pages/Help.tsx +0 -23
  220. package/src/pages/HelpAccountAndPayment.tsx +0 -23
  221. package/src/pages/HelpGuide.tsx +0 -23
  222. package/src/pages/HelpOrder.tsx +0 -23
  223. package/src/pages/Home.tsx +0 -36
  224. package/src/pages/IntroductoryTutorial.tsx +0 -170
  225. package/src/pages/Login.tsx +0 -47
  226. package/src/pages/MomentOption.tsx +0 -30
  227. package/src/pages/MultiCheckout.tsx +0 -31
  228. package/src/pages/MultiOrdersDetails.tsx +0 -27
  229. package/src/pages/MyOrders.tsx +0 -40
  230. package/src/pages/NetworkError.tsx +0 -24
  231. package/src/pages/NotFound.tsx +0 -22
  232. package/src/pages/OrderDetails.tsx +0 -25
  233. package/src/pages/ProductDetails.tsx +0 -55
  234. package/src/pages/Profile.tsx +0 -36
  235. package/src/pages/ReviewDriver.tsx +0 -30
  236. package/src/pages/ReviewOrder.tsx +0 -32
  237. package/src/pages/ReviewProducts.tsx +0 -30
  238. package/src/pages/Sessions.tsx +0 -22
  239. package/src/pages/Signup.tsx +0 -53
  240. package/src/pages/SpinnerLoader.tsx +0 -10
  241. package/src/pages/Splash.tsx +0 -21
@@ -1,13 +1,13 @@
1
1
  import React, { useState, useEffect } from 'react';
2
2
  import { View } from 'react-native';
3
3
  import { useTheme } from 'styled-components/native';
4
- import { useLanguage } from 'ordering-components/native';
4
+ import { useLanguage, useConfig } from 'ordering-components/native';
5
5
 
6
- import {AcceptOrRejectOrder as AcceptOrRejectOrderStyle } from './styles';
6
+ import { AcceptOrRejectOrder as AcceptOrRejectOrderStyle } from './styles';
7
7
 
8
8
  import { OButton, OModal } from '../shared';
9
- import { OrderItem } from './OrderItem'
10
9
  import { OrdersGroupedItem } from './OrdersGroupedItem'
10
+ import { OrdersList } from './OrderList';
11
11
  import { AcceptOrRejectOrder } from '../AcceptOrRejectOrder';
12
12
  import { ReviewCustomer } from '../ReviewCustomer';
13
13
  import { GoogleMap } from '../GoogleMap';
@@ -24,14 +24,17 @@ export const PreviousOrders = (props: any) => {
24
24
  currentTabSelected,
25
25
  currentOrdenSelected,
26
26
  handleChangeOrderStatus,
27
- handleSendCustomerReview
27
+ handleSendCustomerReview,
28
+ isBusinessApp
28
29
  } = props;
29
30
 
30
31
  let hash: any = {};
31
32
  const [, t] = useLanguage();
32
33
  const theme = useTheme();
34
+ const [{ configs }] = useConfig();
33
35
 
34
- const [, setCurrentTime] = useState()
36
+
37
+ // const [, setCurrentTime] = useState()
35
38
  const [openModal, setOpenModal] = useState(false)
36
39
  const [openReviewModal, setOpenReviewModal] = useState({ order: null, ids: [], customerId: null })
37
40
  const [openMapViewModal, setOpenMapViewModal] = useState<any>({ open: false, customerLocation: null, locations: [] })
@@ -41,6 +44,9 @@ export const PreviousOrders = (props: any) => {
41
44
  const viewMapStatus = [9, 18, 19, 23]
42
45
  const deliveryPickupBtn = props.appTitle?.text?.includes('Delivery') && [3, 8, 18]
43
46
  const deliveryStatusCompleteBtn = props.appTitle?.text?.includes('Delivery') && [9, 19, 23]
47
+ const isHideRejectButtons = configs?.reject_orders_enabled && configs?.reject_orders_enabled?.value !== '1' && !isBusinessApp
48
+ const isEnabledOrderNotReady = configs?.order_not_ready_enabled?.value === '1'
49
+ const isEnabledFailedPickupDriver = configs?.failed_pickup_by_driver_enabled?.value === '1'
44
50
 
45
51
  const handlePressOrder = (order: any) => {
46
52
  if (order?.locked && isLogisticOrder) return
@@ -48,9 +54,9 @@ export const PreviousOrders = (props: any) => {
48
54
  if (props.handleClickEvent) {
49
55
  props.handleClickEvent({ ...order, isLogistic: isLogisticOrder })
50
56
  } else {
51
- if (isLogisticOrder){
57
+ if (isLogisticOrder) {
52
58
  onNavigationRedirect &&
53
- onNavigationRedirect('OrderDetailsLogistic', { order: { ...order, isLogistic: isLogisticOrder }, handleClickLogisticOrder });
59
+ onNavigationRedirect('OrderDetailsLogistic', { order: { ...order, isLogistic: isLogisticOrder }, handleClickLogisticOrder });
54
60
  } else {
55
61
  onNavigationRedirect &&
56
62
  onNavigationRedirect('OrderDetails', { order });
@@ -58,73 +64,13 @@ export const PreviousOrders = (props: any) => {
58
64
  }
59
65
  };
60
66
 
61
- const OrdersList = (props: any) => {
62
- const { order, _order, hideBtns } = props
63
- return (
64
- <View
65
- style={{
66
- backgroundColor: currentOrdenSelected === order?.id ? theme.colors.gray100 : order?.locked && isLogisticOrder ? '#ccc' : '#fff',
67
- marginBottom: isLogisticOrder ? 10 : 0
68
- }}
69
- >
70
- <OrderItem
71
- order={order}
72
- _order={_order}
73
- isLogisticOrder={isLogisticOrder}
74
- handlePressOrder={handlePressOrder}
75
- currentTabSelected={currentTabSelected}
76
- getOrderStatus={getOrderStatus}
77
- />
78
- {isLogisticOrder && !hideBtns && (
79
- <AcceptOrRejectOrderStyle>
80
- {!!order?.order_group_id && !!order?.order_group ? (
81
- <OButton
82
- text={t('VIEW_ORDER', 'View order')}
83
- onClick={() => handlePressOrder({ ...order, logistic_order_id: _order?.id })}
84
- bgColor={theme.colors.blueLight}
85
- borderColor={theme.colors.blueLight}
86
- imgRightSrc={null}
87
- style={{ borderRadius: 7, height: 40 }}
88
- parentStyle={{ width: '100%' }}
89
- textStyle={{ color: theme?.colors?.white }}
90
- />
91
- ) : (
92
- <>
93
- <OButton
94
- text={t('REJECT', 'Reject')}
95
- onClick={() => handleClickLogisticOrder(2, _order?.id)}
96
- bgColor={theme.colors.red}
97
- borderColor={theme.colors.red}
98
- imgRightSrc={null}
99
- style={{ borderRadius: 7, height: 40 }}
100
- parentStyle={{ width: '45%' }}
101
- textStyle={{ color: theme.colors.white }}
102
- />
103
- <OButton
104
- text={t('ACCEPT', 'Accept')}
105
- onClick={() => handleClickLogisticOrder(1, _order?.id)}
106
- bgColor={theme.colors.green}
107
- borderColor={theme.colors.green}
108
- imgRightSrc={null}
109
- style={{ borderRadius: 7, height: 40 }}
110
- parentStyle={{ width: '45%' }}
111
- textStyle={{ color: theme.colors.white }}
112
- />
113
- </>
114
- )}
115
- </AcceptOrRejectOrderStyle>
116
- )}
117
- </View>
118
- )
119
- }
120
-
121
67
  const ordersGroupAction = (param1 = '', param2 = '', { order, action, body, ids }: any = {}) => {
122
68
  setOrderUpdateStatus({ ...orderUpdateStatus, action, ids, body, order })
123
69
  if (!param1) setOpenModal(true)
124
70
  if (param1) {
125
71
  setOpenModal(false)
126
72
  handleChangeOrderStatus &&
127
- handleChangeOrderStatus(param1, orderUpdateStatus.ids, param2)
73
+ handleChangeOrderStatus(param1, orderUpdateStatus.ids, param2)
128
74
  }
129
75
  }
130
76
 
@@ -159,7 +105,7 @@ export const PreviousOrders = (props: any) => {
159
105
  if (_order?.customer?.location) {
160
106
  locations.push({
161
107
  ..._order?.customer?.location,
162
- title: _order?.customer?.name ?? t('CUSTOMER', 'Customer'),
108
+ title: _order?.customer?.name ?? t('CUSTOMER', 'Customer'),
163
109
  address: {
164
110
  addressName: _order?.customer?.address,
165
111
  zipcode: _order?.customer?.zipcode
@@ -180,14 +126,14 @@ export const PreviousOrders = (props: any) => {
180
126
  })
181
127
  }
182
128
 
183
- useEffect(() => {
184
- const interval = setInterval(() => {
185
- const date: any = Date.now()
186
- setCurrentTime(date)
187
- }, slaSettingTime ?? 6000)
129
+ // useEffect(() => {
130
+ // const interval = setInterval(() => {
131
+ // const date: any = Date.now()
132
+ // setCurrentTime(date)
133
+ // }, slaSettingTime ?? 6000)
188
134
 
189
- return () => clearInterval(interval)
190
- }, [])
135
+ // return () => clearInterval(interval)
136
+ // }, [])
191
137
 
192
138
 
193
139
  return (
@@ -210,35 +156,48 @@ export const PreviousOrders = (props: any) => {
210
156
  ?.map((_order: any) => {
211
157
  const order_ = _order?.isLogistic && !_order?.order_group && isLogisticOrder ? _order?.order : _order
212
158
  return (
213
- <OrdersList key={order_.id} order={order_} _order={_order} hideBtns />
159
+ <OrdersList
160
+ key={order_.id}
161
+ order={order_}
162
+ _order={_order}
163
+ hideBtns
164
+ currentOrdenSelected={currentOrdenSelected}
165
+ isLogisticOrder={isLogisticOrder}
166
+ handlePressOrder={handlePressOrder}
167
+ currentTabSelected={currentTabSelected}
168
+ getOrderStatus={getOrderStatus}
169
+ handleClickLogisticOrder={handleClickLogisticOrder}
170
+ />
214
171
  )
215
172
  }
216
- )
173
+ )
217
174
  }
218
175
  {_ordersGrouped[k][0]?.status === 0 && (
219
176
  <AcceptOrRejectOrderStyle>
220
- <OButton
221
- text={t('REJECT_ALL', 'Reject all')}
222
- bgColor={theme.colors.danger100}
223
- borderColor={theme.colors.danger100}
224
- imgRightSrc={null}
225
- style={{ borderRadius: 7, height: 40 }}
226
- parentStyle={{ width: '45%' }}
227
- textStyle={{ color: theme.colors.danger500, fontSize: 12 }}
228
- onClick={() => onNavigationRedirect('AcceptOrRejectOrder', {
229
- action: 'reject',
230
- order: _ordersGrouped[k][0],
231
- ids: _ordersGrouped[k].map((o: any) => o.id),
232
- handleChangeOrderStatus
233
- })}
234
- />
177
+ {!isHideRejectButtons && (
178
+ <OButton
179
+ text={t('REJECT_ALL', 'Reject all')}
180
+ bgColor={theme.colors.danger100}
181
+ borderColor={theme.colors.danger100}
182
+ imgRightSrc={null}
183
+ style={{ borderRadius: 7, height: 40 }}
184
+ parentStyle={{ width: '45%' }}
185
+ textStyle={{ color: theme.colors.danger500, fontSize: 12 }}
186
+ onClick={() => onNavigationRedirect('AcceptOrRejectOrder', {
187
+ action: 'reject',
188
+ order: _ordersGrouped[k][0],
189
+ ids: _ordersGrouped[k].map((o: any) => o.id),
190
+ handleChangeOrderStatus
191
+ })}
192
+ />
193
+ )}
235
194
  <OButton
236
195
  text={t('ACCEPT_ALL', 'Accept all')}
237
196
  bgColor={theme.colors.success100}
238
197
  borderColor={theme.colors.success100}
239
198
  imgRightSrc={null}
240
199
  style={{ borderRadius: 7, height: 40 }}
241
- parentStyle={{ width: '45%' }}
200
+ parentStyle={{ width: isHideRejectButtons ? '100%' : '45%' }}
242
201
  textStyle={{ color: theme.colors.success500, fontSize: 12 }}
243
202
  onClick={() => onNavigationRedirect('AcceptOrRejectOrder', {
244
203
  action: 'accept',
@@ -268,133 +227,137 @@ export const PreviousOrders = (props: any) => {
268
227
  )}
269
228
  {(_ordersGrouped[k][0]?.status === 8 || _ordersGrouped[k][0]?.status === 18) &&
270
229
  _ordersGrouped[k][0]?.delivery_type === 1 &&
271
- (
272
- <AcceptOrRejectOrderStyle>
273
- <OButton
274
- text={t('ARRIVED_TO_BUSINESS', 'Arrived to bussiness')}
275
- bgColor={theme.colors.btnBGWhite}
276
- borderColor={theme.colors.btnBGWhite}
277
- imgRightSrc={null}
278
- style={{ borderRadius: 7, height: 40 }}
279
- parentStyle={{ width: '100%' }}
280
- textStyle={{ color: theme.colors.primary, fontSize: 12 }}
281
- onClick={() => handleChangeOrderStatus(
282
- 3,
283
- _ordersGrouped[k].map((o: any) => o.id),
284
- )}
285
- />
286
- </AcceptOrRejectOrderStyle>
287
- )}
288
- {_ordersGrouped[k][0]?.status === 3 && _ordersGrouped[k][0]?.delivery_type === 1 &&
289
- (
290
- <AcceptOrRejectOrderStyle>
291
- <OButton
292
- text={t('ORDER_NOT_READY', 'Order not ready')}
293
- bgColor={theme.colors.red}
294
- borderColor={theme.colors.red}
295
- imgRightSrc={null}
296
- style={{ borderRadius: 7, height: 40 }}
297
- parentStyle={{ width: '100%' }}
298
- textStyle={{ color: theme.colors.white, fontSize: 12 }}
299
- onClick={() => onNavigationRedirect('AcceptOrRejectOrder', {
300
- action: 'notReady',
301
- order: _ordersGrouped[k][0],
302
- ids: _ordersGrouped[k].map((o: any) => o.id),
303
- handleChangeOrderStatus
304
- })}
305
- />
306
- </AcceptOrRejectOrderStyle>
307
- )}
230
+ (
231
+ <AcceptOrRejectOrderStyle>
232
+ <OButton
233
+ text={t('ARRIVED_TO_BUSINESS', 'Arrived to bussiness')}
234
+ bgColor={theme.colors.btnBGWhite}
235
+ borderColor={theme.colors.btnBGWhite}
236
+ imgRightSrc={null}
237
+ style={{ borderRadius: 7, height: 40 }}
238
+ parentStyle={{ width: '100%' }}
239
+ textStyle={{ color: theme.colors.primary, fontSize: 12 }}
240
+ onClick={() => handleChangeOrderStatus(
241
+ 3,
242
+ _ordersGrouped[k].map((o: any) => o.id),
243
+ )}
244
+ />
245
+ </AcceptOrRejectOrderStyle>
246
+ )}
247
+ {_ordersGrouped[k][0]?.status === 3 && _ordersGrouped[k][0]?.delivery_type === 1 && !isHideRejectButtons && isEnabledOrderNotReady &&
248
+ (
249
+ <AcceptOrRejectOrderStyle>
250
+ <OButton
251
+ text={t('ORDER_NOT_READY', 'Order not ready')}
252
+ bgColor={theme.colors.red}
253
+ borderColor={theme.colors.red}
254
+ imgRightSrc={null}
255
+ style={{ borderRadius: 7, height: 40 }}
256
+ parentStyle={{ width: '100%' }}
257
+ textStyle={{ color: theme.colors.white, fontSize: 12 }}
258
+ onClick={() => onNavigationRedirect('AcceptOrRejectOrder', {
259
+ action: 'notReady',
260
+ order: _ordersGrouped[k][0],
261
+ ids: _ordersGrouped[k].map((o: any) => o.id),
262
+ handleChangeOrderStatus
263
+ })}
264
+ />
265
+ </AcceptOrRejectOrderStyle>
266
+ )}
308
267
  {viewMapStatus.includes(_ordersGrouped[k][0]?.status) &&
309
268
  props.appTitle?.text?.includes('Business') &&
310
- (
311
- <View>
312
- <OButton
313
- text={t('TRACK_REAL_TIME_POSITION', 'Track real time position')}
314
- bgColor={theme.colors.primaryLight}
315
- borderColor={theme.colors.primaryLight}
316
- imgRightSrc={null}
317
- style={{ borderRadius: 7, height: 40 }}
318
- parentStyle={{ width: '100%' }}
319
- textStyle={{ color: theme.colors.primary, fontSize: 12 }}
320
- onClick={() => handleOpenMapView({ orders: _ordersGrouped[k] })}
321
- />
322
- </View>
323
- )}
269
+ (
270
+ <View>
271
+ <OButton
272
+ text={t('TRACK_REAL_TIME_POSITION', 'Track real time position')}
273
+ bgColor={theme.colors.primaryLight}
274
+ borderColor={theme.colors.primaryLight}
275
+ imgRightSrc={null}
276
+ style={{ borderRadius: 7, height: 40 }}
277
+ parentStyle={{ width: '100%' }}
278
+ textStyle={{ color: theme.colors.primary, fontSize: 12 }}
279
+ onClick={() => handleOpenMapView({ orders: _ordersGrouped[k] })}
280
+ />
281
+ </View>
282
+ )}
324
283
  {_ordersGrouped[k][0]?.status === 4 &&
325
284
  ![1].includes(_ordersGrouped[k][0]?.delivery_type) &&
326
- (
327
- <AcceptOrRejectOrderStyle>
328
- <OButton
329
- text={t('ORDER_NOT_PICKEDUP_BY_CUSTOMER', 'Order not picked up by customer')}
330
- bgColor={theme.colors.danger100}
331
- borderColor={theme.colors.danger100}
332
- imgRightSrc={null}
333
- style={{ borderRadius: 7, height: 40, paddingLeft: 10, paddingRight: 10 }}
334
- parentStyle={{ width: '45%' }}
335
- textStyle={{ color: theme.colors.danger500, fontSize: 12, textAlign: 'center' }}
336
- onClick={() => handleChangeOrderStatus(
337
- 17,
338
- _ordersGrouped[k].map((o: any) => o.id),
339
- )}
340
- />
341
- <OButton
342
- text={t('PICKUP_COMPLETED_BY_CUSTOMER', 'Pickup completed by customer')}
343
- bgColor={theme.colors.success100}
344
- borderColor={theme.colors.success100}
345
- imgRightSrc={null}
346
- style={{ borderRadius: 7, height: 40, paddingLeft: 10, paddingRight: 10 }}
347
- parentStyle={{ width: '45%' }}
348
- textStyle={{ color: theme.colors.success500, fontSize: 12, textAlign: 'center' }}
349
- onClick={() => handleChangeOrderStatus(
350
- 15,
351
- _ordersGrouped[k].map((o: any) => o.id),
285
+ (
286
+ <AcceptOrRejectOrderStyle>
287
+ {!isHideRejectButtons && (
288
+ <OButton
289
+ text={t('ORDER_NOT_PICKEDUP_BY_CUSTOMER', 'Order not picked up by customer')}
290
+ bgColor={theme.colors.danger100}
291
+ borderColor={theme.colors.danger100}
292
+ imgRightSrc={null}
293
+ style={{ borderRadius: 7, height: 40, paddingLeft: 10, paddingRight: 10 }}
294
+ parentStyle={{ width: '45%' }}
295
+ textStyle={{ color: theme.colors.danger500, fontSize: 12, textAlign: 'center' }}
296
+ onClick={() => handleChangeOrderStatus(
297
+ 17,
298
+ _ordersGrouped[k].map((o: any) => o.id),
299
+ )}
300
+ />
352
301
  )}
353
- />
354
- </AcceptOrRejectOrderStyle>
355
- )}
302
+ <OButton
303
+ text={t('PICKUP_COMPLETED_BY_CUSTOMER', 'Pickup completed by customer')}
304
+ bgColor={theme.colors.success100}
305
+ borderColor={theme.colors.success100}
306
+ imgRightSrc={null}
307
+ style={{ borderRadius: 7, height: 40, paddingLeft: 10, paddingRight: 10 }}
308
+ parentStyle={{ width: isHideRejectButtons ? '100%' : '45%' }}
309
+ textStyle={{ color: theme.colors.success500, fontSize: 12, textAlign: 'center' }}
310
+ onClick={() => handleChangeOrderStatus(
311
+ 15,
312
+ _ordersGrouped[k].map((o: any) => o.id),
313
+ )}
314
+ />
315
+ </AcceptOrRejectOrderStyle>
316
+ )}
356
317
  {!_ordersGrouped[k][0]?.user_review &&
357
318
  pastOrderStatuses.includes(_ordersGrouped[k][0]?.status) &&
358
- (
359
- <OButton
360
- text={t('REVIEW_CUSTOMER', 'Review customer')}
361
- bgColor={theme.colors.primary}
362
- borderColor={theme.colors.primary}
363
- imgRightSrc={null}
364
- style={{ borderRadius: 8, height: 40 }}
365
- parentStyle={{ width: '100%' }}
366
- textStyle={{ color: theme.colors.white }}
367
- onClick={() => setOpenReviewModal({
368
- order: _ordersGrouped[k][0],
369
- customerId: _ordersGrouped[k][0]?.customer_id,
370
- ids: _ordersGrouped[k].map((o: any) => o.id)
371
- })}
372
- />
373
- )}
374
- {!!deliveryPickupBtn && deliveryPickupBtn?.includes(_ordersGrouped[k][0]?.status) && (
375
- <AcceptOrRejectOrderStyle>
319
+ (
376
320
  <OButton
377
- text={t('PICKUP_FAILED', 'Pickup failed')}
378
- bgColor={theme.colors.danger100}
379
- borderColor={theme.colors.danger100}
321
+ text={t('REVIEW_CUSTOMER', 'Review customer')}
322
+ bgColor={theme.colors.primary}
323
+ borderColor={theme.colors.primary}
380
324
  imgRightSrc={null}
381
- style={{ borderRadius: 7, height: 40, paddingLeft: 10, paddingRight: 10 }}
382
- parentStyle={{ width: '45%' }}
383
- textStyle={{ color: theme.colors.danger500, fontSize: 12, textAlign: 'center' }}
384
- onClick={() => onNavigationRedirect('AcceptOrRejectOrder', {
385
- action: 'pickupFailed',
325
+ style={{ borderRadius: 8, height: 40 }}
326
+ parentStyle={{ width: '100%' }}
327
+ textStyle={{ color: theme.colors.white }}
328
+ onClick={() => setOpenReviewModal({
386
329
  order: _ordersGrouped[k][0],
387
- ids: _ordersGrouped[k].map((o: any) => o.id),
388
- handleChangeOrderStatus
330
+ customerId: _ordersGrouped[k][0]?.customer_id,
331
+ ids: _ordersGrouped[k].map((o: any) => o.id)
389
332
  })}
390
333
  />
334
+ )}
335
+ {!!deliveryPickupBtn && deliveryPickupBtn?.includes(_ordersGrouped[k][0]?.status) && isEnabledFailedPickupDriver && (
336
+ <AcceptOrRejectOrderStyle>
337
+ {!isHideRejectButtons && isEnabledOrderNotReady && (
338
+ <OButton
339
+ text={t('PICKUP_FAILED', 'Pickup failed')}
340
+ bgColor={theme.colors.danger100}
341
+ borderColor={theme.colors.danger100}
342
+ imgRightSrc={null}
343
+ style={{ borderRadius: 7, height: 40, paddingLeft: 10, paddingRight: 10 }}
344
+ parentStyle={{ width: '45%' }}
345
+ textStyle={{ color: theme.colors.danger500, fontSize: 12, textAlign: 'center' }}
346
+ onClick={() => onNavigationRedirect('AcceptOrRejectOrder', {
347
+ action: 'pickupFailed',
348
+ order: _ordersGrouped[k][0],
349
+ ids: _ordersGrouped[k].map((o: any) => o.id),
350
+ handleChangeOrderStatus
351
+ })}
352
+ />
353
+ )}
391
354
  <OButton
392
355
  text={t('PICKUP_COMPLETE', 'Pickup complete')}
393
356
  bgColor={theme.colors.success100}
394
357
  borderColor={theme.colors.success100}
395
358
  imgRightSrc={null}
396
359
  style={{ borderRadius: 7, height: 40, paddingLeft: 10, paddingRight: 10 }}
397
- parentStyle={{ width: '45%' }}
360
+ parentStyle={{ width: isHideRejectButtons ? '100%' : '45%' }}
398
361
  textStyle={{ color: theme.colors.success500, fontSize: 12, textAlign: 'center' }}
399
362
  onClick={() => handleChangeOrderStatus(
400
363
  9,
@@ -405,28 +368,30 @@ export const PreviousOrders = (props: any) => {
405
368
  )}
406
369
  {!!deliveryStatusCompleteBtn && deliveryStatusCompleteBtn.includes(_ordersGrouped[k][0]?.status) && (
407
370
  <AcceptOrRejectOrderStyle>
408
- <OButton
409
- text={t('DELIVERY_FAILED', 'Delivery Failed')}
410
- bgColor={theme.colors.danger100}
411
- borderColor={theme.colors.danger100}
412
- imgRightSrc={null}
413
- style={{ borderRadius: 7, height: 40, paddingLeft: 10, paddingRight: 10 }}
414
- parentStyle={{ width: '45%' }}
415
- textStyle={{ color: theme.colors.danger500, fontSize: 12, textAlign: 'center' }}
416
- onClick={() => onNavigationRedirect('AcceptOrRejectOrder', {
417
- action: 'deliveryFailed',
418
- order: _ordersGrouped[k][0],
419
- ids: _ordersGrouped[k].map((o: any) => o.id),
420
- handleChangeOrderStatus
421
- })}
422
- />
371
+ {!isHideRejectButtons && (
372
+ <OButton
373
+ text={t('DELIVERY_FAILED', 'Delivery Failed')}
374
+ bgColor={theme.colors.danger100}
375
+ borderColor={theme.colors.danger100}
376
+ imgRightSrc={null}
377
+ style={{ borderRadius: 7, height: 40, paddingLeft: 10, paddingRight: 10 }}
378
+ parentStyle={{ width: '45%' }}
379
+ textStyle={{ color: theme.colors.danger500, fontSize: 12, textAlign: 'center' }}
380
+ onClick={() => onNavigationRedirect('AcceptOrRejectOrder', {
381
+ action: 'deliveryFailed',
382
+ order: _ordersGrouped[k][0],
383
+ ids: _ordersGrouped[k].map((o: any) => o.id),
384
+ handleChangeOrderStatus
385
+ })}
386
+ />
387
+ )}
423
388
  <OButton
424
389
  text={t('DELIVERY_COMPLETE', 'Delivery complete')}
425
390
  bgColor={theme.colors.success100}
426
391
  borderColor={theme.colors.success100}
427
392
  imgRightSrc={null}
428
393
  style={{ borderRadius: 7, height: 40, paddingLeft: 10, paddingRight: 10 }}
429
- parentStyle={{ width: '45%' }}
394
+ parentStyle={{ width: isHideRejectButtons ? '100%' : '45%' }}
430
395
  textStyle={{ color: theme.colors.success500, fontSize: 12, textAlign: 'center' }}
431
396
  onClick={() => handleChangeOrderStatus(
432
397
  11,
@@ -440,7 +405,16 @@ export const PreviousOrders = (props: any) => {
440
405
  </View>
441
406
  ) : (
442
407
  <View key={order.id}>
443
- <OrdersList order={order} _order={_order} />
408
+ <OrdersList
409
+ order={order}
410
+ _order={_order}
411
+ currentOrdenSelected={currentOrdenSelected}
412
+ isLogisticOrder={isLogisticOrder}
413
+ handlePressOrder={handlePressOrder}
414
+ currentTabSelected={currentTabSelected}
415
+ getOrderStatus={getOrderStatus}
416
+ handleClickLogisticOrder={handleClickLogisticOrder}
417
+ />
444
418
  </View>
445
419
  )
446
420
  )
@@ -41,6 +41,16 @@ export const Timestatus = styled.View`
41
41
  height: 55px;
42
42
  border-radius: 20px;
43
43
  top: 5px;
44
+
45
+ ${({ timeState }: any) => timeState === 'in_time' && css`
46
+ background-color: #00D27A;
47
+ `}
48
+ ${({ timeState }: any) => timeState === 'at_risk' && css`
49
+ background-color: #FFC700;
50
+ `}
51
+ ${({ timeState }: any) => timeState === 'delayed' && css`
52
+ background-color: #E63757;
53
+ `}
44
54
  `
45
55
 
46
56
  export const AccordionSection = styled.View`