ordering-ui-react-native 0.17.91 → 0.17.92-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 (214) hide show
  1. package/package.json +8 -7
  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/OrderCreating/index.tsx +0 -20
  6. package/src/components/PaymentOptionsWebView/index.tsx +29 -8
  7. package/src/components/PhoneInputNumber/index.tsx +6 -2
  8. package/src/components/StripeMethodForm/index.tsx +136 -102
  9. package/src/components/VerifyPhone/styles.tsx +1 -2
  10. package/src/components/shared/OToast.tsx +3 -2
  11. package/src/types/index.tsx +5 -0
  12. package/src/utils/index.tsx +5 -0
  13. package/themes/business/index.tsx +2 -0
  14. package/themes/business/src/components/AcceptOrRejectOrder/index.tsx +36 -26
  15. package/themes/business/src/components/BusinessController/index.tsx +0 -1
  16. package/themes/business/src/components/Chat/index.tsx +163 -123
  17. package/themes/business/src/components/DriverMap/index.tsx +17 -6
  18. package/themes/business/src/components/DriverSchedule/index.tsx +45 -8
  19. package/themes/business/src/components/FloatingButton/index.tsx +34 -31
  20. package/themes/business/src/components/GoogleMap/index.tsx +58 -57
  21. package/themes/business/src/components/LoginForm/index.tsx +5 -2
  22. package/themes/business/src/components/MapView/index.tsx +14 -10
  23. package/themes/business/src/components/MessagesOption/index.tsx +20 -93
  24. package/themes/business/src/components/NewOrderNotification/index.tsx +123 -96
  25. package/themes/business/src/components/NotFoundSource/index.tsx +2 -2
  26. package/themes/business/src/components/OrderDetails/Business.tsx +1 -1
  27. package/themes/business/src/components/OrderDetails/Delivery.tsx +202 -12
  28. package/themes/business/src/components/OrderDetails/OrderContentComponent.tsx +84 -37
  29. package/themes/business/src/components/OrderDetails/OrderHeaderComponent.tsx +81 -66
  30. package/themes/business/src/components/OrderDetailsLogistic/index.tsx +200 -0
  31. package/themes/business/src/components/OrderDetailsLogistic/styles.tsx +5 -0
  32. package/themes/business/src/components/OrderMessage/index.tsx +19 -18
  33. package/themes/business/src/components/OrderSummary/index.tsx +114 -123
  34. package/themes/business/src/components/OrdersOption/index.tsx +22 -22
  35. package/themes/business/src/components/PreviousMessages/FooterMessageComponent.tsx +103 -0
  36. package/themes/business/src/components/PreviousMessages/index.tsx +97 -55
  37. package/themes/business/src/components/PreviousOrders/OrderItem.tsx +17 -12
  38. package/themes/business/src/components/PreviousOrders/OrderList.tsx +93 -0
  39. package/themes/business/src/components/PreviousOrders/OrdersGroupedItem.tsx +1 -1
  40. package/themes/business/src/components/PreviousOrders/index.tsx +198 -221
  41. package/themes/business/src/components/ProductItemAccordion/index.tsx +7 -1
  42. package/themes/business/src/components/ReviewCustomer/index.tsx +18 -13
  43. package/themes/business/src/components/StoresList/index.tsx +3 -4
  44. package/themes/business/src/components/UserProfileForm/index.tsx +14 -15
  45. package/themes/business/src/components/shared/OModal.tsx +16 -9
  46. package/themes/business/src/types/index.tsx +24 -10
  47. package/themes/business/src/utils/index.tsx +29 -2
  48. package/themes/doordash/src/components/BusinessesListing/index.tsx +1 -1
  49. package/themes/doordash/src/components/LoginForm/index.tsx +1 -2
  50. package/themes/instacart/src/components/BusinessesListing/index.tsx +1 -1
  51. package/themes/kiosk/src/components/Checkout/index.tsx +6 -0
  52. package/themes/kiosk/src/components/Intro/index.tsx +16 -1
  53. package/themes/kiosk/src/components/LoginForm/index.tsx +7 -5
  54. package/themes/kiosk/src/components/NavBar/index.tsx +14 -14
  55. package/themes/kiosk/src/components/OptionCard/index.tsx +1 -1
  56. package/themes/kiosk/src/components/OrderTypeCardSelector/index.tsx +8 -10
  57. package/themes/kiosk/src/components/PhoneInputNumber/index.tsx +2 -2
  58. package/themes/kiosk/src/components/shared/OButton.tsx +5 -18
  59. package/themes/original/index.tsx +1 -1
  60. package/themes/original/src/components/AddressDetails/index.tsx +19 -3
  61. package/themes/original/src/components/AddressForm/index.tsx +35 -17
  62. package/themes/original/src/components/AddressList/index.tsx +5 -8
  63. package/themes/original/src/components/AnalyticsSegment/index.tsx +193 -10
  64. package/themes/original/src/components/AppleLogin/index.tsx +4 -4
  65. package/themes/original/src/components/AppleLogin/styles.tsx +3 -1
  66. package/themes/original/src/components/BusinessBasicInformation/index.tsx +73 -37
  67. package/themes/original/src/components/BusinessBasicInformation/styles.tsx +10 -12
  68. package/themes/original/src/components/BusinessController/index.tsx +35 -44
  69. package/themes/original/src/components/BusinessController/styles.tsx +12 -5
  70. package/themes/original/src/components/BusinessFeaturedController/index.tsx +21 -54
  71. package/themes/original/src/components/BusinessFeaturedController/styles.tsx +8 -0
  72. package/themes/original/src/components/BusinessInformation/index.tsx +140 -85
  73. package/themes/original/src/components/BusinessItemAccordion/index.tsx +15 -20
  74. package/themes/original/src/components/BusinessListingSearch/index.tsx +347 -341
  75. package/themes/original/src/components/BusinessListingSearch/styles.tsx +0 -18
  76. package/themes/original/src/components/BusinessPreorder/index.tsx +103 -19
  77. package/themes/original/src/components/BusinessProductsCategories/index.tsx +1 -2
  78. package/themes/original/src/components/BusinessProductsList/index.tsx +15 -7
  79. package/themes/original/src/components/BusinessProductsList/styles.tsx +8 -3
  80. package/themes/original/src/components/BusinessProductsListing/UpsellingRedirect.tsx +1 -1
  81. package/themes/original/src/components/BusinessProductsListing/index.tsx +664 -556
  82. package/themes/original/src/components/BusinessProductsListing/styles.tsx +2 -3
  83. package/themes/original/src/components/BusinessReviews/index.tsx +3 -1
  84. package/themes/original/src/components/BusinessesListing/Layout/Original/FlatListBusinessListFooter.tsx +69 -0
  85. package/themes/original/src/components/BusinessesListing/Layout/Original/FlatListBusinessListHeader.tsx +406 -0
  86. package/themes/original/src/components/BusinessesListing/Layout/Original/FlatListBusinessListing.tsx +76 -0
  87. package/themes/original/src/components/BusinessesListing/Layout/Original/index.tsx +38 -405
  88. package/themes/original/src/components/BusinessesListing/index.tsx +0 -1
  89. package/themes/original/src/components/Cart/index.tsx +56 -56
  90. package/themes/original/src/components/CartContent/index.tsx +102 -58
  91. package/themes/original/src/components/CartContent/styles.tsx +6 -6
  92. package/themes/original/src/components/Checkout/index.tsx +277 -33
  93. package/themes/original/src/components/CitiesControl/index.tsx +1 -1
  94. package/themes/original/src/components/CouponControl/index.tsx +10 -3
  95. package/themes/original/src/components/DriverTips/index.tsx +14 -6
  96. package/themes/original/src/components/FacebookLogin/styles.tsx +3 -1
  97. package/themes/original/src/components/Favorite/index.tsx +1 -5
  98. package/themes/original/src/components/GPSButton/index.tsx +6 -4
  99. package/themes/original/src/components/GiftCard/GiftCardUI/index.tsx +8 -3
  100. package/themes/original/src/components/GiftCard/PurchaseGiftCard/index.tsx +42 -5
  101. package/themes/original/src/components/GiftCard/PurchaseGiftCard/styles.tsx +2 -0
  102. package/themes/original/src/components/GiftCard/RedeemGiftCard/index.tsx +86 -10
  103. package/themes/original/src/components/GoogleLogin/styles.tsx +1 -1
  104. package/themes/original/src/components/GoogleMap/index.tsx +63 -7
  105. package/themes/original/src/components/Home/index.tsx +13 -4
  106. package/themes/original/src/components/LastOrder/index.tsx +2 -1
  107. package/themes/original/src/components/LastOrders/index.tsx +2 -1
  108. package/themes/original/src/components/LoginForm/Otp/index.tsx +91 -25
  109. package/themes/original/src/components/LoginForm/index.tsx +64 -34
  110. package/themes/original/src/components/LottieAnimation/index.tsx +88 -63
  111. package/themes/original/src/components/MessageListing/index.tsx +9 -2
  112. package/themes/original/src/components/Messages/index.tsx +15 -4
  113. package/themes/original/src/components/MomentOption/index.tsx +193 -92
  114. package/themes/original/src/components/MomentSelector/index.tsx +1 -1
  115. package/themes/original/src/components/MultiCartsPaymethodsAndWallets/index.tsx +162 -50
  116. package/themes/original/src/components/MultiCheckout/index.tsx +385 -46
  117. package/themes/original/src/components/MultiCheckout/styles.tsx +3 -1
  118. package/themes/original/src/components/MultiOrdersDetails/index.tsx +23 -19
  119. package/themes/original/src/components/MyOrders/index.tsx +15 -4
  120. package/themes/original/src/components/NavBar/index.tsx +20 -13
  121. package/themes/original/src/components/NotFoundSource/index.tsx +14 -10
  122. package/themes/original/src/components/OrderDetails/OrderEta.tsx +76 -0
  123. package/themes/original/src/components/OrderDetails/OrderHistory.tsx +21 -5
  124. package/themes/original/src/components/OrderDetails/index.tsx +50 -38
  125. package/themes/original/src/components/OrderDetails/styles.tsx +0 -1
  126. package/themes/original/src/components/OrderItAgain/index.tsx +3 -1
  127. package/themes/original/src/components/OrderProgress/index.tsx +34 -25
  128. package/themes/original/src/components/OrderSummary/index.tsx +83 -57
  129. package/themes/original/src/components/OrderTypeSelector/index.tsx +5 -6
  130. package/themes/original/src/components/OrdersOption/PreviousProductsOrdered/index.tsx +13 -13
  131. package/themes/original/src/components/OrdersOption/index.tsx +43 -20
  132. package/themes/original/src/components/OrdersOption/styles.tsx +1 -1
  133. package/themes/original/src/components/PageBanner/index.tsx +65 -29
  134. package/themes/original/src/components/PageBanner/styles.tsx +0 -3
  135. package/themes/original/src/components/PaymentOptionCard/index.tsx +180 -0
  136. package/themes/original/src/components/PaymentOptionStripe/styles.tsx +3 -0
  137. package/themes/original/src/components/PaymentOptionWallet/index.tsx +56 -56
  138. package/themes/original/src/components/PaymentOptions/index.tsx +100 -34
  139. package/themes/original/src/components/PhoneInputNumber/index.tsx +18 -4
  140. package/themes/original/src/components/ProductForm/index.tsx +87 -31
  141. package/themes/original/src/components/ProductForm/styles.tsx +3 -3
  142. package/themes/original/src/components/ProductItemAccordion/index.tsx +8 -6
  143. package/themes/original/src/components/ProductOptionSubOption/index.tsx +49 -20
  144. package/themes/original/src/components/ProductOptionSubOption/styles.tsx +10 -9
  145. package/themes/original/src/components/ProfessionalFilter/SingleProfessionalCard/index.tsx +108 -0
  146. package/themes/original/src/components/ProfessionalFilter/index.tsx +20 -50
  147. package/themes/original/src/components/ProfessionalProfile/index.tsx +36 -7
  148. package/themes/original/src/components/Promotions/index.tsx +2 -2
  149. package/themes/original/src/components/Promotions/styles.tsx +3 -1
  150. package/themes/original/src/components/ReviewProducts/index.tsx +16 -7
  151. package/themes/original/src/components/ScheduleAccordion/index.tsx +3 -3
  152. package/themes/original/src/components/ServiceForm/index.tsx +63 -20
  153. package/themes/original/src/components/SignupForm/index.tsx +43 -27
  154. package/themes/original/src/components/SingleOrderCard/index.tsx +44 -20
  155. package/themes/original/src/components/SingleOrderCard/styles.tsx +1 -1
  156. package/themes/original/src/components/SingleProductCard/index.tsx +14 -11
  157. package/themes/original/src/components/SingleProductCard/styles.tsx +8 -3
  158. package/themes/original/src/components/SingleProductReview/styles.tsx +1 -1
  159. package/themes/original/src/components/StripeCardsList/index.tsx +61 -5
  160. package/themes/original/src/components/StripeElementsForm/index.tsx +48 -34
  161. package/themes/original/src/components/StripeElementsForm/naked.tsx +12 -1
  162. package/themes/original/src/components/UpsellingProducts/index.tsx +5 -10
  163. package/themes/original/src/components/UserDetails/index.tsx +3 -1
  164. package/themes/original/src/components/UserFormDetails/index.tsx +78 -9
  165. package/themes/original/src/components/UserFormDetails/styles.tsx +1 -1
  166. package/themes/original/src/components/UserProfile/index.tsx +8 -26
  167. package/themes/original/src/components/UserProfileForm/index.tsx +30 -31
  168. package/themes/original/src/components/UserVerification/index.tsx +55 -50
  169. package/themes/original/src/components/WalletTransactionItem/index.tsx +2 -2
  170. package/themes/original/src/components/WalletTransactions/index.tsx +3 -3
  171. package/themes/original/src/components/Wallets/index.tsx +52 -62
  172. package/themes/original/src/components/Wallets/styles.tsx +2 -4
  173. package/themes/original/src/components/shared/OButton.tsx +3 -3
  174. package/themes/original/src/components/shared/OInput.tsx +4 -5
  175. package/themes/original/src/components/shared/OModal.tsx +3 -3
  176. package/themes/original/src/types/index.tsx +37 -10
  177. package/themes/original/src/utils/index.tsx +185 -13
  178. package/themes/uber-eats/src/components/BusinessesListing/index.tsx +1 -1
  179. package/src/navigators/BottomNavigator.tsx +0 -117
  180. package/src/navigators/CheckoutNavigator.tsx +0 -66
  181. package/src/navigators/HomeNavigator.tsx +0 -202
  182. package/src/navigators/NavigationRef.tsx +0 -7
  183. package/src/navigators/RootNavigator.tsx +0 -269
  184. package/src/pages/Account.tsx +0 -34
  185. package/src/pages/AddressForm.tsx +0 -62
  186. package/src/pages/AddressList.tsx +0 -24
  187. package/src/pages/BusinessProductsList.tsx +0 -81
  188. package/src/pages/BusinessesListing.tsx +0 -43
  189. package/src/pages/CartList.tsx +0 -49
  190. package/src/pages/Checkout.tsx +0 -101
  191. package/src/pages/ForgotPassword.tsx +0 -24
  192. package/src/pages/Help.tsx +0 -23
  193. package/src/pages/HelpAccountAndPayment.tsx +0 -23
  194. package/src/pages/HelpGuide.tsx +0 -23
  195. package/src/pages/HelpOrder.tsx +0 -23
  196. package/src/pages/Home.tsx +0 -36
  197. package/src/pages/IntroductoryTutorial.tsx +0 -170
  198. package/src/pages/Login.tsx +0 -47
  199. package/src/pages/MomentOption.tsx +0 -30
  200. package/src/pages/MultiCheckout.tsx +0 -31
  201. package/src/pages/MultiOrdersDetails.tsx +0 -27
  202. package/src/pages/MyOrders.tsx +0 -40
  203. package/src/pages/NetworkError.tsx +0 -24
  204. package/src/pages/NotFound.tsx +0 -22
  205. package/src/pages/OrderDetails.tsx +0 -25
  206. package/src/pages/ProductDetails.tsx +0 -55
  207. package/src/pages/Profile.tsx +0 -36
  208. package/src/pages/ReviewDriver.tsx +0 -30
  209. package/src/pages/ReviewOrder.tsx +0 -32
  210. package/src/pages/ReviewProducts.tsx +0 -30
  211. package/src/pages/Sessions.tsx +0 -22
  212. package/src/pages/Signup.tsx +0 -53
  213. package/src/pages/SpinnerLoader.tsx +0 -10
  214. 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,7 @@ 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
