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,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,9 +17,11 @@ import {
17
17
  InfoBlock,
18
18
  Row,
19
19
  OrdersSummary,
20
- BorderLine
20
+ BorderLine,
21
+ StaturBar
21
22
  } from './styles'
22
23
  import { NotFoundSource } from '../NotFoundSource'
24
+ import LinearGradient from 'react-native-linear-gradient'
23
25
 
24
26
  export const MultiOrdersDetailsUI = (props: any) => {
25
27
  const {
@@ -39,12 +41,21 @@ export const MultiOrdersDetailsUI = (props: any) => {
39
41
  padding: 0,
40
42
  marginLeft: -20
41
43
  },
44
+ statusBar: {
45
+ height: 12,
46
+ }
42
47
  })
43
48
 
44
49
  const { loading, orders, error } = props.ordersList
45
50
  const [, t] = useLanguage()
46
51
  const [{ parsePrice, parseNumber, parseDate }] = useUtils();
47
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']
48
59
 
49
60
  const walletName: any = {
50
61
  cash: {
@@ -155,7 +166,7 @@ export const MultiOrdersDetailsUI = (props: any) => {
155
166
  <OText key={event.id} size={12} lineHeight={18} color={theme.colors.textNormal}>
156
167
  {event?.wallet_event
157
168
  ? walletName[event?.wallet_event?.wallet?.type]?.name
158
- : event?.paymethod?.name}
169
+ : t(event?.paymethod?.name.toUpperCase()?.replace(/ /g, '_'), event?.paymethod?.name)}
159
170
  </OText>
160
171
  ))}
161
172
  </Section>
@@ -186,6 +197,23 @@ export const MultiOrdersDetailsUI = (props: any) => {
186
197
  <OText size={16} lineHeight={24} weight={'500'} color={theme.colors.textNormal} mBottom={20}>
187
198
  {t('ORDER_SUMMARY', 'Order summary')}
188
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>
189
217
  {orders.map((order: any) => (
190
218
  <Row key={order.id}>
191
219
  <OText size={12} lineHeight={18} weight={'400'} color={theme.colors.textNormal}>
@@ -197,23 +225,27 @@ export const MultiOrdersDetailsUI = (props: any) => {
197
225
  </Row>
198
226
  ))}
199
227
  <BorderLine />
200
- <Row>
201
- <OText size={12} lineHeight={18} weight={'400'} color={theme.colors.textNormal}>
202
- {t('TOTAL_BEFORE_TAX', 'Total before tax')}:
203
- </OText>
204
- <OText size={12} lineHeight={18} weight={'400'} color={theme.colors.textNormal}>
205
- {parsePrice(ordersSummary?.subtotal)}
206
- </OText>
207
- </Row>
208
- <Row>
209
- <OText size={12} lineHeight={18} weight={'400'} color={theme.colors.textNormal}>
210
- {t('ESTIMATED_TAX_TO_BE_COLLECTED', 'Estimated tax to be collected')}:
211
- </OText>
212
- <OText size={12} lineHeight={18} weight={'400'} color={theme.colors.textNormal}>
213
- {parsePrice(ordersSummary?.tax)}
214
- </OText>
215
- </Row>
216
- <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
+ )}
217
249
  <Row style={{ marginTop: 10 }}>
218
250
  <OText size={14} lineHeight={18} weight={'500'} color={theme.colors.textNormal}>
219
251
  {t('PAYMENT_TOTAL', 'Payment total')}:
@@ -243,6 +275,7 @@ export const MultiOrdersDetailsUI = (props: any) => {
243
275
  navigation={navigation}
244
276
  order={order}
245
277
  handleGoToOrderDetails={handleGoToOrderDetails}
278
+ showProgressBar={showBarInIndividual.includes(progressBarStyle)}
246
279
  />
247
280
  <Divider />
248
281
  </React.Fragment>
@@ -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,21 +23,25 @@ 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
+ preordersLength: 0
28
29
  });
29
30
  const [selectedOption, setSelectedOption] = useState(!hideOrders ? 'orders' : 'business')
30
31
 
31
32
  const notOrderOptions = ['business', 'products']
