ordering-ui-react-native 0.17.33 → 0.17.34-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 (211) hide show
  1. package/package.json +8 -7
  2. package/src/DeliveryApp.tsx +43 -1
  3. package/src/components/BusinessesListing/index.tsx +1 -1
  4. package/src/components/OrderCreating/index.tsx +1 -21
  5. package/src/components/PaymentOptionsWebView/index.tsx +119 -120
  6. package/src/components/StripeMethodForm/index.tsx +108 -79
  7. package/src/components/VerifyPhone/styles.tsx +1 -2
  8. package/src/components/shared/OToast.tsx +4 -4
  9. package/src/types/index.tsx +5 -0
  10. package/src/utils/index.tsx +7 -1
  11. package/themes/business/index.tsx +2 -0
  12. package/themes/business/src/components/AcceptOrRejectOrder/index.tsx +265 -240
  13. package/themes/business/src/components/AcceptOrRejectOrder/styles.tsx +6 -4
  14. package/themes/business/src/components/BusinessController/index.tsx +0 -1
  15. package/themes/business/src/components/Chat/index.tsx +118 -107
  16. package/themes/business/src/components/DriverMap/index.tsx +17 -6
  17. package/themes/business/src/components/GoogleMap/index.tsx +58 -57
  18. package/themes/business/src/components/LoginForm/Otp/index.tsx +120 -0
  19. package/themes/business/src/components/LoginForm/Otp/styles.tsx +7 -0
  20. package/themes/business/src/components/LoginForm/index.tsx +238 -80
  21. package/themes/business/src/components/LoginForm/styles.tsx +10 -0
  22. package/themes/business/src/components/MapView/index.tsx +10 -10
  23. package/themes/business/src/components/NewOrderNotification/index.tsx +43 -50
  24. package/themes/business/src/components/OrderDetails/Delivery.tsx +4 -3
  25. package/themes/business/src/components/OrderDetails/OrderContentComponent.tsx +90 -47
  26. package/themes/business/src/components/OrderDetails/OrderHeaderComponent.tsx +59 -62
  27. package/themes/business/src/components/OrderDetailsLogistic/index.tsx +195 -0
  28. package/themes/business/src/components/OrderDetailsLogistic/styles.tsx +5 -0
  29. package/themes/business/src/components/OrderMessage/index.tsx +18 -17
  30. package/themes/business/src/components/OrderSummary/index.tsx +113 -121
  31. package/themes/business/src/components/OrdersOption/index.tsx +32 -75
  32. package/themes/business/src/components/PreviousOrders/OrderItem.tsx +250 -0
  33. package/themes/business/src/components/PreviousOrders/OrdersGroupedItem.tsx +115 -0
  34. package/themes/business/src/components/PreviousOrders/index.tsx +445 -243
  35. package/themes/business/src/components/PreviousOrders/styles.tsx +31 -3
  36. package/themes/business/src/components/ProductItemAccordion/index.tsx +27 -3
  37. package/themes/business/src/components/ReviewCustomer/index.tsx +41 -24
  38. package/themes/business/src/components/StoresList/index.tsx +2 -2
  39. package/themes/business/src/components/shared/OLink.tsx +33 -13
  40. package/themes/business/src/components/shared/OModal.tsx +16 -9
  41. package/themes/business/src/components/shared/OText.tsx +8 -2
  42. package/themes/business/src/types/index.tsx +32 -2
  43. package/themes/business/src/utils/index.tsx +44 -1
  44. package/themes/doordash/src/components/BusinessesListing/index.tsx +1 -1
  45. package/themes/doordash/src/components/LoginForm/index.tsx +1 -2
  46. package/themes/instacart/src/components/BusinessesListing/index.tsx +1 -1
  47. package/themes/kiosk/src/components/BusinessesListing/index.tsx +2 -1
  48. package/themes/kiosk/src/components/Checkout/index.tsx +6 -0
  49. package/themes/kiosk/src/components/LoginForm/Otp/index.tsx +92 -0
  50. package/themes/kiosk/src/components/LoginForm/Otp/styles.tsx +7 -0
  51. package/themes/kiosk/src/components/LoginForm/index.tsx +473 -151
  52. package/themes/kiosk/src/components/LoginForm/styles.tsx +14 -1
  53. package/themes/kiosk/src/components/NavBar/index.tsx +14 -14
  54. package/themes/kiosk/src/components/OptionCard/index.tsx +1 -1
  55. package/themes/kiosk/src/components/OrderTypeCardSelector/index.tsx +8 -10
  56. package/themes/kiosk/src/components/PhoneInputNumber/index.tsx +3 -2
  57. package/themes/kiosk/src/components/PhoneInputNumber/styles.tsx +1 -3
  58. package/themes/kiosk/src/components/ProductForm/index.tsx +1 -14
  59. package/themes/kiosk/src/components/shared/OButton.tsx +5 -18
  60. package/themes/kiosk/src/components/shared/OModal.tsx +14 -11
  61. package/themes/kiosk/src/layouts/Container.tsx +7 -1
  62. package/themes/kiosk/src/types/index.d.ts +13 -0
  63. package/themes/kiosk/src/utils/index.tsx +15 -0
  64. package/themes/original/index.tsx +6 -0
  65. package/themes/original/src/components/AddressDetails/index.tsx +29 -11
  66. package/themes/original/src/components/AddressForm/index.tsx +85 -49
  67. package/themes/original/src/components/AddressList/index.tsx +26 -21
  68. package/themes/original/src/components/AddressList/styles.tsx +4 -2
  69. package/themes/original/src/components/AnalyticsSegment/index.tsx +193 -10
  70. package/themes/original/src/components/AppleLogin/index.tsx +4 -4
  71. package/themes/original/src/components/BusinessBasicInformation/index.tsx +159 -90
  72. package/themes/original/src/components/BusinessBasicInformation/styles.tsx +9 -7
  73. package/themes/original/src/components/BusinessController/index.tsx +154 -68
  74. package/themes/original/src/components/BusinessController/styles.tsx +22 -9
  75. package/themes/original/src/components/BusinessFeaturedController/index.tsx +21 -54
  76. package/themes/original/src/components/BusinessFeaturedController/styles.tsx +8 -0
  77. package/themes/original/src/components/BusinessInformation/index.tsx +10 -31
  78. package/themes/original/src/components/BusinessItemAccordion/index.tsx +23 -22
  79. package/themes/original/src/components/BusinessListingSearch/index.tsx +350 -323
  80. package/themes/original/src/components/BusinessPreorder/index.tsx +97 -16
  81. package/themes/original/src/components/BusinessProductsList/index.tsx +20 -11
  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 -524
  85. package/themes/original/src/components/BusinessProductsListing/styles.tsx +4 -6
  86. package/themes/original/src/components/BusinessReviews/index.tsx +3 -1
  87. package/themes/original/src/components/BusinessesListing/Layout/Appointment/index.tsx +1 -1
  88. package/themes/original/src/components/BusinessesListing/Layout/Original/index.tsx +105 -78
  89. package/themes/original/src/components/BusinessesListing/Layout/Original/styles.tsx +1 -9
  90. package/themes/original/src/components/BusinessesListing/index.tsx +0 -1
  91. package/themes/original/src/components/Cart/index.tsx +102 -69
  92. package/themes/original/src/components/CartContent/index.tsx +115 -19
  93. package/themes/original/src/components/CartContent/styles.tsx +15 -1
  94. package/themes/original/src/components/Checkout/index.tsx +331 -177
  95. package/themes/original/src/components/Checkout/styles.tsx +4 -2
  96. package/themes/original/src/components/CitiesControl/index.tsx +89 -0
  97. package/themes/original/src/components/CitiesControl/styles.tsx +17 -0
  98. package/themes/original/src/components/CouponControl/index.tsx +10 -3
  99. package/themes/original/src/components/DriverTips/index.tsx +52 -34
  100. package/themes/original/src/components/Favorite/index.tsx +7 -4
  101. package/themes/original/src/components/Favorite/styles.tsx +1 -1
  102. package/themes/original/src/components/FavoriteList/index.tsx +51 -80
  103. package/themes/original/src/components/FloatingButton/index.tsx +1 -2
  104. package/themes/original/src/components/FloatingButton/styles.tsx +1 -1
  105. package/themes/original/src/components/GPSButton/index.tsx +6 -4
  106. package/themes/original/src/components/GPSButton/styles.ts +3 -3
  107. package/themes/original/src/components/GiftCard/GiftCardUI/index.tsx +96 -0
  108. package/themes/original/src/components/GiftCard/GiftCardUI/styles.tsx +5 -0
  109. package/themes/original/src/components/GiftCard/PurchaseGiftCard/index.tsx +100 -0
  110. package/themes/original/src/components/GiftCard/PurchaseGiftCard/styles.tsx +8 -0
  111. package/themes/original/src/components/GiftCard/RedeemGiftCard/index.tsx +191 -0
  112. package/themes/original/src/components/GiftCard/RedeemGiftCard/styles.tsx +8 -0
  113. package/themes/original/src/components/GiftCard/SendGiftCard/index.tsx +165 -0
  114. package/themes/original/src/components/GiftCard/SendGiftCard/styles.tsx +9 -0
  115. package/themes/original/src/components/GoogleMap/index.tsx +15 -4
  116. package/themes/original/src/components/Help/index.tsx +8 -8
  117. package/themes/original/src/components/HelpAccountAndPayment/index.tsx +11 -22
  118. package/themes/original/src/components/HelpAccountAndPayment/styles.tsx +6 -0
  119. package/themes/original/src/components/HelpGuide/index.tsx +12 -16
  120. package/themes/original/src/components/HelpGuide/styles.tsx +6 -0
  121. package/themes/original/src/components/HelpOrder/index.tsx +12 -25
  122. package/themes/original/src/components/HelpOrder/styles.tsx +8 -1
  123. package/themes/original/src/components/Home/index.tsx +13 -4
  124. package/themes/original/src/components/LastOrder/index.tsx +1 -34
  125. package/themes/original/src/components/LoginForm/Otp/index.tsx +139 -75
  126. package/themes/original/src/components/LoginForm/Otp/styles.tsx +0 -1
  127. package/themes/original/src/components/LoginForm/index.tsx +71 -28
  128. package/themes/original/src/components/LottieAnimation/index.tsx +78 -0
  129. package/themes/original/src/components/MessageListing/index.tsx +16 -42
  130. package/themes/original/src/components/Messages/index.tsx +32 -10
  131. package/themes/original/src/components/MomentOption/index.tsx +195 -88
  132. package/themes/original/src/components/MultiCart/index.tsx +50 -0
  133. package/themes/original/src/components/MultiCartsPaymethodsAndWallets/index.tsx +197 -116
  134. package/themes/original/src/components/MultiCheckout/index.tsx +298 -88
  135. package/themes/original/src/components/MultiCheckout/styles.tsx +3 -1
  136. package/themes/original/src/components/MultiOrdersDetails/SingleOrderCard.tsx +37 -224
  137. package/themes/original/src/components/MultiOrdersDetails/index.tsx +68 -21
  138. package/themes/original/src/components/MultiOrdersDetails/styles.tsx +1 -1
  139. package/themes/original/src/components/MyOrders/index.tsx +55 -51
  140. package/themes/original/src/components/NavBar/index.tsx +18 -18
  141. package/themes/original/src/components/Notifications/index.tsx +46 -50
  142. package/themes/original/src/components/Notifications/styles.tsx +6 -3
  143. package/themes/original/src/components/OrderDetails/OrderEta.tsx +76 -0
  144. package/themes/original/src/components/OrderDetails/OrderHistory.tsx +15 -3
  145. package/themes/original/src/components/OrderDetails/index.tsx +199 -359
  146. package/themes/original/src/components/OrderDetails/styles.tsx +0 -1
  147. package/themes/original/src/components/OrderItAgain/index.tsx +3 -1
  148. package/themes/original/src/components/OrderProgress/index.tsx +93 -114
  149. package/themes/original/src/components/OrderProgress/styles.tsx +5 -0
  150. package/themes/original/src/components/OrderSummary/index.tsx +87 -59
  151. package/themes/original/src/components/OrderTypeSelector/index.tsx +1 -1
  152. package/themes/original/src/components/OrdersOption/PreviousBusinessOrdered/index.tsx +24 -19
  153. package/themes/original/src/components/OrdersOption/index.tsx +63 -56
  154. package/themes/original/src/components/PageBanner/index.tsx +171 -0
  155. package/themes/original/src/components/PageBanner/styles.tsx +11 -0
  156. package/themes/original/src/components/PaymentOptionStripe/styles.tsx +1 -1
  157. package/themes/original/src/components/PaymentOptionWallet/index.tsx +56 -56
  158. package/themes/original/src/components/PaymentOptions/index.tsx +34 -6
  159. package/themes/original/src/components/PhoneInputNumber/index.tsx +3 -3
  160. package/themes/original/src/components/PlaceSpot/index.tsx +12 -6
  161. package/themes/original/src/components/ProductForm/index.tsx +223 -232
  162. package/themes/original/src/components/ProductForm/styles.tsx +5 -8
  163. package/themes/original/src/components/ProductItemAccordion/index.tsx +59 -29
  164. package/themes/original/src/components/ProductOptionSubOption/index.tsx +19 -11
  165. package/themes/original/src/components/ProductOptionSubOption/styles.tsx +1 -2
  166. package/themes/original/src/components/ProfessionalFilter/SingleProfessionalCard/index.tsx +108 -0
  167. package/themes/original/src/components/ProfessionalFilter/index.tsx +20 -50
  168. package/themes/original/src/components/ProfessionalProfile/index.tsx +36 -7
  169. package/themes/original/src/components/Promotions/index.tsx +234 -220
  170. package/themes/original/src/components/Promotions/styles.tsx +10 -3
  171. package/themes/original/src/components/ReviewDriver/index.tsx +3 -3
  172. package/themes/original/src/components/ReviewOrder/index.tsx +26 -9
  173. package/themes/original/src/components/ReviewOrder/styles.tsx +7 -0
  174. package/themes/original/src/components/ReviewProducts/index.tsx +23 -11
  175. package/themes/original/src/components/ReviewTrigger/index.tsx +27 -9
  176. package/themes/original/src/components/ReviewTrigger/styles.tsx +8 -1
  177. package/themes/original/src/components/ScheduleAccordion/index.tsx +68 -0
  178. package/themes/original/src/components/ScheduleAccordion/styles.tsx +14 -0
  179. package/themes/original/src/components/ServiceForm/index.tsx +74 -19
  180. package/themes/original/src/components/Sessions/index.tsx +11 -8
  181. package/themes/original/src/components/Sessions/styles.tsx +5 -0
  182. package/themes/original/src/components/SignupForm/index.tsx +42 -19
  183. package/themes/original/src/components/SingleOrderCard/index.tsx +156 -65
  184. package/themes/original/src/components/SingleOrderCard/styles.tsx +11 -9
  185. package/themes/original/src/components/SingleProductCard/index.tsx +100 -56
  186. package/themes/original/src/components/SingleProductCard/styles.tsx +22 -13
  187. package/themes/original/src/components/SingleProductReview/styles.tsx +1 -1
  188. package/themes/original/src/components/StripeCardsList/index.tsx +13 -3
  189. package/themes/original/src/components/StripeElementsForm/index.tsx +28 -15
  190. package/themes/original/src/components/UpsellingProducts/index.tsx +238 -224
  191. package/themes/original/src/components/UpsellingProducts/styles.tsx +12 -1
  192. package/themes/original/src/components/UserDetails/index.tsx +8 -4
  193. package/themes/original/src/components/UserFormDetails/index.tsx +47 -7
  194. package/themes/original/src/components/UserProfile/index.tsx +9 -14
  195. package/themes/original/src/components/UserProfileForm/index.tsx +25 -28
  196. package/themes/original/src/components/UserProfileForm/styles.tsx +7 -0
  197. package/themes/original/src/components/WalletTransactionItem/index.tsx +2 -2
  198. package/themes/original/src/components/WalletTransactions/index.tsx +3 -3
  199. package/themes/original/src/components/Wallets/index.tsx +79 -36
  200. package/themes/original/src/components/Wallets/styles.tsx +5 -4
  201. package/themes/original/src/components/shared/CardAnimation.tsx +47 -0
  202. package/themes/original/src/components/shared/HeaderTitle.tsx +8 -3
  203. package/themes/original/src/components/shared/OBottomPopup.tsx +1 -1
  204. package/themes/original/src/components/shared/OButton.tsx +6 -2
  205. package/themes/original/src/components/shared/OIcon.tsx +8 -1
  206. package/themes/original/src/components/shared/OInput.tsx +16 -2
  207. package/themes/original/src/components/shared/OModal.tsx +3 -3
  208. package/themes/original/src/layouts/Container.tsx +13 -9
  209. package/themes/original/src/types/index.tsx +37 -9
  210. package/themes/original/src/utils/index.tsx +364 -58
  211. package/themes/uber-eats/src/components/BusinessesListing/index.tsx +1 -1