44
48
 
45
49
  const handlePressOrder = (order: any) => {
46
50
  if (order?.locked && isLogisticOrder) return
@@ -48,78 +52,23 @@ export const PreviousOrders = (props: any) => {
48
52
  if (props.handleClickEvent) {
49
53
  props.handleClickEvent({ ...order, isLogistic: isLogisticOrder })
50
54
  } else {
51
- onNavigationRedirect &&
52
- onNavigationRedirect('OrderDetails', { order: { ...order, isLogistic: isLogisticOrder }, handleClickLogisticOrder });
55
+ if (isLogisticOrder) {
56
+ onNavigationRedirect &&
57
+ onNavigationRedirect('OrderDetailsLogistic', { order: { ...order, isLogistic: isLogisticOrder }, handleClickLogisticOrder });
58
+ } else {
59
+ onNavigationRedirect &&
60
+ onNavigationRedirect('OrderDetails', { order });
61
+ }
53
62
  }
54
63
  };
55
64
 
56
- const OrdersList = (props: any) => {
57
- const { order, _order, hideBtns } = props
58
- return (
59
- <View
60
- style={{
61
- backgroundColor: currentOrdenSelected === order?.id ? theme.colors.gray100 : order?.locked && isLogisticOrder ? '#ccc' : '#fff',
62
- marginBottom: isLogisticOrder ? 10 : 0
63
- }}
64
- >
65
- <OrderItem
66
- order={order}
67
- _order={_order}
68
- isLogisticOrder={isLogisticOrder}
69
- handlePressOrder={handlePressOrder}
70
- currentTabSelected={currentTabSelected}
71
- getOrderStatus={getOrderStatus}
72
- />
73
- {isLogisticOrder && !hideBtns && (
74
- <AcceptOrRejectOrderStyle>
75
- {!!order?.order_group_id && !!order?.order_group ? (
76
- <OButton
77
- text={t('VIEW_ORDER', 'View order')}
78
- onClick={() => handlePressOrder({ ...order, logistic_order_id: _order?.id })}
79
- bgColor={theme.colors.blueLight}
80
- borderColor={theme.colors.blueLight}
81
- imgRightSrc={null}
82
- style={{ borderRadius: 7, height: 40 }}
83
- parentStyle={{ width: '100%' }}
84
- textStyle={{ color: theme.colors.primary }}
85
- />
86
- ) : (
87
- <>
88
- <OButton
89
- text={t('REJECT', 'Reject')}
90
- onClick={() => handleClickLogisticOrder(2, _order?.id)}
91
- bgColor={theme.colors.danger}
92
- borderColor={theme.colors.danger}
93
- imgRightSrc={null}
94
- style={{ borderRadius: 7, height: 40 }}
95
- parentStyle={{ width: '45%' }}
96
- textStyle={{ color: theme.colors.dangerText }}
97
- />
98
- <OButton
99
- text={t('ACCEPT', 'Accept')}
100
- onClick={() => handleClickLogisticOrder(1, _order?.id)}
101
- bgColor={theme.colors.successOrder}
102
- borderColor={theme.colors.successOrder}
103
- imgRightSrc={null}
104
- style={{ borderRadius: 7, height: 40 }}
105
- parentStyle={{ width: '45%' }}
106
- textStyle={{ color: theme.colors.successText }}
107
- />
108
- </>
109
- )}
110
- </AcceptOrRejectOrderStyle>
111
- )}
112
- </View>
113
- )
114
- }
115
-
116
65
  const ordersGroupAction = (param1 = '', param2 = '', { order, action, body, ids }: any = {}) => {
117
66
  setOrderUpdateStatus({ ...orderUpdateStatus, action, ids, body, order })
118
67
  if (!param1) setOpenModal(true)
119
68
  if (param1) {
120
69
  setOpenModal(false)
121
70
  handleChangeOrderStatus &&
122
- handleChangeOrderStatus(param1, orderUpdateStatus.ids, param2)
71
+ handleChangeOrderStatus(param1, orderUpdateStatus.ids, param2)
123
72
  }
124
73
  }
125
74
 
@@ -154,7 +103,7 @@ export const PreviousOrders = (props: any) => {
154
103
  if (_order?.customer?.location) {
155
104
  locations.push({
156
105
  ..._order?.customer?.location,
157
- title: _order?.customer?.name ?? t('CUSTOMER', 'Customer'),
106
+ title: _order?.customer?.name ?? t('CUSTOMER', 'Customer'),
158
107
  address: {
159
108
  addressName: _order?.customer?.address,
160
109
  zipcode: _order?.customer?.zipcode
@@ -175,14 +124,14 @@ export const PreviousOrders = (props: any) => {
175
124
  })
176
125
  }
177
126
 
178
- useEffect(() => {
179
- const interval = setInterval(() => {
180
- const date: any = Date.now()
181
- setCurrentTime(date)
182
- }, slaSettingTime ?? 6000)
127
+ // useEffect(() => {
128
+ // const interval = setInterval(() => {
129
+ // const date: any = Date.now()
130
+ // setCurrentTime(date)
131
+ // }, slaSettingTime ?? 6000)
183
132
 
184
- return () => clearInterval(interval)
185
- }, [])
133
+ // return () => clearInterval(interval)
134
+ // }, [])
186
135
 
187
136
 
188
137
  return (
@@ -205,35 +154,48 @@ export const PreviousOrders = (props: any) => {
205
154
  ?.map((_order: any) => {
206
155
  const order_ = _order?.isLogistic && !_order?.order_group && isLogisticOrder ? _order?.order : _order
207
156
  return (
208
- <OrdersList key={order_.id} order={order_} _order={_order} hideBtns />
157
+ <OrdersList
158
+ key={order_.id}
159
+ order={order_}
160
+ _order={_order}
161
+ hideBtns
162
+ currentOrdenSelected={currentOrdenSelected}
163
+ isLogisticOrder={isLogisticOrder}
164
+ handlePressOrder={handlePressOrder}
165
+ currentTabSelected={currentTabSelected}
166
+ getOrderStatus={getOrderStatus}
167
+ handleClickLogisticOrder={handleClickLogisticOrder}
168
+ />
209
169
  )
210
170
  }
211
- )
171
+ )
212
172
  }
213
173
  {_ordersGrouped[k][0]?.status === 0 && (
214
174
  <AcceptOrRejectOrderStyle>
215
- <OButton
216
- text={t('REJECT_ALL', 'Reject all')}
217
- bgColor={theme.colors.danger100}
218
- borderColor={theme.colors.danger100}
219
- imgRightSrc={null}
220
- style={{ borderRadius: 7, height: 40 }}
221
- parentStyle={{ width: '45%' }}
222
- textStyle={{ color: theme.colors.danger500, fontSize: 12 }}
223
- onClick={() => onNavigationRedirect('AcceptOrRejectOrder', {
224
- action: 'reject',
225
- order: _ordersGrouped[k][0],
226
- ids: _ordersGrouped[k].map((o: any) => o.id),
227
- handleChangeOrderStatus
228
- })}
229
- />
175
+ {!isHideRejectButtons && (
176
+ <OButton
177
+ text={t('REJECT_ALL', 'Reject all')}
178
+ bgColor={theme.colors.danger100}
179
+ borderColor={theme.colors.danger100}
180
+ imgRightSrc={null}
181
+ style={{ borderRadius: 7, height: 40 }}
182
+ parentStyle={{ width: '45%' }}
183
+ textStyle={{ color: theme.colors.danger500, fontSize: 12 }}
184
+ onClick={() => onNavigationRedirect('AcceptOrRejectOrder', {
185
+ action: 'reject',
186
+ order: _ordersGrouped[k][0],
187
+ ids: _ordersGrouped[k].map((o: any) => o.id),
188
+ handleChangeOrderStatus
189
+ })}
190
+ />
191
+ )}
230
192
  <OButton
231
193
  text={t('ACCEPT_ALL', 'Accept all')}
232
194
  bgColor={theme.colors.success100}
233
195
  borderColor={theme.colors.success100}
234
196
  imgRightSrc={null}
235
197
  style={{ borderRadius: 7, height: 40 }}
236
- parentStyle={{ width: '45%' }}
198
+ parentStyle={{ width: isHideRejectButtons ? '100%' : '45%' }}
237
199
  textStyle={{ color: theme.colors.success500, fontSize: 12 }}
238
200
  onClick={() => onNavigationRedirect('AcceptOrRejectOrder', {
239
201
  action: 'accept',
@@ -263,133 +225,137 @@ export const PreviousOrders = (props: any) => {
263
225
  )}
264
226
  {(_ordersGrouped[k][0]?.status === 8 || _ordersGrouped[k][0]?.status === 18) &&
265
227
  _ordersGrouped[k][0]?.delivery_type === 1 &&
266
- (
267
- <AcceptOrRejectOrderStyle>
268
- <OButton
269
- text={t('ARRIVED_TO_BUSINESS', 'Arrived to bussiness')}
270
- bgColor={theme.colors.btnBGWhite}
271
- borderColor={theme.colors.btnBGWhite}
272
- imgRightSrc={null}
273
- style={{ borderRadius: 7, height: 40 }}
274
- parentStyle={{ width: '100%' }}
275
- textStyle={{ color: theme.colors.primary, fontSize: 12 }}
276
- onClick={() => handleChangeOrderStatus(
277
- 3,
278
- _ordersGrouped[k].map((o: any) => o.id),
279
- )}
280
- />
281
- </AcceptOrRejectOrderStyle>
282
- )}
283
- {_ordersGrouped[k][0]?.status === 3 && _ordersGrouped[k][0]?.delivery_type === 1 &&
284
- (
285
- <AcceptOrRejectOrderStyle>
286
- <OButton
287
- text={t('ORDER_NOT_READY', 'Order not ready')}
288
- bgColor={theme.colors.red}
289
- borderColor={theme.colors.red}
290
- imgRightSrc={null}
291
- style={{ borderRadius: 7, height: 40 }}
292
- parentStyle={{ width: '100%' }}
293
- textStyle={{ color: theme.colors.white, fontSize: 12 }}
294
- onClick={() => onNavigationRedirect('AcceptOrRejectOrder', {
295
- action: 'notReady',
296
- order: _ordersGrouped[k][0],
297
- ids: _ordersGrouped[k].map((o: any) => o.id),
298
- handleChangeOrderStatus
299
- })}
300
- />
301
- </AcceptOrRejectOrderStyle>
302
- )}
228
+ (
229
+ <AcceptOrRejectOrderStyle>
230
+ <OButton
231
+ text={t('ARRIVED_TO_BUSINESS', 'Arrived to bussiness')}
232
+ bgColor={theme.colors.btnBGWhite}
233
+ borderColor={theme.colors.btnBGWhite}
234
+ imgRightSrc={null}
235
+ style={{ borderRadius: 7, height: 40 }}
236
+ parentStyle={{ width: '100%' }}
237
+ textStyle={{ color: theme.colors.primary, fontSize: 12 }}
238
+ onClick={() => handleChangeOrderStatus(
239
+ 3,
240
+ _ordersGrouped[k].map((o: any) => o.id),
241
+ )}
242
+ />
243
+ </AcceptOrRejectOrderStyle>
244
+ )}
245
+ {_ordersGrouped[k][0]?.status === 3 && _ordersGrouped[k][0]?.delivery_type === 1 && !isHideRejectButtons &&
246
+ (
247
+ <AcceptOrRejectOrderStyle>
248
+ <OButton
249
+ text={t('ORDER_NOT_READY', 'Order not ready')}
250
+ bgColor={theme.colors.red}
251
+ borderColor={theme.colors.red}
252
+ imgRightSrc={null}
253
+ style={{ borderRadius: 7, height: 40 }}
254
+ parentStyle={{ width: '100%' }}
255
+ textStyle={{ color: theme.colors.white, fontSize: 12 }}
256
+ onClick={() => onNavigationRedirect('AcceptOrRejectOrder', {
257
+ action: 'notReady',
258
+ order: _ordersGrouped[k][0],
259
+ ids: _ordersGrouped[k].map((o: any) => o.id),
260
+ handleChangeOrderStatus
261
+ })}
262
+ />
263
+ </AcceptOrRejectOrderStyle>
264
+ )}
303
265
  {viewMapStatus.includes(_ordersGrouped[k][0]?.status) &&
304
266
  props.appTitle?.text?.includes('Business') &&
305
- (
306
- <View>
307
- <OButton
308
- text={t('TRACK_REAL_TIME_POSITION', 'Track real time position')}
309
- bgColor={theme.colors.primaryLight}
310
- borderColor={theme.colors.primaryLight}
311
- imgRightSrc={null}
312
- style={{ borderRadius: 7, height: 40 }}
313
- parentStyle={{ width: '100%' }}
314
- textStyle={{ color: theme.colors.primary, fontSize: 12 }}
315
- onClick={() => handleOpenMapView({ orders: _ordersGrouped[k] })}
316
- />
317
- </View>
318
- )}
267
+ (
268
+ <View>
269
+ <OButton
270
+ text={t('TRACK_REAL_TIME_POSITION', 'Track real time position')}
271
+ bgColor={theme.colors.primaryLight}
272
+ borderColor={theme.colors.primaryLight}
273
+ imgRightSrc={null}
274
+ style={{ borderRadius: 7, height: 40 }}
275
+ parentStyle={{ width: '100%' }}
276
+ textStyle={{ color: theme.colors.primary, fontSize: 12 }}
277
+ onClick={() => handleOpenMapView({ orders: _ordersGrouped[k] })}
278
+ />
279
+ </View>
280
+ )}
319
281
  {_ordersGrouped[k][0]?.status === 4 &&
320
282
  ![1].includes(_ordersGrouped[k][0]?.delivery_type) &&
321
- (
322
- <AcceptOrRejectOrderStyle>
323
- <OButton
324
- text={t('ORDER_NOT_PICKEDUP_BY_CUSTOMER', 'Order not picked up by customer')}
325
- bgColor={theme.colors.danger100}
326
- borderColor={theme.colors.danger100}
327
- imgRightSrc={null}
328
- style={{ borderRadius: 7, height: 40, paddingLeft: 10, paddingRight: 10 }}
329
- parentStyle={{ width: '45%' }}
330
- textStyle={{ color: theme.colors.danger500, fontSize: 12, textAlign: 'center' }}
331
- onClick={() => handleChangeOrderStatus(
332
- 17,
333
- _ordersGrouped[k].map((o: any) => o.id),
334
- )}
335
- />
336
- <OButton
337
- text={t('PICKUP_COMPLETED_BY_CUSTOMER', 'Pickup completed by customer')}
338
- bgColor={theme.colors.success100}
339
- borderColor={theme.colors.success100}
340
- imgRightSrc={null}
341
- style={{ borderRadius: 7, height: 40, paddingLeft: 10, paddingRight: 10 }}
342
- parentStyle={{ width: '45%' }}
343
- textStyle={{ color: theme.colors.success500, fontSize: 12, textAlign: 'center' }}
344
- onClick={() => handleChangeOrderStatus(
345
- 15,
346
- _ordersGrouped[k].map((o: any) => o.id),
283
+ (
284
+ <AcceptOrRejectOrderStyle>
285
+ {!isHideRejectButtons && (
286
+ <OButton
287
+ text={t('ORDER_NOT_PICKEDUP_BY_CUSTOMER', 'Order not picked up by customer')}
288
+ bgColor={theme.colors.danger100}
289
+ borderColor={theme.colors.danger100}
290
+ imgRightSrc={null}
291
+ style={{ borderRadius: 7, height: 40, paddingLeft: 10, paddingRight: 10 }}
292
+ parentStyle={{ width: '45%' }}
293
+ textStyle={{ color: theme.colors.danger500, fontSize: 12, textAlign: 'center' }}
294
+ onClick={() => handleChangeOrderStatus(
295
+ 17,
296
+ _ordersGrouped[k].map((o: any) => o.id),
297
+ )}
298
+ />
347
299
  )}
348
- />
349
- </AcceptOrRejectOrderStyle>
350
- )}
300
+ <OButton
301
+ text={t('PICKUP_COMPLETED_BY_CUSTOMER', 'Pickup completed by customer')}
302
+ bgColor={theme.colors.success100}
303
+ borderColor={theme.colors.success100}
304
+ imgRightSrc={null}
305
+ style={{ borderRadius: 7, height: 40, paddingLeft: 10, paddingRight: 10 }}
306
+ parentStyle={{ width: isHideRejectButtons ? '100%' : '45%' }}
307
+ textStyle={{ color: theme.colors.success500, fontSize: 12, textAlign: 'center' }}
308
+ onClick={() => handleChangeOrderStatus(
309
+ 15,
310
+ _ordersGrouped[k].map((o: any) => o.id),
311
+ )}
312
+ />
313
+ </AcceptOrRejectOrderStyle>
314
+ )}
351
315
  {!_ordersGrouped[k][0]?.user_review &&
352
316
  pastOrderStatuses.includes(_ordersGrouped[k][0]?.status) &&
353
- (
354
- <OButton
355
- text={t('REVIEW_CUSTOMER', 'Review customer')}
356
- bgColor={theme.colors.primary}
357
- borderColor={theme.colors.primary}
358
- imgRightSrc={null}
359
- style={{ borderRadius: 8, height: 40 }}
360
- parentStyle={{ width: '100%' }}
361
- textStyle={{ color: theme.colors.white }}
362
- onClick={() => setOpenReviewModal({
363
- order: _ordersGrouped[k][0],
364
- customerId: _ordersGrouped[k][0]?.customer_id,
365
- ids: _ordersGrouped[k].map((o: any) => o.id)
366
- })}
367
- />
368
- )}
369
- {deliveryPickupBtn && deliveryPickupBtn?.includes(_ordersGrouped[k][0]?.status) && (
370
- <AcceptOrRejectOrderStyle>
317
+ (
371
318
  <OButton
372
- text={t('PICKUP_FAILED', 'Pickup failed')}
373
- bgColor={theme.colors.danger100}
374
- borderColor={theme.colors.danger100}
319
+ text={t('REVIEW_CUSTOMER', 'Review customer')}
320
+ bgColor={theme.colors.primary}
321
+ borderColor={theme.colors.primary}
375
322
  imgRightSrc={null}
376
- style={{ borderRadius: 7, height: 40, paddingLeft: 10, paddingRight: 10 }}
377
- parentStyle={{ width: '45%' }}
378
- textStyle={{ color: theme.colors.danger500, fontSize: 12, textAlign: 'center' }}
379
- onClick={() => onNavigationRedirect('AcceptOrRejectOrder', {
380
- action: 'pickupFailed',
323
+ style={{ borderRadius: 8, height: 40 }}
324
+ parentStyle={{ width: '100%' }}
325
+ textStyle={{ color: theme.colors.white }}
326
+ onClick={() => setOpenReviewModal({
381
327
  order: _ordersGrouped[k][0],
382
- ids: _ordersGrouped[k].map((o: any) => o.id),
383
- handleChangeOrderStatus
328
+ customerId: _ordersGrouped[k][0]?.customer_id,
329
+ ids: _ordersGrouped[k].map((o: any) => o.id)
384
330
  })}
385
331
  />
332
+ )}
333
+ {!!deliveryPickupBtn && deliveryPickupBtn?.includes(_ordersGrouped[k][0]?.status) && (
334
+ <AcceptOrRejectOrderStyle>
335
+ {!isHideRejectButtons && (
336
+ <OButton
337
+ text={t('PICKUP_FAILED', 'Pickup failed')}
338
+ bgColor={theme.colors.danger100}
339
+ borderColor={theme.colors.danger100}
340
+ imgRightSrc={null}
341
+ style={{ borderRadius: 7, height: 40, paddingLeft: 10, paddingRight: 10 }}
342
+ parentStyle={{ width: '45%' }}
343
+ textStyle={{ color: theme.colors.danger500, fontSize: 12, textAlign: 'center' }}
344
+ onClick={() => onNavigationRedirect('AcceptOrRejectOrder', {
345
+ action: 'pickupFailed',
346
+ order: _ordersGrouped[k][0],
347
+ ids: _ordersGrouped[k].map((o: any) => o.id),
348
+ handleChangeOrderStatus
349
+ })}
350
+ />
351
+ )}
386
352
  <OButton
387
353
  text={t('PICKUP_COMPLETE', 'Pickup complete')}
388
354
  bgColor={theme.colors.success100}
389
355
  borderColor={theme.colors.success100}
390
356
  imgRightSrc={null}
391
357
  style={{ borderRadius: 7, height: 40, paddingLeft: 10, paddingRight: 10 }}
392
- parentStyle={{ width: '45%' }}
358
+ parentStyle={{ width: isHideRejectButtons ? '100%' : '45%' }}
393
359
  textStyle={{ color: theme.colors.success500, fontSize: 12, textAlign: 'center' }}
394
360
  onClick={() => handleChangeOrderStatus(
395
361
  9,
@@ -398,30 +364,32 @@ export const PreviousOrders = (props: any) => {
398
364
  />
399
365
  </AcceptOrRejectOrderStyle>
400
366
  )}
401
- {deliveryStatusCompleteBtn && deliveryStatusCompleteBtn.includes(_ordersGrouped[k][0]?.status) && (
367
+ {!!deliveryStatusCompleteBtn && deliveryStatusCompleteBtn.includes(_ordersGrouped[k][0]?.status) && (
402
368
  <AcceptOrRejectOrderStyle>
403
- <OButton
404
- text={t('DELIVERY_FAILED', 'Delivery Failed')}
405
- bgColor={theme.colors.danger100}
406
- borderColor={theme.colors.danger100}
407
- imgRightSrc={null}
408
- style={{ borderRadius: 7, height: 40, paddingLeft: 10, paddingRight: 10 }}
409
- parentStyle={{ width: '45%' }}
410
- textStyle={{ color: theme.colors.danger500, fontSize: 12, textAlign: 'center' }}
411
- onClick={() => onNavigationRedirect('AcceptOrRejectOrder', {
412
- action: 'deliveryFailed',
413
- order: _ordersGrouped[k][0],
414
- ids: _ordersGrouped[k].map((o: any) => o.id),
415
- handleChangeOrderStatus
416
- })}
417
- />
369
+ {!isHideRejectButtons && (
370
+ <OButton
371
+ text={t('DELIVERY_FAILED', 'Delivery Failed')}
372
+ bgColor={theme.colors.danger100}
373
+ borderColor={theme.colors.danger100}
374
+ imgRightSrc={null}
375
+ style={{ borderRadius: 7, height: 40, paddingLeft: 10, paddingRight: 10 }}
376
+ parentStyle={{ width: '45%' }}
377
+ textStyle={{ color: theme.colors.danger500, fontSize: 12, textAlign: 'center' }}
378
+ onClick={() => onNavigationRedirect('AcceptOrRejectOrder', {
379
+ action: 'deliveryFailed',
380
+ order: _ordersGrouped[k][0],
381
+ ids: _ordersGrouped[k].map((o: any) => o.id),
382
+ handleChangeOrderStatus
383
+ })}
384
+ />
385
+ )}
418
386
  <OButton
419
387
  text={t('DELIVERY_COMPLETE', 'Delivery complete')}
420
388
  bgColor={theme.colors.success100}
421
389
  borderColor={theme.colors.success100}
422
390
  imgRightSrc={null}
423
391
  style={{ borderRadius: 7, height: 40, paddingLeft: 10, paddingRight: 10 }}
424
- parentStyle={{ width: '45%' }}
392
+ parentStyle={{ width: isHideRejectButtons ? '100%' : '45%' }}
425
393
  textStyle={{ color: theme.colors.success500, fontSize: 12, textAlign: 'center' }}
426
394
  onClick={() => handleChangeOrderStatus(
427
395
  11,
@@ -435,7 +403,16 @@ export const PreviousOrders = (props: any) => {
435
403
  </View>
436
404
  ) : (
437
405
  <View key={order.id}>
438
- <OrdersList order={order} _order={_order} />
406
+ <OrdersList
407
+ order={order}
408
+ _order={_order}
409
+ currentOrdenSelected={currentOrdenSelected}
410
+ isLogisticOrder={isLogisticOrder}
411
+ handlePressOrder={handlePressOrder}
412
+ currentTabSelected={currentTabSelected}
413
+ getOrderStatus={getOrderStatus}
414
+ handleClickLogisticOrder={handleClickLogisticOrder}
415
+ />
439
416
  </View>
440
417
  )
441
418
  )
@@ -3,6 +3,10 @@ import { View, Animated, TouchableOpacity } from 'react-native';
3
3
  import MaterialCommunityIcon from 'react-native-vector-icons/MaterialCommunityIcons';
4
4
  import { useUtils, useLanguage } from 'ordering-components/native';
5
5
  import { useTheme } from 'styled-components/native';
6
+ import { DeviceOrientationMethods } from '../../../../../src/hooks/DeviceOrientation'
7
+
8
+ const { useDeviceOrientation } = DeviceOrientationMethods
9
+
6
10
  import {
7
11
  Accordion,
8
12
  AccordionSection,
@@ -34,6 +38,8 @@ export const ProductItemAccordion = (props: ProductItemAccordionParams) => {
34
38
  const [, t] = useLanguage();
35
39
  const theme = useTheme();
36
40
  const [{ parsePrice }] = useUtils();
41
+ const [orientationState] = useDeviceOrientation();
42
+ const WIDTH_SCREEN = orientationState?.dimensions?.width
37
43
 
38
44
  const [isActive, setActiveState] = useState(false);
39
45
  const [isReadMore, setIsReadMore] = useState(false);
@@ -111,7 +117,7 @@ export const ProductItemAccordion = (props: ProductItemAccordionParams) => {
111
117
  }, []);
112
118
 
113
119
  const onTextLayout = useCallback((e: any) => {
114
- setLengthMore(e.nativeEvent.lines.length >= 3); //to check the text is more than 2 lines or not
120
+ setLengthMore((e.nativeEvent.lines.length == 2 && e.nativeEvent.lines[1].width > WIDTH_SCREEN * .76) || e.nativeEvent.lines.length > 2); //to check the text is more than 2 lines or not
115
121
  },[]);
116
122
 
117
123
  return (
@@ -1,3 +1,5 @@
1
+
2
+
1
3
  import React, { useState, useEffect, useRef } from 'react'
2
4
  import {
3
5
  useLanguage,
@@ -86,6 +88,18 @@ const ReviewCustomerUI = (props: ReviewCustomerParams) => {
86
88
  marginBottom: 10,
87
89
  backgroundColor: theme.colors.lightGray
88
90
  },
91
+ btnBackArrow: {
92
+ borderWidth: 0,
93
+ width: 32,
94
+ height: 32,
95
+ tintColor: theme.colors.textGray,
96
+ backgroundColor: theme.colors.clear,
97
+ borderColor: theme.colors.clear,
98
+ shadowColor: theme.colors.clear,
99
+ paddingLeft: 0,
100
+ paddingRight: 0,
101
+ marginBottom: 20
102
+ },
89
103
  inputTextArea: {
90
104
  borderColor: theme.colors.lightGray,
91
105
  borderRadius: 8,
@@ -147,7 +161,7 @@ const ReviewCustomerUI = (props: ReviewCustomerParams) => {
147
161
  useEffect(() => {
148
162
  if (scrollref?.current) {
149
163
  Keyboard.addListener('keyboardDidShow', () => {
150
- scrollref.current.scrollToEnd()
164
+ scrollref?.current?.scrollToEnd && scrollref.current.scrollToEnd()
151
165
  })
152
166
  }
153
167
  }, [scrollref?.current])
@@ -177,18 +191,9 @@ const ReviewCustomerUI = (props: ReviewCustomerParams) => {
177
191
  }}
178
192
  >
179
193
  <View>
180
- <OIconButton
181
- icon={theme.images.general.arrow_left}
182
- borderColor={theme.colors.clear}
183
- iconStyle={{ width: 20, height: 16 }}
184
- style={{
185
- maxWidth: 40,
186
- height: 20,
187
- justifyContent: 'flex-end',
188
- marginBottom: 20,
189
- }}
190
- onClick={() => closeModal()}
191
- />
194
+ <TouchableOpacity onPress={() => closeModal()} style={styles.btnBackArrow}>
195
+ <OIcon src={theme.images.general.arrow_left} color={theme.colors.textGray} />
196
+ </TouchableOpacity>
192
197
  <OText
193
198
  size={20}
194
199
  weight="600"
@@ -1,6 +1,5 @@
1
1
  import React, { useEffect, useState } from 'react';
2
- import { View, StyleSheet, Dimensions, Linking } from 'react-native';
3
- import { ScrollView, TouchableOpacity } from 'react-native-gesture-handler';
2
+ import { View, StyleSheet, Dimensions, Linking, ScrollView, TouchableOpacity } from 'react-native';
4
3
  import { Placeholder, PlaceholderLine, Fade } from 'rn-placeholder';
5
4
  import NetInfo from '@react-native-community/netinfo';
6
5
  import { useTheme } from 'styled-components/native';
@@ -149,10 +148,10 @@ const StoresListUI = (props: BusinessesListingParams) => {
149
148
  width={12}
150
149
  height={12}
151
150
  color={theme.colors.skyBlue}
152
- style={{ marginRight: 5, marginTop: 3 }}
151
+ style={{ marginRight: 5 }}
153
152
  />
154
153
  <OText size={12}>
155
- {t('MORE_SETTINGS_GO_TO', 'For more settings go to')}{' '}
154
+ {t('MORE_SETTINGS_GO_TO', 'For more settings go to ')}
156
155
  </OText>
157
156
  <TouchableOpacity onPress={() => { Linking.openURL(t('LINK_MORE_SETTINGS_GO_TO', 'https://app.ordering.co')) }}>
158
157
  <OText size={12} color={theme.colors.skyBlue}>