32
- const allEmpty = (ordersLength?.activeOrdersLength === 0 && ordersLength?.previousOrdersLength === 0) || ((isEmptyBusinesses || businessOrderIds?.length === 0) && hideOrders)
33
+ const allEmpty = (ordersLength?.activeOrdersLength === 0 && ordersLength?.previousOrdersLength === 0 && ordersLength?.preordersLength === 0) || ((isEmptyBusinesses || businessOrderIds?.length === 0) && hideOrders)
34
+
35
+ const isChewLayout = theme?.header?.components?.layout?.type?.toLowerCase() === 'chew'
36
+ const showNavbar = theme?.bar_menu?.components?.orders?.hidden
37
+ const hideOrdersTheme = theme?.bar_menu?.components?.orders?.hidden
38
+ const hideProductsTab = theme?.orders?.components?.products_tab?.hidden
39
+ const hideBusinessTab = theme?.orders?.components?.business_tab?.hidden
33
40
  const MyOrdersMenu = [
34
- { key: 'orders', value: t('ORDERS', 'Orders') },
35
- { key: 'business', value: t('BUSINESS', 'Business') },
36
- { key: 'products', value: t('PRODUCTS', 'Products') }
41
+ { key: 'orders', value: t('ORDERS', 'Orders'), disabled: false },
42
+ { key: 'business', value: t('BUSINESS', 'Business'), disabled: hideBusinessTab },
43
+ { key: 'products', value: t('PRODUCTS', 'Products'), disabled: hideProductsTab }
37
44
  ]
38
- const isChewLayout = theme?.business_view?.components?.header?.components?.layout?.type === 'chew'
39
- const showNavbar = theme?.bar_menu?.components?.orders?.hidden
40
-
41
45
  const goToBack = () => navigation?.canGoBack() && navigation.goBack()
42
46
 
43
47
  const handleOnRefresh = () => {
@@ -68,7 +72,6 @@ export const MyOrders = (props: any) => {
68
72
 
69
73
  return (
70
74
  <Container
71
- pt={0}
72
75
  noPadding
73
76
  refreshControl={
74
77
  <RefreshControl
@@ -84,12 +87,11 @@ export const MyOrders = (props: any) => {
84
87
  display: 'flex',
85
88
  flexDirection: 'row',
86
89
  alignItems: 'center',
87
- paddingHorizontal: 40,
88
- marginTop: Platform.OS === 'android' ? 50 : 30,
90
+ paddingHorizontal: isChewLayout ? 20 : 40,
89
91
  },
90
92
  ...props.titleStyle
91
93
  }}>
92
- {!props.hideBackBtn && (
94
+ {!props.hideBackBtn && (!isChewLayout || (isChewLayout && hideOrdersTheme)) && (
93
95
  <OButton
94
96
  imgLeftStyle={{ width: 18 }}
95
97
  imgRightSrc={null}
@@ -101,7 +103,8 @@ export const MyOrders = (props: any) => {
101
103
  borderColor: '#FFF',
102
104
  shadowColor: '#FFF',
103
105
  paddingLeft: 0,
104
- paddingRight: 0
106
+ paddingRight: 0,
107
+ marginTop: 30,
105
108
  }}
106
109
  onClick={goToBack}
107
110
  icon={AntDesignIcon}
@@ -111,7 +114,7 @@ export const MyOrders = (props: any) => {
111
114
  }}
112
115
  />
113
116
  )}
114
- <HeaderTitle ph={0} text={t('MY_ORDERS', 'My Orders')} />
117
+ <HeaderTitle ph={10} text={t('MY_ORDERS', 'My Orders')} />
115
118
  </View>
116
119
  )}
