ordering-ui-react-native 0.17.73 → 0.17.74-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 (231) 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 +1 -21
  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 +28 -25
  15. package/themes/business/src/components/BusinessController/index.tsx +0 -1
  16. package/themes/business/src/components/Chat/index.tsx +149 -118
  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/GoogleMap/index.tsx +58 -57
  20. package/themes/business/src/components/LoginForm/Otp/index.tsx +31 -3
  21. package/themes/business/src/components/LoginForm/index.tsx +15 -22
  22. package/themes/business/src/components/MapView/index.tsx +10 -10
  23. package/themes/business/src/components/MessagesOption/index.tsx +20 -93
  24. package/themes/business/src/components/NewOrderNotification/index.tsx +37 -21
  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 +191 -6
  28. package/themes/business/src/components/OrderDetails/OrderContentComponent.tsx +103 -39
  29. package/themes/business/src/components/OrderDetails/OrderHeaderComponent.tsx +61 -60
  30. package/themes/business/src/components/OrderDetailsLogistic/index.tsx +195 -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 +17 -15
  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 +88 -0
  39. package/themes/business/src/components/PreviousOrders/OrdersGroupedItem.tsx +1 -1
  40. package/themes/business/src/components/PreviousOrders/index.tsx +139 -174
  41. package/themes/business/src/components/ProductItemAccordion/index.tsx +27 -3
  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/OLink.tsx +11 -3
  46. package/themes/business/src/components/shared/OModal.tsx +16 -9
  47. package/themes/business/src/components/shared/OText.tsx +6 -1
  48. package/themes/business/src/types/index.tsx +25 -10
  49. package/themes/business/src/utils/index.tsx +29 -2
  50. package/themes/doordash/src/components/BusinessesListing/index.tsx +1 -1
  51. package/themes/doordash/src/components/LoginForm/index.tsx +1 -2
  52. package/themes/instacart/src/components/BusinessesListing/index.tsx +1 -1
  53. package/themes/kiosk/src/components/Checkout/index.tsx +6 -0
  54. package/themes/kiosk/src/components/Intro/index.tsx +16 -1
  55. package/themes/kiosk/src/components/LoginForm/index.tsx +7 -9
  56. package/themes/kiosk/src/components/NavBar/index.tsx +14 -14
  57. package/themes/kiosk/src/components/OptionCard/index.tsx +1 -1
  58. package/themes/kiosk/src/components/OrderTypeCardSelector/index.tsx +8 -10
  59. package/themes/kiosk/src/components/PhoneInputNumber/index.tsx +2 -2
  60. package/themes/kiosk/src/components/shared/OButton.tsx +5 -18
  61. package/themes/original/index.tsx +1 -1
  62. package/themes/original/src/components/AddressDetails/index.tsx +19 -3
  63. package/themes/original/src/components/AddressForm/index.tsx +61 -39
  64. package/themes/original/src/components/AddressList/index.tsx +25 -24
  65. package/themes/original/src/components/AddressList/styles.tsx +4 -2
  66. package/themes/original/src/components/AnalyticsSegment/index.tsx +193 -10
  67. package/themes/original/src/components/AppleLogin/index.tsx +4 -4
  68. package/themes/original/src/components/AppleLogin/styles.tsx +3 -1
  69. package/themes/original/src/components/BusinessBasicInformation/index.tsx +153 -96
  70. package/themes/original/src/components/BusinessBasicInformation/styles.tsx +10 -12
  71. package/themes/original/src/components/BusinessController/index.tsx +80 -66
  72. package/themes/original/src/components/BusinessController/styles.tsx +12 -5
  73. package/themes/original/src/components/BusinessFeaturedController/index.tsx +21 -54
  74. package/themes/original/src/components/BusinessFeaturedController/styles.tsx +8 -0
  75. package/themes/original/src/components/BusinessInformation/index.tsx +139 -85
  76. package/themes/original/src/components/BusinessItemAccordion/index.tsx +15 -20
  77. package/themes/original/src/components/BusinessListingSearch/index.tsx +349 -339
  78. package/themes/original/src/components/BusinessListingSearch/styles.tsx +0 -18
  79. package/themes/original/src/components/BusinessPreorder/index.tsx +103 -19
  80. package/themes/original/src/components/BusinessProductsCategories/index.tsx +1 -2
  81. package/themes/original/src/components/BusinessProductsList/index.tsx +15 -7
  82. package/themes/original/src/components/BusinessProductsList/styles.tsx +8 -3
  83. package/themes/original/src/components/BusinessProductsListing/UpsellingRedirect.tsx +1 -1
  84. package/themes/original/src/components/BusinessProductsListing/index.tsx +684 -557
  85. package/themes/original/src/components/BusinessProductsListing/styles.tsx +2 -2
  86. package/themes/original/src/components/BusinessReviews/index.tsx +3 -1
  87. package/themes/original/src/components/BusinessesListing/Layout/Original/index.tsx +69 -38
  88. package/themes/original/src/components/BusinessesListing/Layout/Original/styles.tsx +0 -1
  89. package/themes/original/src/components/BusinessesListing/index.tsx +0 -1
  90. package/themes/original/src/components/Cart/index.tsx +76 -79
  91. package/themes/original/src/components/CartContent/index.tsx +117 -20
  92. package/themes/original/src/components/CartContent/styles.tsx +17 -7
  93. package/themes/original/src/components/Checkout/index.tsx +274 -54
  94. package/themes/original/src/components/CitiesControl/index.tsx +1 -1
  95. package/themes/original/src/components/CouponControl/index.tsx +10 -3
  96. package/themes/original/src/components/DriverTips/index.tsx +52 -34
  97. package/themes/original/src/components/FacebookLogin/styles.tsx +3 -1
  98. package/themes/original/src/components/Favorite/index.tsx +2 -6
  99. package/themes/original/src/components/FavoriteList/index.tsx +1 -35
  100. package/themes/original/src/components/FloatingButton/index.tsx +10 -13
  101. package/themes/original/src/components/GPSButton/index.tsx +6 -4
  102. package/themes/original/src/components/GiftCard/PurchaseGiftCard/index.tsx +7 -3
  103. package/themes/original/src/components/GiftCard/PurchaseGiftCard/styles.tsx +2 -0
  104. package/themes/original/src/components/GiftCard/RedeemGiftCard/index.tsx +19 -6
  105. package/themes/original/src/components/GoogleLogin/styles.tsx +1 -1
  106. package/themes/original/src/components/GoogleMap/index.tsx +60 -5
  107. package/themes/original/src/components/Help/index.tsx +2 -2
  108. package/themes/original/src/components/HelpAccountAndPayment/index.tsx +10 -31
  109. package/themes/original/src/components/HelpAccountAndPayment/styles.tsx +5 -3
  110. package/themes/original/src/components/HelpGuide/index.tsx +6 -6
  111. package/themes/original/src/components/HelpGuide/styles.tsx +6 -0
  112. package/themes/original/src/components/HelpOrder/index.tsx +6 -15
  113. package/themes/original/src/components/HelpOrder/styles.tsx +8 -1
  114. package/themes/original/src/components/Home/index.tsx +13 -4
  115. package/themes/original/src/components/LastOrder/index.tsx +1 -34
  116. package/themes/original/src/components/LoginForm/Otp/index.tsx +91 -25
  117. package/themes/original/src/components/LoginForm/index.tsx +64 -34
  118. package/themes/original/src/components/LottieAnimation/index.tsx +88 -63
  119. package/themes/original/src/components/MessageListing/index.tsx +16 -42
  120. package/themes/original/src/components/Messages/index.tsx +14 -7
  121. package/themes/original/src/components/MomentOption/index.tsx +193 -90
  122. package/themes/original/src/components/MomentSelector/index.tsx +1 -1
  123. package/themes/original/src/components/MultiCart/index.tsx +41 -54
  124. package/themes/original/src/components/MultiCartsPaymethodsAndWallets/index.tsx +162 -50
  125. package/themes/original/src/components/MultiCheckout/index.tsx +329 -100
  126. package/themes/original/src/components/MultiCheckout/styles.tsx +3 -1
  127. package/themes/original/src/components/MultiOrdersDetails/SingleOrderCard.tsx +37 -224
  128. package/themes/original/src/components/MultiOrdersDetails/index.tsx +54 -21
  129. package/themes/original/src/components/MultiOrdersDetails/styles.tsx +1 -1
  130. package/themes/original/src/components/MyOrders/index.tsx +40 -29
  131. package/themes/original/src/components/NavBar/index.tsx +20 -17
  132. package/themes/original/src/components/NotFoundSource/index.tsx +14 -10
  133. package/themes/original/src/components/Notifications/index.tsx +42 -52
  134. package/themes/original/src/components/Notifications/styles.tsx +6 -3
  135. package/themes/original/src/components/OrderDetails/OrderEta.tsx +76 -0
  136. package/themes/original/src/components/OrderDetails/OrderHistory.tsx +21 -5
  137. package/themes/original/src/components/OrderDetails/index.tsx +28 -233
  138. package/themes/original/src/components/OrderDetails/styles.tsx +0 -1
  139. package/themes/original/src/components/OrderItAgain/index.tsx +3 -1
  140. package/themes/original/src/components/OrderProgress/index.tsx +30 -56
  141. package/themes/original/src/components/OrderSummary/index.tsx +83 -57
  142. package/themes/original/src/components/OrderTypeSelector/index.tsx +2 -1
  143. package/themes/original/src/components/OrdersOption/PreviousProductsOrdered/index.tsx +14 -14
  144. package/themes/original/src/components/OrdersOption/index.tsx +67 -85
  145. package/themes/original/src/components/OrdersOption/styles.tsx +1 -1
  146. package/themes/original/src/components/PageBanner/index.tsx +98 -38
  147. package/themes/original/src/components/PageBanner/styles.tsx +0 -10
  148. package/themes/original/src/components/PaymentOptionCard/index.tsx +180 -0
  149. package/themes/original/src/components/PaymentOptionStripe/styles.tsx +1 -1
  150. package/themes/original/src/components/PaymentOptionWallet/index.tsx +56 -56
  151. package/themes/original/src/components/PaymentOptions/index.tsx +77 -34
  152. package/themes/original/src/components/PhoneInputNumber/index.tsx +18 -4
  153. package/themes/original/src/components/ProductForm/index.tsx +104 -29
  154. package/themes/original/src/components/ProductForm/styles.tsx +5 -5
  155. package/themes/original/src/components/ProductItemAccordion/index.tsx +8 -6
  156. package/themes/original/src/components/ProductOptionSubOption/index.tsx +20 -18
  157. package/themes/original/src/components/ProductOptionSubOption/styles.tsx +5 -9
  158. package/themes/original/src/components/ProfessionalFilter/SingleProfessionalCard/index.tsx +108 -0
  159. package/themes/original/src/components/ProfessionalFilter/index.tsx +20 -50
  160. package/themes/original/src/components/ProfessionalProfile/index.tsx +36 -7
  161. package/themes/original/src/components/Promotions/index.tsx +2 -2
  162. package/themes/original/src/components/Promotions/styles.tsx +3 -1
  163. package/themes/original/src/components/ReviewProducts/index.tsx +16 -7
  164. package/themes/original/src/components/ScheduleAccordion/index.tsx +3 -3
  165. package/themes/original/src/components/ServiceForm/index.tsx +63 -20
  166. package/themes/original/src/components/Sessions/index.tsx +11 -8
  167. package/themes/original/src/components/Sessions/styles.tsx +5 -0
  168. package/themes/original/src/components/SignupForm/index.tsx +43 -27
  169. package/themes/original/src/components/SingleOrderCard/index.tsx +102 -63
  170. package/themes/original/src/components/SingleOrderCard/styles.tsx +1 -1
  171. package/themes/original/src/components/SingleProductCard/index.tsx +72 -31
  172. package/themes/original/src/components/SingleProductCard/styles.tsx +20 -4
  173. package/themes/original/src/components/SingleProductReview/styles.tsx +1 -1
  174. package/themes/original/src/components/StripeCardsList/index.tsx +49 -5
  175. package/themes/original/src/components/StripeElementsForm/index.tsx +48 -34
  176. package/themes/original/src/components/StripeElementsForm/naked.tsx +12 -1
  177. package/themes/original/src/components/UpsellingProducts/index.tsx +238 -224
  178. package/themes/original/src/components/UpsellingProducts/styles.tsx +12 -1
  179. package/themes/original/src/components/UserDetails/index.tsx +3 -1
  180. package/themes/original/src/components/UserFormDetails/index.tsx +76 -7
  181. package/themes/original/src/components/UserFormDetails/styles.tsx +1 -1
  182. package/themes/original/src/components/UserProfile/index.tsx +88 -79
  183. package/themes/original/src/components/UserProfileForm/index.tsx +17 -21
  184. package/themes/original/src/components/UserProfileForm/styles.tsx +7 -0
  185. package/themes/original/src/components/UserVerification/index.tsx +55 -50
  186. package/themes/original/src/components/WalletTransactionItem/index.tsx +2 -2
  187. package/themes/original/src/components/WalletTransactions/index.tsx +3 -3
  188. package/themes/original/src/components/Wallets/index.tsx +56 -33
  189. package/themes/original/src/components/Wallets/styles.tsx +3 -4
  190. package/themes/original/src/components/shared/OButton.tsx +6 -2
  191. package/themes/original/src/components/shared/OInput.tsx +6 -1
  192. package/themes/original/src/components/shared/OModal.tsx +3 -3
  193. package/themes/original/src/types/index.tsx +38 -10
  194. package/themes/original/src/utils/index.tsx +273 -1
  195. package/themes/uber-eats/src/components/BusinessesListing/index.tsx +1 -1
  196. package/src/navigators/BottomNavigator.tsx +0 -117
  197. package/src/navigators/CheckoutNavigator.tsx +0 -66
  198. package/src/navigators/HomeNavigator.tsx +0 -202
  199. package/src/navigators/NavigationRef.tsx +0 -7
  200. package/src/navigators/RootNavigator.tsx +0 -269
  201. package/src/pages/Account.tsx +0 -34
  202. package/src/pages/AddressForm.tsx +0 -62
  203. package/src/pages/AddressList.tsx +0 -24
  204. package/src/pages/BusinessProductsList.tsx +0 -81
  205. package/src/pages/BusinessesListing.tsx +0 -43
  206. package/src/pages/CartList.tsx +0 -49
  207. package/src/pages/Checkout.tsx +0 -101
  208. package/src/pages/ForgotPassword.tsx +0 -24
  209. package/src/pages/Help.tsx +0 -23
  210. package/src/pages/HelpAccountAndPayment.tsx +0 -23
  211. package/src/pages/HelpGuide.tsx +0 -23
  212. package/src/pages/HelpOrder.tsx +0 -23
  213. package/src/pages/Home.tsx +0 -36
  214. package/src/pages/IntroductoryTutorial.tsx +0 -170
  215. package/src/pages/Login.tsx +0 -47
  216. package/src/pages/MomentOption.tsx +0 -30
  217. package/src/pages/MultiCheckout.tsx +0 -31
  218. package/src/pages/MultiOrdersDetails.tsx +0 -27
  219. package/src/pages/MyOrders.tsx +0 -40
  220. package/src/pages/NetworkError.tsx +0 -24
  221. package/src/pages/NotFound.tsx +0 -22
  222. package/src/pages/OrderDetails.tsx +0 -25
  223. package/src/pages/ProductDetails.tsx +0 -55
  224. package/src/pages/Profile.tsx +0 -36
  225. package/src/pages/ReviewDriver.tsx +0 -30
  226. package/src/pages/ReviewOrder.tsx +0 -32
  227. package/src/pages/ReviewProducts.tsx +0 -30
  228. package/src/pages/Sessions.tsx +0 -22
  229. package/src/pages/Signup.tsx +0 -53
  230. package/src/pages/SpinnerLoader.tsx +0 -10
  231. package/src/pages/Splash.tsx +0 -21