@@ -3,6 +3,7 @@ import {
3
3
  useLanguage,
4
4
  useEvent,
5
5
  useUtils,
6
+ useConfig,
6
7
  OrderDetails as OrderDetailsController
7
8
  } from 'ordering-components/native'
8
9
  import { View, StyleSheet, TouchableOpacity, Linking } from 'react-native'
@@ -15,6 +16,7 @@ import {
15
16
  StaturBar,
16
17
  Icons
17
18
  } from './styles'
19
+ import { getOrderStatus } from '../../utils'
18
20
 
19
21
  const SingleOrderCardUI = (props: any) => {
20
22
  const {
@@ -23,13 +25,17 @@ const SingleOrderCardUI = (props: any) => {
23
25
  readMessages,
24
26
  messages,
25
27
  setMessages,
26
- handleGoToOrderDetails
28
+ handleGoToOrderDetails,
29
+ showProgressBar
27
30
  } = props
28
31
 
29
32
  const { order } = props.order
30
33
  const theme = useTheme()
31
34
  const [, t] = useLanguage()
32
35
  const [{ parseDate, parsePrice }] = useUtils()
36
+ const [{ configs }] = useConfig()
37
+
38
+ const hideIndividualButton = configs.multi_business_checkout_remove_individual_buttons?.value === '1'
33
39
 
34
40
  const styles = StyleSheet.create({
35
41
  statusBar: {
@@ -37,205 +43,6 @@ const SingleOrderCardUI = (props: any) => {
37
43
  }
38
44
  })
39
45
 
40
- const getOrderStatus = (s: string) => {
41
- const status = parseInt(s);
42
- const orderStatus = [
43
- {
44
- key: 0,
45
- value: t('PENDING', 'Pending'),
46
- slug: 'PENDING',
47
- percentage: 0.25,
48
- image: theme.images.order.status0,
49
- },
50
- {
51
- key: 1,
52
- value: t('COMPLETED', 'Completed'),
53
- slug: 'COMPLETED',
54
- percentage: 1,
55
- image: theme.images.order.status1,
56
- },
57
- {
58
- key: 2,
59
- value: t('REJECTED', 'Rejected'),
60
- slug: 'REJECTED',
61
- percentage: 0,
62
- image: theme.images.order.status2,
63
- },
64
- {
65
- key: 3,
66
- value: t('DRIVER_IN_BUSINESS', 'Driver in business'),
67
- slug: 'DRIVER_IN_BUSINESS',
68
- percentage: 0.6,
69
- image: theme.images.order.status3,
70
- },
71
- {
72
- key: 4,
73
- value: t('PREPARATION_COMPLETED', 'Preparation Completed'),
74
- slug: 'PREPARATION_COMPLETED',
75
- percentage: 0.7,
76
- image: theme.images.order.status4,
77
- },
78
- {
79
- key: 5,
80
- value: t('REJECTED_BY_BUSINESS', 'Rejected by business'),
81
- slug: 'REJECTED_BY_BUSINESS',
82
- percentage: 0,
83
- image: theme.images.order.status5,
84
- },
85
- {
86
- key: 6,
87
- value: t('REJECTED_BY_DRIVER', 'Rejected by Driver'),
88
- slug: 'REJECTED_BY_DRIVER',
89
- percentage: 0,
90
- image: theme.images.order.status6,
91
- },
92
- {
93
- key: 7,
94
- value: t('ACCEPTED_BY_BUSINESS', 'Accepted by business'),
95
- slug: 'ACCEPTED_BY_BUSINESS',
96
- percentage: 0.35,
97
- image: theme.images.order.status7,
98
- },
99
- {
100
- key: 8,
101
- value: t('ACCEPTED_BY_DRIVER', 'Accepted by driver'),
102
- slug: 'ACCEPTED_BY_DRIVER',
103
- percentage: 0.45,
104
- image: theme.images.order.status8,
105
- },
106
- {
107
- key: 9,
108
- value: t('PICK_UP_COMPLETED_BY_DRIVER', 'Pick up completed by driver'),
109
- slug: 'PICK_UP_COMPLETED_BY_DRIVER',
110
- percentage: 0.8,
111
- image: theme.images.order.status9,
112
- },
113
- {
114
- key: 10,
115
- value: t('PICK_UP_FAILED_BY_DRIVER', 'Pick up Failed by driver'),
116
- slug: 'PICK_UP_FAILED_BY_DRIVER',
117
- percentage: 0,
118
- image: theme.images.order.status10,
119
- },
120
- {
121
- key: 11,
122
- value: t(
123
- 'DELIVERY_COMPLETED_BY_DRIVER',
124
- 'Delivery completed by driver',
125
- ),
126
- slug: 'DELIVERY_COMPLETED_BY_DRIVER',
127
- percentage: 1,
128
- image: theme.images.order.status11,
129
- },
130
- {
131
- key: 12,
132
- value: t('DELIVERY_FAILED_BY_DRIVER', 'Delivery Failed by driver'),
133
- slug: 'DELIVERY_FAILED_BY_DRIVER',
134
- percentage: 0,
135
- image: theme.images.order.status12,
136
- },
137
- {
138
- key: 13,
139
- value: t('PREORDER', 'PreOrder'),
140
- slug: 'PREORDER',
141
- percentage: 0,
142
- image: theme.images.order.status13,
143
- },
144
- {
145
- key: 14,
146
- value: t('ORDER_NOT_READY', 'Order not ready'),
147
- slug: 'ORDER_NOT_READY',
148
- percentage: 0,
149
- image: theme.images.order.status13,
150
- },
151
- {
152
- key: 15,
153
- value: t(
154
- 'ORDER_PICKEDUP_COMPLETED_BY_CUSTOMER',
155
- 'Order picked up completed by customer',
156
- ),
157
- slug: 'ORDER_PICKEDUP_COMPLETED_BY_CUSTOMER',
158
- percentage: 100,
159
- image: theme.images.order.status1,
160
- },
161
- {
162
- key: 16,
163
- value: t('CANCELLED_BY_CUSTOMER', 'Cancelled by customer'),
164
- slug: 'CANCELLED_BY_CUSTOMER',
165
- percentage: 0,
166
- image: theme.images.order.status2,
167
- },
168
- {
169
- key: 17,
170
- value: t(
171
- 'ORDER_NOT_PICKEDUP_BY_CUSTOMER',
172
- 'Order not picked up by customer',
173
- ),
174
- slug: 'ORDER_NOT_PICKEDUP_BY_CUSTOMER',
175
- percentage: 0,
176
- image: theme.images.order.status2,
177
- },
178
- {
179
- key: 18,
180
- value: t(
181
- 'DRIVER_ALMOST_ARRIVED_TO_BUSINESS',
182
- 'Driver almost arrived to business',
183
- ),
184
- slug: 'DRIVER_ALMOST_ARRIVED_TO_BUSINESS',
185
- percentage: 0.15,
186
- image: theme.images.order.status3,
187
- },
188
- {
189
- key: 19,
190
- value: t(
191
- 'DRIVER_ALMOST_ARRIVED_TO_CUSTOMER',
192
- 'Driver almost arrived to customer',
193
- ),
194
- slug: 'DRIVER_ALMOST_ARRIVED_TO_CUSTOMER',
195
- percentage: 0.9,
196
- image: theme.images.order.status11,
197
- },
198
- {
199
- key: 20,
200
- value: t(
201
- 'ORDER_CUSTOMER_ALMOST_ARRIVED_BUSINESS',
202
- 'Customer almost arrived to business',
203
- ),
204
- slug: 'ORDER_CUSTOMER_ALMOST_ARRIVED_BUSINESS',
205
- percentage: 90,
206
- image: theme.images.order.status7,
207
- },
208
- {
209
- key: 21,
210
- value: t(
211
- 'ORDER_CUSTOMER_ARRIVED_BUSINESS',
212
- 'Customer arrived to business',
213
- ),
214
- slug: 'ORDER_CUSTOMER_ARRIVED_BUSINESS',
215
- percentage: 95,
216
- image: theme.images.order.status7,
217
- },
218
- {
219
- key: 22,
220
- value: t('ORDER_LOOKING_FOR_DRIVER', 'Looking for driver'),
221
- slug: 'ORDER_LOOKING_FOR_DRIVER',
222
- percentage: 35,
223
- image: theme.images.order.status8
224
- },
225
- {
226
- key: 23,
227
- value: t('ORDER_DRIVER_ON_WAY', 'Driver on way'),
228
- slug: 'ORDER_DRIVER_ON_WAY',
229
- percentage: 45,
230
- image: theme.images.order.status8
231
- }
232
- ];
233
-
234
- const objectStatus = orderStatus.find((o) => o.key === status);
235
-
236
- return objectStatus && objectStatus;
237
- };
238
-
239
46
  const handleGoToMessages = (type: string) => {
240
47
  readMessages && readMessages();
241
48
  navigation.navigate(
@@ -275,14 +82,16 @@ const SingleOrderCardUI = (props: any) => {
275
82
  </View>
276
83
  </View>
277
84
  </View>
278
- <OButton
279
- onClick={() => handleGoToOrderDetails(order?.uuid)}
280
- textStyle={{ color: theme.colors.primary, textAlign: 'center', fontSize: 14 }}
281
- style={{ flexDirection: 'row', justifyContent: 'center', borderRadius: 7.6, shadowOpacity: 0, paddingLeft: 5, paddingRight: 5, height: 44 }}
282
- text={t('ORDER_DETAILS', 'Order Details')}
283
- bgColor={theme.colors.white}
284
- borderColor={theme.colors.primary}
285
- />
85
+ {!hideIndividualButton && (
86
+ <OButton
87
+ onClick={() => handleGoToOrderDetails(order?.uuid)}
88
+ textStyle={{ color: theme.colors.primary, textAlign: 'center', fontSize: 14 }}
89
+ style={{ flexDirection: 'row', justifyContent: 'center', borderRadius: 7.6, shadowOpacity: 0, paddingLeft: 5, paddingRight: 5, height: 44 }}
90
+ text={t('ORDER_DETAILS', 'Order Details')}
91
+ bgColor={theme.colors.white}
92
+ borderColor={theme.colors.primary}
93
+ />
94
+ )}
286
95
  </View>
287
96
  <OText size={16} lineHeight={24} mBottom={17} weight={'500'} color={theme.colors.textNormal}>
288
97
  {t('FROM', 'From')}
@@ -324,25 +133,29 @@ const SingleOrderCardUI = (props: any) => {
324
133
  <OText size={12} lineHeight={18} color={theme.colors.textNormal}>
325
134
  {order?.business?.cellphone}
326
135
  </OText>
327
- )}
136
+ )}
328
137
  <OText size={12} lineHeight={18} color={theme.colors.textNormal}>
329
138
  {order?.business?.address}
330
139
  </OText>
331
- <StaturBar>
332
- <LinearGradient
333
- start={{ x: 0.0, y: 0.0 }}
334
- end={{
335
- x: getOrderStatus(order?.status)?.percentage || 0,
336
- y: 0,
337
- }}
338
- locations={[0.9999, 0.9999]}
339
- colors={[theme.colors.primary, theme.colors.backgroundGray100]}
340
- style={styles.statusBar}
341
- />
342
- </StaturBar>
343
- <OText size={12} lineHeight={18} weight={'400'} color={theme.colors.textNormal}>
344
- {getOrderStatus(order?.status)?.value}
345
- </OText>
140
+ {showProgressBar && (
141
+ <>
142
+ <StaturBar>
143
+ <LinearGradient
144
+ start={{ x: 0.0, y: 0.0 }}
145
+ end={{
146
+ x: getOrderStatus(order?.status)?.percentage || 0,
147
+ y: 0,
148
+ }}
149
+ locations={[0.9999, 0.9999]}
150
+ colors={[theme.colors.primary, theme.colors.backgroundGray100]}
151
+ style={styles.statusBar}
152
+ />
153
+ </StaturBar>
154
+ <OText size={12} lineHeight={18} weight={'400'} color={theme.colors.textNormal}>
155
+ {getOrderStatus(order?.status)?.value}
156
+ </OText>
157
+ </>
158
+ )}
346
159
  <View style={{ flexDirection: 'row', justifyContent: 'flex-end', marginTop: 20 }}>
347
160
  <OText size={16} lineHeight={24} weight={'600'} color={theme.colors.textNormal}>
348
161
  {t('EXPORT_ORDER_TOTAL', 'Order total')}: {parsePrice(order?.summary?.total ?? order?.total)}
@@ -1,12 +1,12 @@
1
1
  import React, { useEffect } from 'react'
2
- import { useLanguage, useUtils, useToast, ToastType, MultiOrdersDetails as MultiOrdersDetailsController } from 'ordering-components/native'
2
+ import { useLanguage, useUtils, useToast, ToastType, useConfig, MultiOrdersDetails as MultiOrdersDetailsController } from 'ordering-components/native'
3
3
  import { View, StyleSheet, BackHandler, TouchableOpacity } from 'react-native'
4
4
  import { useTheme } from 'styled-components/native'
5
5
  import { OText, OButton } from '../shared'
6
- import { Container } from '../../layouts/Container'
7
6
  import { Placeholder, PlaceholderLine, Fade } from 'rn-placeholder'
8
7
  import { SingleOrderCard } from './SingleOrderCard'
9
8
  import AntDesignIcon from 'react-native-vector-icons/AntDesign'
9
+ import { getOrderStatus } from '../../utils'
10
10
 
11
11
  import {
12
12
  OrdersDetailsContainer,
@@ -17,8 +17,11 @@ import {
17
17
  InfoBlock,
18
18
  Row,
19
19
  OrdersSummary,
20
- BorderLine
20
+ BorderLine,
21
+ StaturBar
21
22
  } from './styles'
23
+ import { NotFoundSource } from '../NotFoundSource'
24
+ import LinearGradient from 'react-native-linear-gradient'
22
25
 
23
26
  export const MultiOrdersDetailsUI = (props: any) => {
24
27
  const {
@@ -38,12 +41,21 @@ export const MultiOrdersDetailsUI = (props: any) => {
38
41
  padding: 0,
39
42
  marginLeft: -20
40
43
  },
44
+ statusBar: {
45
+ height: 12,
46
+ }
41
47
  })
42
48
 
43
49
  const { loading, orders, error } = props.ordersList
44
50
  const [, t] = useLanguage()
45
51
  const [{ parsePrice, parseNumber, parseDate }] = useUtils();
46
52
  const [, { showToast }] = useToast();
53
+ const [{ configs }] = useConfig()
54
+
55
+ const isTaxIncludedOnPrice = orders.every((_order: any) => _order.taxes?.length ? _order.taxes?.every((_tax: any) => _tax.type === 1) : true)
56
+ const progressBarStyle = configs.multi_business_checkout_progress_bar_style?.value
57
+ const showBarInOrder = ['group', 'both']
58
+ const showBarInIndividual = ['individual', 'both']
47
59
 
48
60
  const walletName: any = {
49
61
  cash: {
@@ -154,7 +166,7 @@ export const MultiOrdersDetailsUI = (props: any) => {
154
166
  <OText key={event.id} size={12} lineHeight={18} color={theme.colors.textNormal}>
155
167
  {event?.wallet_event
156
168
  ? walletName[event?.wallet_event?.wallet?.type]?.name
157
- : event?.paymethod?.name}
169
+ : t(event?.paymethod?.name.toUpperCase()?.replace(/ /g, '_'), event?.paymethod?.name)}
158
170
  </OText>
159
171
  ))}
160
172
  </Section>
@@ -185,6 +197,23 @@ export const MultiOrdersDetailsUI = (props: any) => {
185
197
  <OText size={16} lineHeight={24} weight={'500'} color={theme.colors.textNormal} mBottom={20}>
186
198
  {t('ORDER_SUMMARY', 'Order summary')}
187
199
  </OText>
200
+ {(showBarInOrder.includes(progressBarStyle)) && (
201
+ <StaturBar isOrderDetails>
202
+ <LinearGradient
203
+ start={{ x: 0.0, y: 0.0 }}
204
+ end={{
205
+ x: getOrderStatus(orders[0]?.status)?.percentage || 0,
206
+ y: 0,
207
+ }}
208
+ locations={[0.9999, 0.9999]}
209
+ colors={[theme.colors.primary, theme.colors.backgroundGray100]}
210
+ style={styles.statusBar}
211
+ />
212
+ </StaturBar>
213
+ )}
214
+ <OText size={14} lineHeight={18} weight={'400'} color={theme.colors.textNormal} mBottom={10}>
215
+ {getOrderStatus(orders[0]?.status)?.value}
216
+ </OText>
188
217
  {orders.map((order: any) => (
189
218
  <Row key={order.id}>
190
219
  <OText size={12} lineHeight={18} weight={'400'} color={theme.colors.textNormal}>
@@ -196,23 +225,27 @@ export const MultiOrdersDetailsUI = (props: any) => {
196
225
  </Row>
197
226
  ))}
198
227
  <BorderLine />
199
- <Row>
200
- <OText size={12} lineHeight={18} weight={'400'} color={theme.colors.textNormal}>
201
- {t('TOTAL_BEFORE_TAX', 'Total before tax')}:
202
- </OText>
203
- <OText size={12} lineHeight={18} weight={'400'} color={theme.colors.textNormal}>
204
- {parsePrice(ordersSummary?.subtotal)}
205
- </OText>
206
- </Row>
207
- <Row>
208
- <OText size={12} lineHeight={18} weight={'400'} color={theme.colors.textNormal}>
209
- {t('ESTIMATED_TAX_TO_BE_COLLECTED', 'Estimated tax to be collected')}:
210
- </OText>
211
- <OText size={12} lineHeight={18} weight={'400'} color={theme.colors.textNormal}>
212
- {parsePrice(ordersSummary?.tax)}
213
- </OText>
214
- </Row>
215
- <BorderLine />
228
+ {!isTaxIncludedOnPrice && (
229
+ <>
230
+ <Row>
231
+ <OText size={12} lineHeight={18} weight={'400'} color={theme.colors.textNormal}>
232
+ {t('TOTAL_BEFORE_TAX', 'Total before tax')}:
233
+ </OText>
234
+ <OText size={12} lineHeight={18} weight={'400'} color={theme.colors.textNormal}>
235
+ {parsePrice(ordersSummary?.subtotal)}
236
+ </OText>
237
+ </Row>
238
+ <Row>
239
+ <OText size={12} lineHeight={18} weight={'400'} color={theme.colors.textNormal}>
240
+ {t('ESTIMATED_TAX_TO_BE_COLLECTED', 'Estimated tax to be collected')}:
241
+ </OText>
242
+ <OText size={12} lineHeight={18} weight={'400'} color={theme.colors.textNormal}>
243
+ {parsePrice(ordersSummary?.tax)}
244
+ </OText>
245
+ </Row>
246
+ <BorderLine />
247
+ </>
248
+ )}
216
249
  <Row style={{ marginTop: 10 }}>
217
250
  <OText size={14} lineHeight={18} weight={'500'} color={theme.colors.textNormal}>
218
251
  {t('PAYMENT_TOTAL', 'Payment total')}:
@@ -242,12 +275,26 @@ export const MultiOrdersDetailsUI = (props: any) => {
242
275
  navigation={navigation}
243
276
  order={order}
244
277
  handleGoToOrderDetails={handleGoToOrderDetails}
278
+ showProgressBar={showBarInIndividual.includes(progressBarStyle)}
245
279
  />
246
280
  <Divider />
247
281
  </React.Fragment>
248
282
  ))}
249
283
  </>
250
284
  )}
285
+ {!loading && (error || orders?.length === 0) && (
286
+ error?.includes('ERROR_ACCESS_EXPIRED') ? (
287
+ <NotFoundSource
288
+ content={t(error[0], 'Sorry, the order has expired.')}
289
+ />
290
+ ) : (
291
+ <NotFoundSource
292
+ content={t('NOT_FOUND_ORDER', theme?.defaultLanguages?.NOT_FOUND_ORDER || 'Sorry, we couldn\'t find the requested order.')}
293
+ btnTitle={t('ORDERS_REDIRECT', theme?.defaultLanguages?.ORDERS_REDIRECT || 'Go to Orders')}
294
+ onClickButton={navigation.navigate('BusinessList')}
295
+ />
296
+ )
297
+ )}
251
298
  <Divider />
252
299
  </OrdersDetailsContainer>
253
300
  )