117
120
  {!hideOrders && !isChewLayout && !showNavbar && (
@@ -121,11 +124,11 @@ export const MyOrders = (props: any) => {
121
124
  <ScrollView
122
125
  horizontal
123
126
  style={{ ...styles.container, borderBottomWidth: 1 }}
124
- contentContainerStyle={{ paddingHorizontal: !!businessesSearchList ? 0 : 40 }}
127
+ contentContainerStyle={{ paddingHorizontal: !!businessesSearchList ? 0 : isChewLayout ? 20 : 40 }}
125
128
  showsHorizontalScrollIndicator={false}
126
129
  scrollEventThrottle={16}
127
130
  >
128
- {MyOrdersMenu.filter(option => !hideOrders || option.key !== 'orders').map(option => (
131
+ {MyOrdersMenu.filter(option => (!hideOrders || option.key !== 'orders') && !option.disabled).map(option => (
129
132
  <Tab
130
133
  key={option.key}
131
134
  onPress={() => setSelectedOption(option.key)}
@@ -145,19 +148,27 @@ export const MyOrders = (props: any) => {
145
148
  )}
146
149
  {selectedOption === 'orders' && (
147
150
  <>
148
- {ordersLength?.activeOrdersLength > 0 && (
149
- <View style={{ paddingLeft: 40, paddingRight: 40 }}>
150
- <OrdersOption
151
- {...props}
152
- activeOrders
153
- ordersLength={ordersLength}
154
- setOrdersLength={setOrdersLength}
155
- setRefreshOrders={setRefreshOrders}
156
- refreshOrders={refreshOrders}
157
- />
158
- </View>
159
- )}
160
- <View style={{ paddingLeft: 40, paddingRight: 40 }}>
151
+ <View style={{ paddingHorizontal: isChewLayout ? 20 : 40 }}>
152
+ <OrdersOption
153
+ {...props}
154
+ preOrders
155
+ ordersLength={ordersLength}
156
+ setOrdersLength={setOrdersLength}
157
+ setRefreshOrders={setRefreshOrders}
158
+ refreshOrders={refreshOrders}
159
+ />
160
+ </View>
161
+ <View style={{ paddingHorizontal: isChewLayout ? 20 : 40 }}>
162
+ <OrdersOption
163
+ {...props}
164
+ activeOrders
165
+ ordersLength={ordersLength}
166
+ setOrdersLength={setOrdersLength}
167
+ setRefreshOrders={setRefreshOrders}
168
+ refreshOrders={refreshOrders}
169
+ />
170
+ </View>
171
+ <View style={{ paddingHorizontal: isChewLayout ? 20 : 40 }}>
161
172
  <OrdersOption
162
173
  {...props}
163
174
  ordersLength={ordersLength}
@@ -1,3 +1,6 @@
1
+
2
+
3
+
1
4
  import * as React from 'react'
2
5
  import styled, { useTheme } from 'styled-components/native'
3
6
  import { OButton, OIcon, OText } from '../shared'
@@ -9,7 +12,6 @@ const TitleWrapper = styled.View`
9
12
  padding-horizontal: 10px;
10
13
  `
11
14
  const TitleTopWrapper = styled.View`
12
- flex: 1;
13
15
  flex-direction: row;
14
16
  align-items: center;
15
17
  `
@@ -17,8 +19,10 @@ const TitleTopWrapper = styled.View`
17
19
  const btnBackArrow = {
18
20
  borderWidth: 0,
19
21
  backgroundColor: '#FFF',
20
- borderColor: '#FFF',
21
- shadowColor: '#FFF'
22
+ borderColor: '#fff',
23
+ shadowColor: '#FFF',
24
+ paddingLeft: 30,
25
+ paddingRight: 30
22
26
  }
23
27
 
24
28
  interface Props {
@@ -42,6 +46,7 @@ interface Props {
42
46
  paddingTop?: number,
43
47
  isVertical?: boolean,
44
48
  noMargin?: any
49
+ hideArrowLeft?: boolean
45
50
  }
46
51
 
47
52
  const NavBar = (props: Props) => {
@@ -52,8 +57,6 @@ const NavBar = (props: Props) => {
52
57
  background-color: ${theme.colors.white};
53
58
  padding: 10px 20px 20px 0px;
54
59
  flex-direction: row;
55
- justify-content: center;
56
- align-items: center;
57
60
  position: relative;
58
61
  `
59
62
 
@@ -62,18 +65,18 @@ const NavBar = (props: Props) => {
62
65
  }
63
66
  return (
64
67
  <Wrapper style={{ paddingTop: props.paddingTop, ...{ flexDirection: props.isVertical ? 'column' : 'row', alignItems: props.isVertical ? 'flex-start' : 'center' }, ...props.style }}>
65
- <OButton
66
- imgLeftSrc={props.leftImg}
67
- imgLeftStyle={{ width: 18 }}
68
- imgRightSrc={null}
69
- style={{ ...btnBackArrow, ...props.btnStyle, ...props.isVertical ? (I18nManager.isRTL ? { paddingRight: 0 } : { paddingLeft: 0 }) : {} }}
70
- onClick={props?.onActionLeft}
71
- icon={AntDesignIcon}
72
- iconProps={{
73
- name: 'arrowleft',
74
- size: 26
75
- }}
76
- />
68
+ {!props.hideArrowLeft && (
69
+ <OButton
70
+ iconProps={{
71
+ name: 'arrowleft',
72
+ size: 26
73
+ }}
74
+ icon={AntDesignIcon}
75
+ imgRightSrc={null}
76
+ style={{ ...btnBackArrow, ...props.btnStyle, ...props.isVertical ? (I18nManager.isRTL ? { paddingRight: 0 } : { paddingLeft: 0 }) : {} }}
77
+ onClick={props?.onActionLeft}
78
+ />
79
+ )}
77
80
  <TitleTopWrapper>
78
81
  {props.withIcon
79
82
  ? (