@@ -3,11 +3,11 @@ import { View } from 'react-native';
3
3
  import { useTheme } from 'styled-components/native';
4
4
  import { useLanguage } 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';
@@ -31,7 +31,7 @@ export const PreviousOrders = (props: any) => {
31
31
  const [, t] = useLanguage();
32
32
  const theme = useTheme();
33
33
 
34
- const [, setCurrentTime] = useState()
34
+ // const [, setCurrentTime] = useState()
35
35
  const [openModal, setOpenModal] = useState(false)
36
36
  const [openReviewModal, setOpenReviewModal] = useState({ order: null, ids: [], customerId: null })
37
37
  const [openMapViewModal, setOpenMapViewModal] = useState<any>({ open: false, customerLocation: null, locations: [] })
@@ -48,78 +48,23 @@ export const PreviousOrders = (props: any) => {
48
48
  if (props.handleClickEvent) {
49
49
  props.handleClickEvent({ ...order, isLogistic: isLogisticOrder })
50
50
  } else {
51
- onNavigationRedirect &&
52
- onNavigationRedirect('OrderDetails', { order: { ...order, isLogistic: isLogisticOrder }, handleClickLogisticOrder });
51
+ if (isLogisticOrder) {
52
+ onNavigationRedirect &&
53
+ onNavigationRedirect('OrderDetailsLogistic', { order: { ...order, isLogistic: isLogisticOrder }, handleClickLogisticOrder });
54
+ } else {
55
+ onNavigationRedirect &&
56
+ onNavigationRedirect('OrderDetails', { order });
57
+ }
53
58
  }
54
59
  };
55
60
 
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
61
  const ordersGroupAction = (param1 = '', param2 = '', { order, action, body, ids }: any = {}) => {
117
62
  setOrderUpdateStatus({ ...orderUpdateStatus, action, ids, body, order })
118
63
  if (!param1) setOpenModal(true)
119
64
  if (param1) {
120
65
  setOpenModal(false)
121
66
  handleChangeOrderStatus &&
122
- handleChangeOrderStatus(param1, orderUpdateStatus.ids, param2)
67
+ handleChangeOrderStatus(param1, orderUpdateStatus.ids, param2)
123
68
  }
124
69
  }
125
70
 
@@ -154,7 +99,7 @@ export const PreviousOrders = (props: any) => {
154
99
  if (_order?.customer?.location) {
155
100
  locations.push({
156
101
  ..._order?.customer?.location,
157
- title: _order?.customer?.name ?? t('CUSTOMER', 'Customer'),
102
+ title: _order?.customer?.name ?? t('CUSTOMER', 'Customer'),
158
103
  address: {
159
104
  addressName: _order?.customer?.address,
160
105
  zipcode: _order?.customer?.zipcode
@@ -175,14 +120,14 @@ export const PreviousOrders = (props: any) => {
175
120
  })
176
121
  }
177
122
 
178
- useEffect(() => {
179
- const interval = setInterval(() => {
180
- const date: any = Date.now()
181
- setCurrentTime(date)
182
- }, slaSettingTime ?? 6000)
123
+ // useEffect(() => {
124
+ // const interval = setInterval(() => {
125
+ // const date: any = Date.now()
126
+ // setCurrentTime(date)
127
+ // }, slaSettingTime ?? 6000)
183
128
 
184
- return () => clearInterval(interval)
185
- }, [])
129
+ // return () => clearInterval(interval)
130
+ // }, [])
186
131
 
187
132
 
188
133
  return (
@@ -205,10 +150,21 @@ export const PreviousOrders = (props: any) => {
205
150
  ?.map((_order: any) => {
206
151
  const order_ = _order?.isLogistic && !_order?.order_group && isLogisticOrder ? _order?.order : _order
207
152
  return (
208
- <OrdersList key={order_.id} order={order_} _order={_order} hideBtns />
153
+ <OrdersList
154
+ key={order_.id}
155
+ order={order_}
156
+ _order={_order}
157
+ hideBtns
158
+ currentOrdenSelected={currentOrdenSelected}
159
+ isLogisticOrder={isLogisticOrder}
160
+ handlePressOrder={handlePressOrder}
161
+ currentTabSelected={currentTabSelected}
162
+ getOrderStatus={getOrderStatus}
163
+ handleClickLogisticOrder={handleClickLogisticOrder}
164
+ />
209
165
  )
210
166
  }
211
- )
167
+ )
212
168
  }
213
169
  {_ordersGrouped[k][0]?.status === 0 && (
214
170
  <AcceptOrRejectOrderStyle>
@@ -263,110 +219,110 @@ export const PreviousOrders = (props: any) => {
263
219
  )}
264
220
  {(_ordersGrouped[k][0]?.status === 8 || _ordersGrouped[k][0]?.status === 18) &&
265
221
  _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
- )}
222
+ (
223
+ <AcceptOrRejectOrderStyle>
224
+ <OButton
225
+ text={t('ARRIVED_TO_BUSINESS', 'Arrived to bussiness')}
226
+ bgColor={theme.colors.btnBGWhite}
227
+ borderColor={theme.colors.btnBGWhite}
228
+ imgRightSrc={null}
229
+ style={{ borderRadius: 7, height: 40 }}
230
+ parentStyle={{ width: '100%' }}
231
+ textStyle={{ color: theme.colors.primary, fontSize: 12 }}
232
+ onClick={() => handleChangeOrderStatus(
233
+ 3,
234
+ _ordersGrouped[k].map((o: any) => o.id),
235
+ )}
236
+ />
237
+ </AcceptOrRejectOrderStyle>
238
+ )}
283
239
  {_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
- )}
240
+ (
241
+ <AcceptOrRejectOrderStyle>
242
+ <OButton
243
+ text={t('ORDER_NOT_READY', 'Order not ready')}
244
+ bgColor={theme.colors.red}
245
+ borderColor={theme.colors.red}
246
+ imgRightSrc={null}
247
+ style={{ borderRadius: 7, height: 40 }}
248
+ parentStyle={{ width: '100%' }}
249
+ textStyle={{ color: theme.colors.white, fontSize: 12 }}
250
+ onClick={() => onNavigationRedirect('AcceptOrRejectOrder', {
251
+ action: 'notReady',
252
+ order: _ordersGrouped[k][0],
253
+ ids: _ordersGrouped[k].map((o: any) => o.id),
254
+ handleChangeOrderStatus
255
+ })}
256
+ />
257
+ </AcceptOrRejectOrderStyle>
258
+ )}
303
259
  {viewMapStatus.includes(_ordersGrouped[k][0]?.status) &&
304
260
  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
- )}
261
+ (
262
+ <View>
263
+ <OButton
264
+ text={t('TRACK_REAL_TIME_POSITION', 'Track real time position')}
265
+ bgColor={theme.colors.primaryLight}
266
+ borderColor={theme.colors.primaryLight}
267
+ imgRightSrc={null}
268
+ style={{ borderRadius: 7, height: 40 }}
269
+ parentStyle={{ width: '100%' }}
270
+ textStyle={{ color: theme.colors.primary, fontSize: 12 }}
271
+ onClick={() => handleOpenMapView({ orders: _ordersGrouped[k] })}
272
+ />
273
+ </View>
274
+ )}
319
275
  {_ordersGrouped[k][0]?.status === 4 &&
320
276
  ![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
- />
277
+ (
278
+ <AcceptOrRejectOrderStyle>
279
+ <OButton
280
+ text={t('ORDER_NOT_PICKEDUP_BY_CUSTOMER', 'Order not picked up by customer')}
281
+ bgColor={theme.colors.danger100}
282
+ borderColor={theme.colors.danger100}
283
+ imgRightSrc={null}
284
+ style={{ borderRadius: 7, height: 40, paddingLeft: 10, paddingRight: 10 }}
285
+ parentStyle={{ width: '45%' }}
286
+ textStyle={{ color: theme.colors.danger500, fontSize: 12, textAlign: 'center' }}
287
+ onClick={() => handleChangeOrderStatus(
288
+ 17,
289
+ _ordersGrouped[k].map((o: any) => o.id),
290
+ )}
291
+ />
292
+ <OButton
293
+ text={t('PICKUP_COMPLETED_BY_CUSTOMER', 'Pickup completed by customer')}
294
+ bgColor={theme.colors.success100}
295
+ borderColor={theme.colors.success100}
296
+ imgRightSrc={null}
297
+ style={{ borderRadius: 7, height: 40, paddingLeft: 10, paddingRight: 10 }}
298
+ parentStyle={{ width: '45%' }}
299
+ textStyle={{ color: theme.colors.success500, fontSize: 12, textAlign: 'center' }}
300
+ onClick={() => handleChangeOrderStatus(
301
+ 15,
302
+ _ordersGrouped[k].map((o: any) => o.id),
303
+ )}
304
+ />
305
+ </AcceptOrRejectOrderStyle>
306
+ )}
307
+ {!_ordersGrouped[k][0]?.user_review &&
308
+ pastOrderStatuses.includes(_ordersGrouped[k][0]?.status) &&
309
+ (
336
310
  <OButton
337
- text={t('PICKUP_COMPLETED_BY_CUSTOMER', 'Pickup completed by customer')}
338
- bgColor={theme.colors.success100}
339
- borderColor={theme.colors.success100}
311
+ text={t('REVIEW_CUSTOMER', 'Review customer')}
312
+ bgColor={theme.colors.primary}
313
+ borderColor={theme.colors.primary}
340
314
  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),
347
- )}
315
+ style={{ borderRadius: 8, height: 40 }}
316
+ parentStyle={{ width: '100%' }}
317
+ textStyle={{ color: theme.colors.white }}
318
+ onClick={() => setOpenReviewModal({
319
+ order: _ordersGrouped[k][0],
320
+ customerId: _ordersGrouped[k][0]?.customer_id,
321
+ ids: _ordersGrouped[k].map((o: any) => o.id)
322
+ })}
348
323
  />