@@ -41,7 +41,7 @@ export const SingleOrderContainer = styled.View`
41
41
  padding: 40px 0;
42
42
  `
43
43
  export const StaturBar = styled.View`
44
- margin-top: 30px;
44
+ margin-top: ${(props: any) => props.isOrderDetails ? '10px' : '30px'};
45
45
  margin-bottom: 10px;
46
46
  `
47
47
  export const Icons = styled.View`
@@ -23,20 +23,24 @@ export const MyOrders = (props: any) => {
23
23
  const [isEmptyBusinesses, setIsEmptyBusinesses] = useState(false)
24
24
  const [businessOrderIds, setBusinessOrderIds] = useState([])
25
25
  const [ordersLength, setOrdersLength] = useState({
26
- activeOrdersLength: 0,
26
+ activeOrdersLength: null,
27
27
  previousOrdersLength: 0,
28
28
  });
29
29
  const [selectedOption, setSelectedOption] = useState(!hideOrders ? 'orders' : 'business')
30
30
 
31
31
  const notOrderOptions = ['business', 'products']
32
32
  const allEmpty = (ordersLength?.activeOrdersLength === 0 && ordersLength?.previousOrdersLength === 0) || ((isEmptyBusinesses || businessOrderIds?.length === 0) && hideOrders)
33
+
34
+ const isChewLayout = theme?.header?.components?.layout?.type?.toLowerCase() === 'chew'
35
+ const showNavbar = theme?.bar_menu?.components?.orders?.hidden
36
+ const hideOrdersTheme = theme?.bar_menu?.components?.orders?.hidden
37
+ const hideProductsTab = theme?.orders?.components?.products_tab?.hidden
38
+ const hideBusinessTab = theme?.orders?.components?.business_tab?.hidden
33
39
  const MyOrdersMenu = [
34
- { key: 'orders', value: t('ORDERS', 'Orders') },
35
- { key: 'business', value: t('BUSINESS', 'Business') },
36
- { key: 'products', value: t('PRODUCTS', 'Products') }
40
+ { key: 'orders', value: t('ORDERS', 'Orders'), disabled: false },
41
+ { key: 'business', value: t('BUSINESS', 'Business'), disabled: hideBusinessTab },
42
+ { key: 'products', value: t('PRODUCTS', 'Products'), disabled: hideProductsTab }
37
43
  ]
38
- const isChewLayout = theme?.business_view?.components?.header?.components?.layout?.type === 'chew'
39
-
40
44
  const goToBack = () => navigation?.canGoBack() && navigation.goBack()
41
45
 
42
46
  const handleOnRefresh = () => {
@@ -66,64 +70,64 @@ export const MyOrders = (props: any) => {
66
70
  });
67
71
 
68
72
  return (
69
- <Container noPadding refreshControl={
70
- <RefreshControl
71
- refreshing={refreshing}
72
- onRefresh={() => handleOnRefresh()}
73
- />
74
- }>
75
- {isChewLayout && (
73
+ <Container
74
+ noPadding
75
+ refreshControl={
76
+ <RefreshControl
77
+ refreshing={refreshing}
78
+ onRefresh={() => handleOnRefresh()}
79
+ />
80
+ }
81
+ >
82
+ {(isChewLayout || showNavbar) && (
76
83
  <View style={{
77
- width: '100%',
78
- display: 'flex',
79
- flexDirection: 'row',
80
- alignItems: 'center',
81
- paddingHorizontal: 40
84
+ ...{
85
+ width: '100%',
86
+ display: 'flex',
87
+ flexDirection: 'row',
88
+ alignItems: 'center',
89
+ paddingHorizontal: isChewLayout ? 20 : 40,
90
+ },
91
+ ...props.titleStyle
82
92
  }}>
83
- <OText
84
- size={24}
93
+ {!props.hideBackBtn && (!isChewLayout || (isChewLayout && hideOrdersTheme)) && (
94
+ <OButton
95
+ imgLeftStyle={{ width: 18 }}
96
+ imgRightSrc={null}
85
97
  style={{
86
- marginTop: Platform.OS === 'android' ? 50 : 30,
87
- paddingHorizontal: 20,
88
- textTransform: 'capitalize'
98
+ borderWidth: 0,
99
+ width: 26,
100
+ height: 26,
101
+ backgroundColor: '#FFF',
102
+ borderColor: '#FFF',
103
+ shadowColor: '#FFF',
104
+ paddingLeft: 0,
105
+ paddingRight: 0,
106
+ marginTop: 30,
89
107
  }}
90
- >
91
- <OButton
92
- imgLeftStyle={{ width: 18 }}
93
- imgRightSrc={null}
94
- style={{
95
- borderWidth: 0,
96
- width: 26,
97
- height: 26,
98
- backgroundColor: '#FFF',
99
- borderColor: '#FFF',
100
- shadowColor: '#FFF',
101
- paddingLeft: 0,
102
- paddingRight: 0,
103
- }}
104
- onClick={goToBack}
105
- icon={AntDesignIcon}
106
- iconProps={{
107
- name: 'arrowleft',
108
- size: 26
109
- }}
110
- />
111
- {t('MY_ORDERS', 'My Orders')}
112
- </OText>
108
+ onClick={goToBack}
109
+ icon={AntDesignIcon}
110
+ iconProps={{
111
+ name: 'arrowleft',
112
+ size: 26
113
+ }}
114
+ />
115
+ )}
116
+ <HeaderTitle ph={10} text={t('MY_ORDERS', 'My Orders')} />
113
117
  </View>
114
118
  )}
115
- {!hideOrders && !isChewLayout && (
119
+ {!hideOrders && !isChewLayout && !showNavbar && (
116
120
  <HeaderTitle text={t('MY_ORDERS', 'My Orders')} />
117
121
  )}
118
122
  {!allEmpty && (
119
123
  <ScrollView
120
124
  horizontal
121
125
  style={{ ...styles.container, borderBottomWidth: 1 }}
122
- contentContainerStyle={{ paddingHorizontal: !!businessesSearchList ? 0 : 40 }}
126
+ contentContainerStyle={{ paddingHorizontal: !!businessesSearchList ? 0 : isChewLayout ? 20 : 40 }}
123
127
  showsHorizontalScrollIndicator={false}
124
128
  scrollEventThrottle={16}
125
129
  >
126
- {MyOrdersMenu.filter(option => !hideOrders || option.key !== 'orders').map(option => (
130
+ {MyOrdersMenu.filter(option => (!hideOrders || option.key !== 'orders') && !option.disabled).map(option => (
127
131
  <Tab
128
132
  key={option.key}
129
133
  onPress={() => setSelectedOption(option.key)}
@@ -143,7 +147,7 @@ export const MyOrders = (props: any) => {
143
147
  )}
144
148
  {selectedOption === 'orders' && (
145
149
  <>
146
- <View style={{ paddingLeft: 40, paddingRight: 40 }}>
150
+ <View style={{ paddingHorizontal: isChewLayout ? 20 : 40 }}>
147
151
  <OrdersOption
148
152
  {...props}
149
153
  activeOrders
@@ -153,7 +157,7 @@ export const MyOrders = (props: any) => {
153
157
  refreshOrders={refreshOrders}
154
158
  />
155
159
  </View>
156
- <View style={{ paddingLeft: 40, paddingRight: 40 }}>
160
+ <View style={{ paddingHorizontal: isChewLayout ? 20 : 40 }}>
157
161
  <OrdersOption
158
162
  {...props}
159
163
  ordersLength={ordersLength}