ordering-ui-react-native 0.17.2 → 0.17.3-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 (215) hide show
  1. package/package.json +5 -5
  2. package/src/DeliveryApp.tsx +43 -1
  3. package/src/components/ActiveOrders/styles.tsx +8 -14
  4. package/src/components/BusinessInformation/index.tsx +11 -4
  5. package/src/components/BusinessInformation/styles.tsx +2 -2
  6. package/src/components/BusinessesListing/index.tsx +1 -1
  7. package/src/components/OrderCreating/index.tsx +1 -21
  8. package/src/components/OrdersOption/index.tsx +54 -56
  9. package/src/components/PaymentOptionsWebView/index.tsx +119 -120
  10. package/src/components/SingleProductReview/index.tsx +7 -4
  11. package/src/components/StripeMethodForm/index.tsx +1 -1
  12. package/src/components/VerifyPhone/styles.tsx +1 -2
  13. package/src/components/shared/OToast.tsx +4 -4
  14. package/src/utils/index.tsx +7 -1
  15. package/themes/business/index.tsx +2 -0
  16. package/themes/business/src/components/AcceptOrRejectOrder/index.tsx +265 -240
  17. package/themes/business/src/components/AcceptOrRejectOrder/styles.tsx +6 -4
  18. package/themes/business/src/components/BusinessController/index.tsx +0 -1
  19. package/themes/business/src/components/Chat/index.tsx +118 -107
  20. package/themes/business/src/components/DriverMap/index.tsx +22 -9
  21. package/themes/business/src/components/GoogleMap/index.tsx +58 -57
  22. package/themes/business/src/components/LoginForm/Otp/index.tsx +120 -0
  23. package/themes/business/src/components/LoginForm/Otp/styles.tsx +7 -0
  24. package/themes/business/src/components/LoginForm/index.tsx +238 -80
  25. package/themes/business/src/components/LoginForm/styles.tsx +10 -0
  26. package/themes/business/src/components/MapView/index.tsx +18 -7
  27. package/themes/business/src/components/NewOrderNotification/index.tsx +34 -44
  28. package/themes/business/src/components/OrderDetails/Delivery.tsx +4 -3
  29. package/themes/business/src/components/OrderDetails/OrderContentComponent.tsx +96 -50
  30. package/themes/business/src/components/OrderDetails/OrderHeaderComponent.tsx +59 -62
  31. package/themes/business/src/components/OrderDetailsLogistic/index.tsx +195 -0
  32. package/themes/business/src/components/OrderDetailsLogistic/styles.tsx +5 -0
  33. package/themes/business/src/components/OrderMessage/index.tsx +18 -17
  34. package/themes/business/src/components/OrderSummary/index.tsx +113 -121
  35. package/themes/business/src/components/OrdersOption/index.tsx +32 -75
  36. package/themes/business/src/components/PreviousOrders/OrderItem.tsx +250 -0
  37. package/themes/business/src/components/PreviousOrders/OrdersGroupedItem.tsx +115 -0
  38. package/themes/business/src/components/PreviousOrders/index.tsx +445 -243
  39. package/themes/business/src/components/PreviousOrders/styles.tsx +31 -3
  40. package/themes/business/src/components/ProductItemAccordion/index.tsx +27 -3
  41. package/themes/business/src/components/ReviewCustomer/index.tsx +41 -24
  42. package/themes/business/src/components/StoresList/index.tsx +2 -2
  43. package/themes/business/src/components/shared/OLink.tsx +33 -13
  44. package/themes/business/src/components/shared/OModal.tsx +16 -9
  45. package/themes/business/src/components/shared/OText.tsx +8 -2
  46. package/themes/business/src/types/index.tsx +33 -2
  47. package/themes/business/src/utils/index.tsx +51 -0
  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/BusinessesListing/index.tsx +2 -1
  52. package/themes/kiosk/src/components/Checkout/index.tsx +6 -0
  53. package/themes/kiosk/src/components/LoginForm/Otp/index.tsx +92 -0
  54. package/themes/kiosk/src/components/LoginForm/Otp/styles.tsx +7 -0
  55. package/themes/kiosk/src/components/LoginForm/index.tsx +473 -151
  56. package/themes/kiosk/src/components/LoginForm/styles.tsx +14 -1
  57. package/themes/kiosk/src/components/NavBar/index.tsx +14 -14
  58. package/themes/kiosk/src/components/OptionCard/index.tsx +1 -1
  59. package/themes/kiosk/src/components/OrderTypeCardSelector/index.tsx +8 -10
  60. package/themes/kiosk/src/components/PhoneInputNumber/index.tsx +3 -2
  61. package/themes/kiosk/src/components/PhoneInputNumber/styles.tsx +1 -3
  62. package/themes/kiosk/src/components/ProductForm/index.tsx +1 -14
  63. package/themes/kiosk/src/components/shared/OButton.tsx +5 -18
  64. package/themes/kiosk/src/components/shared/OModal.tsx +14 -11
  65. package/themes/kiosk/src/layouts/Container.tsx +7 -1
  66. package/themes/kiosk/src/types/index.d.ts +13 -0
  67. package/themes/kiosk/src/utils/index.tsx +15 -0
  68. package/themes/original/index.tsx +8 -0
  69. package/themes/original/src/components/AddressDetails/index.tsx +29 -11
  70. package/themes/original/src/components/AddressForm/index.tsx +41 -16
  71. package/themes/original/src/components/AddressList/index.tsx +26 -21
  72. package/themes/original/src/components/AddressList/styles.tsx +4 -2
  73. package/themes/original/src/components/AnalyticsSegment/index.tsx +189 -9
  74. package/themes/original/src/components/AppleLogin/index.tsx +4 -4
  75. package/themes/original/src/components/BusinessBasicInformation/index.tsx +125 -82
  76. package/themes/original/src/components/BusinessBasicInformation/styles.tsx +9 -4
  77. package/themes/original/src/components/BusinessController/index.tsx +145 -68
  78. package/themes/original/src/components/BusinessController/styles.tsx +22 -9
  79. package/themes/original/src/components/BusinessFeaturedController/index.tsx +21 -54
  80. package/themes/original/src/components/BusinessFeaturedController/styles.tsx +8 -0
  81. package/themes/original/src/components/BusinessInformation/index.tsx +10 -31
  82. package/themes/original/src/components/BusinessItemAccordion/index.tsx +24 -23
  83. package/themes/original/src/components/BusinessListingSearch/index.tsx +52 -24
  84. package/themes/original/src/components/BusinessPreorder/index.tsx +97 -16
  85. package/themes/original/src/components/BusinessProductsList/index.tsx +20 -11
  86. package/themes/original/src/components/BusinessProductsList/styles.tsx +8 -3
  87. package/themes/original/src/components/BusinessProductsListing/index.tsx +617 -490
  88. package/themes/original/src/components/BusinessProductsListing/styles.tsx +7 -13
  89. package/themes/original/src/components/BusinessReviews/index.tsx +3 -1
  90. package/themes/original/src/components/BusinessTypeFilter/index.tsx +3 -3
  91. package/themes/original/src/components/BusinessesListing/Layout/Appointment/index.tsx +1 -1
  92. package/themes/original/src/components/BusinessesListing/Layout/Original/index.tsx +98 -78
  93. package/themes/original/src/components/BusinessesListing/Layout/Original/styles.tsx +1 -9
  94. package/themes/original/src/components/BusinessesListing/index.tsx +5 -3
  95. package/themes/original/src/components/Cart/index.tsx +88 -43
  96. package/themes/original/src/components/CartContent/index.tsx +102 -3
  97. package/themes/original/src/components/CartContent/styles.tsx +15 -1
  98. package/themes/original/src/components/Checkout/index.tsx +311 -178
  99. package/themes/original/src/components/Checkout/styles.tsx +4 -2
  100. package/themes/original/src/components/CitiesControl/index.tsx +89 -0
  101. package/themes/original/src/components/CitiesControl/styles.tsx +17 -0
  102. package/themes/original/src/components/CouponControl/index.tsx +10 -3
  103. package/themes/original/src/components/DriverTips/index.tsx +52 -37
  104. package/themes/original/src/components/DriverTips/styles.tsx +2 -1
  105. package/themes/original/src/components/Favorite/index.tsx +7 -4
  106. package/themes/original/src/components/Favorite/styles.tsx +1 -1
  107. package/themes/original/src/components/FavoriteList/index.tsx +70 -80
  108. package/themes/original/src/components/FloatingButton/index.tsx +1 -2
  109. package/themes/original/src/components/FloatingButton/styles.tsx +1 -1
  110. package/themes/original/src/components/GPSButton/styles.ts +3 -3
  111. package/themes/original/src/components/GiftCard/GiftCardUI/index.tsx +96 -0
  112. package/themes/original/src/components/GiftCard/GiftCardUI/styles.tsx +5 -0
  113. package/themes/original/src/components/GiftCard/PurchaseGiftCard/index.tsx +100 -0
  114. package/themes/original/src/components/GiftCard/PurchaseGiftCard/styles.tsx +8 -0
  115. package/themes/original/src/components/GiftCard/RedeemGiftCard/index.tsx +178 -0
  116. package/themes/original/src/components/GiftCard/RedeemGiftCard/styles.tsx +8 -0
  117. package/themes/original/src/components/GiftCard/SendGiftCard/index.tsx +165 -0
  118. package/themes/original/src/components/GiftCard/SendGiftCard/styles.tsx +9 -0
  119. package/themes/original/src/components/Help/index.tsx +8 -8
  120. package/themes/original/src/components/HelpAccountAndPayment/index.tsx +11 -22
  121. package/themes/original/src/components/HelpAccountAndPayment/styles.tsx +6 -0
  122. package/themes/original/src/components/HelpGuide/index.tsx +12 -16
  123. package/themes/original/src/components/HelpGuide/styles.tsx +6 -0
  124. package/themes/original/src/components/HelpOrder/index.tsx +12 -25
  125. package/themes/original/src/components/HelpOrder/styles.tsx +8 -1
  126. package/themes/original/src/components/Home/index.tsx +13 -4
  127. package/themes/original/src/components/LanguageSelector/index.tsx +19 -14
  128. package/themes/original/src/components/LastOrder/index.tsx +1 -34
  129. package/themes/original/src/components/LoginForm/Otp/index.tsx +89 -73
  130. package/themes/original/src/components/LoginForm/Otp/styles.tsx +0 -1
  131. package/themes/original/src/components/LoginForm/index.tsx +43 -19
  132. package/themes/original/src/components/LottieAnimation/index.tsx +78 -0
  133. package/themes/original/src/components/MessageListing/index.tsx +16 -42
  134. package/themes/original/src/components/Messages/index.tsx +32 -10
  135. package/themes/original/src/components/MomentOption/index.tsx +195 -88
  136. package/themes/original/src/components/MultiCart/index.tsx +50 -0
  137. package/themes/original/src/components/MultiCartsPaymethodsAndWallets/index.tsx +117 -96
  138. package/themes/original/src/components/MultiCheckout/index.tsx +248 -83
  139. package/themes/original/src/components/MultiOrdersDetails/SingleOrderCard.tsx +37 -224
  140. package/themes/original/src/components/MultiOrdersDetails/index.tsx +67 -20
  141. package/themes/original/src/components/MultiOrdersDetails/styles.tsx +1 -1
  142. package/themes/original/src/components/MyOrders/index.tsx +66 -17
  143. package/themes/original/src/components/NavBar/index.tsx +6 -11
  144. package/themes/original/src/components/Notifications/index.tsx +144 -0
  145. package/themes/original/src/components/Notifications/styles.tsx +20 -0
  146. package/themes/original/src/components/OrderDetails/OrderEta.tsx +59 -0
  147. package/themes/original/src/components/OrderDetails/index.tsx +262 -347
  148. package/themes/original/src/components/OrderDetails/styles.tsx +10 -1
  149. package/themes/original/src/components/OrderItAgain/index.tsx +47 -43
  150. package/themes/original/src/components/OrderProgress/index.tsx +74 -112
  151. package/themes/original/src/components/OrderProgress/styles.tsx +5 -0
  152. package/themes/original/src/components/OrderSummary/index.tsx +68 -29
  153. package/themes/original/src/components/OrderTypeSelector/index.tsx +4 -3
  154. package/themes/original/src/components/OrdersOption/PreviousBusinessOrdered/index.tsx +28 -19
  155. package/themes/original/src/components/OrdersOption/PreviousProductsOrdered/index.tsx +3 -0
  156. package/themes/original/src/components/OrdersOption/index.tsx +76 -83
  157. package/themes/original/src/components/PageBanner/index.tsx +171 -0
  158. package/themes/original/src/components/PageBanner/styles.tsx +11 -0
  159. package/themes/original/src/components/PaymentOptionStripe/styles.tsx +1 -1
  160. package/themes/original/src/components/PaymentOptionWallet/index.tsx +56 -56
  161. package/themes/original/src/components/PaymentOptions/index.tsx +3 -3
  162. package/themes/original/src/components/PhoneInputNumber/index.tsx +3 -3
  163. package/themes/original/src/components/PlaceSpot/index.tsx +12 -6
  164. package/themes/original/src/components/PreviousOrders/index.tsx +3 -2
  165. package/themes/original/src/components/ProductForm/index.tsx +240 -261
  166. package/themes/original/src/components/ProductForm/styles.tsx +4 -7
  167. package/themes/original/src/components/ProductItemAccordion/index.tsx +200 -128
  168. package/themes/original/src/components/ProductOptionSubOption/index.tsx +18 -10
  169. package/themes/original/src/components/ProductOptionSubOption/styles.tsx +1 -2
  170. package/themes/original/src/components/ProfessionalFilter/SingleProfessionalCard/index.tsx +108 -0
  171. package/themes/original/src/components/ProfessionalFilter/index.tsx +20 -49
  172. package/themes/original/src/components/ProfessionalProfile/index.tsx +54 -14
  173. package/themes/original/src/components/Promotions/index.tsx +234 -220
  174. package/themes/original/src/components/Promotions/styles.tsx +10 -3
  175. package/themes/original/src/components/ReviewDriver/index.tsx +3 -3
  176. package/themes/original/src/components/ReviewOrder/index.tsx +43 -11
  177. package/themes/original/src/components/ReviewOrder/styles.tsx +7 -0
  178. package/themes/original/src/components/ReviewProducts/index.tsx +8 -5
  179. package/themes/original/src/components/ReviewTrigger/index.tsx +27 -9
  180. package/themes/original/src/components/ReviewTrigger/styles.tsx +8 -1
  181. package/themes/original/src/components/ScheduleAccordion/index.tsx +68 -0
  182. package/themes/original/src/components/ScheduleAccordion/styles.tsx +14 -0
  183. package/themes/original/src/components/ServiceForm/index.tsx +377 -270
  184. package/themes/original/src/components/Sessions/index.tsx +11 -8
  185. package/themes/original/src/components/Sessions/styles.tsx +5 -0
  186. package/themes/original/src/components/SignupForm/index.tsx +79 -66
  187. package/themes/original/src/components/SingleOrderCard/index.tsx +126 -57
  188. package/themes/original/src/components/SingleOrderCard/styles.tsx +10 -8
  189. package/themes/original/src/components/SingleProductCard/index.tsx +111 -56
  190. package/themes/original/src/components/SingleProductCard/styles.tsx +27 -13
  191. package/themes/original/src/components/SingleProductReview/index.tsx +38 -5
  192. package/themes/original/src/components/SingleProductReview/styles.tsx +12 -0
  193. package/themes/original/src/components/StripeCardsList/index.tsx +1 -1
  194. package/themes/original/src/components/StripeElementsForm/index.tsx +4 -1
  195. package/themes/original/src/components/UpsellingProducts/index.tsx +238 -218
  196. package/themes/original/src/components/UpsellingProducts/styles.tsx +12 -1
  197. package/themes/original/src/components/UserDetails/index.tsx +8 -4
  198. package/themes/original/src/components/UserFormDetails/index.tsx +53 -54
  199. package/themes/original/src/components/UserProfile/index.tsx +58 -35
  200. package/themes/original/src/components/UserProfile/styles.ts +17 -0
  201. package/themes/original/src/components/UserProfileForm/index.tsx +21 -28
  202. package/themes/original/src/components/UserProfileForm/styles.tsx +7 -0
  203. package/themes/original/src/components/Wallets/index.tsx +31 -17
  204. package/themes/original/src/components/Wallets/styles.tsx +2 -0
  205. package/themes/original/src/components/shared/CardAnimation.tsx +47 -0
  206. package/themes/original/src/components/shared/HeaderTitle.tsx +8 -3
  207. package/themes/original/src/components/shared/OBottomPopup.tsx +1 -1
  208. package/themes/original/src/components/shared/OButton.tsx +6 -2
  209. package/themes/original/src/components/shared/OIcon.tsx +8 -1
  210. package/themes/original/src/components/shared/OInput.tsx +10 -1
  211. package/themes/original/src/components/shared/OModal.tsx +3 -3
  212. package/themes/original/src/layouts/Container.tsx +13 -9
  213. package/themes/original/src/types/index.tsx +46 -8
  214. package/themes/original/src/utils/index.tsx +364 -58
  215. 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: {
@@ -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`
@@ -1,9 +1,10 @@
1
1
  import React, { useState, useEffect } from 'react'
2
2
  import { useLanguage } from 'ordering-components/native';
3
- import { View, StyleSheet, RefreshControl } from 'react-native';
3
+ import { View, StyleSheet, RefreshControl, Platform } from 'react-native';
4
+ import AntDesignIcon from 'react-native-vector-icons/AntDesign'
4
5
 
5
6
  import { OrdersOption } from '../OrdersOption'
6
- import { HeaderTitle, OText } from '../shared'
7
+ import { HeaderTitle, OButton, OText } from '../shared'
7
8
  import { ScrollView } from 'react-native-gesture-handler';
8
9
  import { Tab } from './styles'
9
10
  import { useTheme } from 'styled-components/native';
@@ -11,6 +12,7 @@ import { Container } from '../../layouts/Container';
11
12
 
12
13
  export const MyOrders = (props: any) => {
13
14
  const {
15
+ navigation,
14
16
  hideOrders,
15
17
  businessesSearchList
16
18
  } = props
@@ -21,18 +23,25 @@ export const MyOrders = (props: any) => {
21
23
  const [isEmptyBusinesses, setIsEmptyBusinesses] = useState(false)
22
24
  const [businessOrderIds, setBusinessOrderIds] = useState([])
23
25
  const [ordersLength, setOrdersLength] = useState({
24
- activeOrdersLength: 0,
26
+ activeOrdersLength: null,
25
27
  previousOrdersLength: 0,
26
28
  });
27
29
  const [selectedOption, setSelectedOption] = useState(!hideOrders ? 'orders' : 'business')
28
30
 
29
31
  const notOrderOptions = ['business', 'products']
30
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
31
39
  const MyOrdersMenu = [
32
- { key: 'orders', value: t('ORDERS', 'Orders') },
33
- { key: 'business', value: t('BUSINESS', 'Business') },
34
- { 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 }
35
43
  ]
44
+ const goToBack = () => navigation?.canGoBack() && navigation.goBack()
36
45
 
37
46
  const handleOnRefresh = () => {
38
47
  setRefreshOrders(true);
@@ -61,24 +70,64 @@ export const MyOrders = (props: any) => {
61
70
  });
62
71
 
63
72
  return (
64
- <Container noPadding refreshControl={
65
- <RefreshControl
66
- refreshing={refreshing}
67
- onRefresh={() => handleOnRefresh()}
68
- />
69
- }>
70
- {!hideOrders && (
73
+ <Container
74
+ noPadding
75
+ refreshControl={
76
+ <RefreshControl
77
+ refreshing={refreshing}
78
+ onRefresh={() => handleOnRefresh()}
79
+ />
80
+ }
81
+ >
82
+ {(isChewLayout || showNavbar) && (
83
+ <View style={{
84
+ ...{
85
+ width: '100%',
86
+ display: 'flex',
87
+ flexDirection: 'row',
88
+ alignItems: 'center',
89
+ paddingHorizontal: isChewLayout ? 20 : 40,
90
+ },
91
+ ...props.titleStyle
92
+ }}>
93
+ {!props.hideBackBtn && (!isChewLayout || (isChewLayout && hideOrdersTheme)) && (
94
+ <OButton
95
+ imgLeftStyle={{ width: 18 }}
96
+ imgRightSrc={null}
97
+ style={{
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,
107
+ }}
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')} />
117
+ </View>
118
+ )}
119
+ {!hideOrders && !isChewLayout && !showNavbar && (
71
120
  <HeaderTitle text={t('MY_ORDERS', 'My Orders')} />
72
121
  )}
73
122
  {!allEmpty && (
74
123
  <ScrollView
75
124
  horizontal
76
125
  style={{ ...styles.container, borderBottomWidth: 1 }}
77
- contentContainerStyle={{ paddingHorizontal: !!businessesSearchList ? 0 : 40 }}
126
+ contentContainerStyle={{ paddingHorizontal: !!businessesSearchList ? 0 : isChewLayout ? 20 : 40 }}
78
127
  showsHorizontalScrollIndicator={false}
79
128
  scrollEventThrottle={16}
80
129
  >
81
- {MyOrdersMenu.filter(option => !hideOrders || option.key !== 'orders').map(option => (
130
+ {MyOrdersMenu.filter(option => (!hideOrders || option.key !== 'orders') && !option.disabled).map(option => (
82
131
  <Tab
83
132
  key={option.key}
84
133
  onPress={() => setSelectedOption(option.key)}
@@ -98,7 +147,7 @@ export const MyOrders = (props: any) => {
98
147
  )}
99
148
  {selectedOption === 'orders' && (
100
149
  <>
101
- <View style={{ paddingLeft: 40, paddingRight: 40 }}>
150
+ <View style={{ paddingHorizontal: isChewLayout ? 20 : 40 }}>
102
151
  <OrdersOption
103
152
  {...props}
104
153
  activeOrders
@@ -108,7 +157,7 @@ export const MyOrders = (props: any) => {
108
157
  refreshOrders={refreshOrders}
109
158
  />
110
159
  </View>
111
- <View style={{ paddingLeft: 40, paddingRight: 40 }}>
160
+ <View style={{ paddingHorizontal: isChewLayout ? 20 : 40 }}>
112
161
  <OrdersOption
113
162
  {...props}
114
163
  ordersLength={ordersLength}
@@ -9,7 +9,7 @@ const TitleWrapper = styled.View`
9
9
  padding-horizontal: 10px;
10
10
  `
11
11
  const TitleTopWrapper = styled.View`
12
- flex-grow: 1;
12
+ flex: 1;
13
13
  flex-direction: row;
14
14
  align-items: center;
15
15
  `
@@ -40,7 +40,8 @@ interface Props {
40
40
  style?: ViewStyle,
41
41
  titleWrapStyle?: ViewStyle,
42
42
  paddingTop?: number,
43
- isVertical?: boolean
43
+ isVertical?: boolean,
44
+ noMargin?: any
44
45
  }
45
46
 
46
47
  const NavBar = (props: Props) => {
@@ -62,16 +63,11 @@ const NavBar = (props: Props) => {
62
63
  return (
63
64
  <Wrapper style={{ paddingTop: props.paddingTop, ...{ flexDirection: props.isVertical ? 'column' : 'row', alignItems: props.isVertical ? 'flex-start' : 'center' }, ...props.style }}>
64
65
  <OButton
65
- imgLeftSrc={props.leftImg}
66
- imgLeftStyle={{ width: 18 }}
66
+ imgLeftSrc={theme.images.general.arrow_left}
67
+ imgLeftStyle={{ width: 26 }}
67
68
  imgRightSrc={null}
68
69
  style={{ ...btnBackArrow, ...props.btnStyle, ...props.isVertical ? (I18nManager.isRTL ? { paddingRight: 0 } : { paddingLeft: 0 }) : {} }}
69
70
  onClick={props?.onActionLeft}
70
- icon={AntDesignIcon}
71
- iconProps={{
72
- name: 'arrowleft',
73
- size: 26
74
- }}
75
71
  />
76
72
  <TitleTopWrapper>
77
73
  {props.withIcon
@@ -96,10 +92,9 @@ const NavBar = (props: Props) => {
96
92
  style={
97
93
  {
98
94
  textAlign: props.titleAlign ? props.titleAlign : 'center',
99
- marginRight: props.showCall ? 0 : 40,
95
+ marginRight: (props.showCall || !!props.noMargin) ? 0 : 40,
100
96
  color: props.titleColor || theme.colors.textNormal,
101
97
  paddingHorizontal: props.titleAlign == 'left' ? 12 : 0,
102
- width: '100%',
103
98
  ...props.titleStyle,
104
99
  }
105
100
  }