349
- </AcceptOrRejectOrderStyle>
350
- )}
351
- {!_ordersGrouped[k][0]?.user_review &&
352
- 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?.includes(_ordersGrouped[k][0]?.status) && (
324
+ )}
325
+ {!!deliveryPickupBtn && deliveryPickupBtn?.includes(_ordersGrouped[k][0]?.status) && (
370
326
  <AcceptOrRejectOrderStyle>
371
327
  <OButton
372
328
  text={t('PICKUP_FAILED', 'Pickup failed')}
@@ -398,7 +354,7 @@ export const PreviousOrders = (props: any) => {
398
354
  />
399
355
  </AcceptOrRejectOrderStyle>
400
356
  )}
401
- {deliveryStatusCompleteBtn.includes(_ordersGrouped[k][0]?.status) && (
357
+ {!!deliveryStatusCompleteBtn && deliveryStatusCompleteBtn.includes(_ordersGrouped[k][0]?.status) && (
402
358
  <AcceptOrRejectOrderStyle>
403
359
  <OButton
404
360
  text={t('DELIVERY_FAILED', 'Delivery Failed')}
@@ -435,7 +391,16 @@ export const PreviousOrders = (props: any) => {
435
391
  </View>
436
392
  ) : (
437
393
  <View key={order.id}>
438
- <OrdersList order={order} _order={_order} />
394
+ <OrdersList
395
+ order={order}
396
+ _order={_order}
397
+ currentOrdenSelected={currentOrdenSelected}
398
+ isLogisticOrder={isLogisticOrder}
399
+ handlePressOrder={handlePressOrder}
400
+ currentTabSelected={currentTabSelected}
401
+ getOrderStatus={getOrderStatus}
402
+ handleClickLogisticOrder={handleClickLogisticOrder}
403
+ />
439
404
  </View>
440
405
  )
441
406
  )
@@ -1,8 +1,12 @@
1
- import React, { useEffect, useState } from 'react';
2
- import { View, Animated } from 'react-native';
1
+ import React, { useEffect, useState, useCallback } from 'react';
2
+ 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,8 +38,12 @@ 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);
45
+ const [isReadMore, setIsReadMore] = useState(false);
46
+ const [lengthMore, setLengthMore] = useState(false);
39
47
 
40
48
  const productInfo = () => {
41
49
  if (isCartProduct) {
@@ -108,6 +116,10 @@ export const ProductItemAccordion = (props: ProductItemAccordionParams) => {
108
116
  }
109
117
  }, []);
110
118
 
119
+ const onTextLayout = useCallback((e: any) => {
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
121
+ },[]);
122
+
111
123
  return (
112
124
  <AccordionSection>
113
125
  <Accordion
@@ -288,9 +300,21 @@ export const ProductItemAccordion = (props: ProductItemAccordionParams) => {
288
300
  color={theme.colors.unselectText}>
289
301
  {t('COMMENT', 'Comment')}
290
302
  </OText>
291
- <OText size={12} mLeft={10} color={theme.colors.unselectText}>
303
+ <OText
304
+ size={12}
305
+ style={{ width: '100%', paddingLeft: 10 }}
306
+ color={theme.colors.unselectText}
307
+ onTextLayout={onTextLayout}
308
+ numberOfLines={isReadMore ? 15 : 2}
309
+ ellipsizeMode="tail"
310
+ >
292
311
  {product.comment}
293
312
  </OText>
313
+ {lengthMore && (
314
+ <TouchableOpacity onPress={() => setIsReadMore(!isReadMore)} style={{ marginLeft: 10 }}>
315
+ <OText size={10} color={theme.colors.statusOrderBlue}>{isReadMore ? t('SHOW_LESS', 'Show less') : t('READ_MORE', 'Read more')}</OText>
316
+ </TouchableOpacity>
317
+ )}
294
318
  </ProductComment>
295
319
  )}
296
320
  </AccordionContent>
@@ -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}>
@@ -49,7 +49,8 @@ const ProfileUI = (props: ProfileParams) => {
49
49
  handleToggleAvalaibleStatusDriver,
50
50
  userState,
51
51
  isAvailableLoading,
52
- isAlsea
52
+ isAlsea,
53
+ isHideDriverStatus
53
54
  } = props;
54
55
 
55
56
  const [{ user }] = useSession();
@@ -345,7 +346,7 @@ const ProfileUI = (props: ProfileParams) => {
345
346
  />
346
347
  </CenterView>
347
348
 
348
- {user?.level === 4 && (
349
+ {user?.level === 4 && !isHideDriverStatus && (
349
350
  <EnabledStatusDriver>
350
351
  <View style={{ flex: 1 }}>
351
352
  <OText
@@ -478,19 +479,17 @@ const ProfileUI = (props: ProfileParams) => {
478
479
  />
479
480
  </EditButton>
480
481
  )}
481
- {!!user?.schedule && (
482
- <Pressable style={{ marginBottom: 10 }} onPress={() => setOpenModal(true)}>
483
- <View style={{ flexDirection: 'row', justifyContent: 'space-between' }}>
484
- <OText size={16}>{t('SCHEDULE', 'Schedule')}</OText>
485
- <AntDesignIcon size={18} name='right' />
486
- </View>
487
- <View style={{
488
- borderBottomColor: theme.colors.tabBar,
489
- borderBottomWidth: 1,
490
- marginTop: 10
491
- }} />
492
- </Pressable>
493
- )}
482
+ <Pressable style={{ marginBottom: 10 }} onPress={() => setOpenModal(true)}>
483
+ <View style={{ flexDirection: 'row', justifyContent: 'space-between' }}>
484
+ <OText size={16}>{t('SCHEDULE', 'Schedule')}</OText>
485
+ <AntDesignIcon size={18} name='right' />
486
+ </View>
487
+ <View style={{
488
+ borderBottomColor: theme.colors.tabBar,
489
+ borderBottomWidth: 1,
490
+ marginTop: 10
491
+ }} />
492
+ </Pressable>
494
493
  <Actions>
495
494
  <LanguageSelector />
496
495
 
@@ -12,10 +12,12 @@ interface Props {
12
12
  TextStyle?: TextStyle;
13
13
  type?: string;
14
14
  hasButton?: boolean;
15
+ numberOfLines?: number;
16
+ onTextLayout?: (e : any) => void;
15
17
  }
16
18
 
17
19
  const OLink = (props: Props): React.ReactElement => {
18
- const { url, shorcut, color, PressStyle, TextStyle, type, hasButton } = props;
20
+ const { url, shorcut, color, PressStyle, TextStyle, type, hasButton, numberOfLines, onTextLayout } = props;
19
21
  const [, t] = useLanguage();
20
22
 
21
23
  const handleAlert = () =>
@@ -75,9 +77,11 @@ const OLink = (props: Props): React.ReactElement => {
75
77
  ) : (
76
78
  <OText
77
79
  style={TextStyle}
78
- numberOfLines={1}
80
+ numberOfLines={numberOfLines ?? 1}
79
81
  ellipsizeMode="tail"
80
- color={color}>
82
+ color={color}
83
+ onTextLayout={onTextLayout}
84
+ >
81
85
  {shorcut}
82
86
  </OText>
83
87
  )}
@@ -85,4 +89,8 @@ const OLink = (props: Props): React.ReactElement => {
85
89
  );
86
90
  };
87
91
 
92
+ OLink.defaultProps = {
93
+ onTextLayout: (e: any) => {}
94
+ };
95
+
88
96
  export default OLink;