ordering-ui-react-native 0.16.69 → 0.16.70-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 (203) hide show
  1. package/package.json +6 -5
  2. package/src/DeliveryApp.tsx +43 -1
  3. package/src/components/ActiveOrders/styles.tsx +8 -14
  4. package/src/components/BusinessInformation/index.tsx +19 -4
  5. package/src/components/BusinessInformation/styles.tsx +2 -2
  6. package/src/components/BusinessProductsList/index.tsx +10 -10
  7. package/src/components/BusinessesListing/index.tsx +1 -1
  8. package/src/components/Checkout/index.tsx +2 -1
  9. package/src/components/LanguageSelector/index.tsx +21 -16
  10. package/src/components/Messages/index.tsx +2 -2
  11. package/src/components/OrdersOption/index.tsx +54 -56
  12. package/src/components/PaymentOptions/index.tsx +298 -345
  13. package/src/components/PaymentOptionsWebView/index.tsx +119 -120
  14. package/src/components/SingleProductReview/index.tsx +7 -4
  15. package/src/components/StripeElementsForm/index.tsx +25 -16
  16. package/src/components/VerifyPhone/styles.tsx +1 -2
  17. package/src/components/shared/OToast.tsx +4 -4
  18. package/src/types/@fatnlazycat/react-native-recaptcha-v3/index.d.ts +1 -0
  19. package/src/utils/index.tsx +2 -1
  20. package/themes/business/src/components/AcceptOrRejectOrder/index.tsx +260 -238
  21. package/themes/business/src/components/AcceptOrRejectOrder/styles.tsx +6 -4
  22. package/themes/business/src/components/BusinessController/index.tsx +2 -2
  23. package/themes/business/src/components/Chat/index.tsx +31 -31
  24. package/themes/business/src/components/DriverMap/index.tsx +7 -5
  25. package/themes/business/src/components/LoginForm/index.tsx +111 -74
  26. package/themes/business/src/components/MapView/index.tsx +14 -3
  27. package/themes/business/src/components/MessagesOption/index.tsx +11 -1
  28. package/themes/business/src/components/NewOrderNotification/index.tsx +31 -41
  29. package/themes/business/src/components/OrderDetails/OrderContentComponent.tsx +70 -43
  30. package/themes/business/src/components/OrderDetails/OrderHeaderComponent.tsx +3 -3
  31. package/themes/business/src/components/OrdersOption/index.tsx +63 -73
  32. package/themes/business/src/components/OrdersOption/styles.tsx +5 -1
  33. package/themes/business/src/components/OrdersOptionBusiness/index.tsx +15 -1
  34. package/themes/business/src/components/OrdersOptionCity/index.tsx +15 -1
  35. package/themes/business/src/components/OrdersOptionDate/index.tsx +19 -6
  36. package/themes/business/src/components/OrdersOptionDelivery/index.tsx +15 -1
  37. package/themes/business/src/components/OrdersOptionDriver/index.tsx +15 -1
  38. package/themes/business/src/components/OrdersOptionPaymethod/index.tsx +15 -1
  39. package/themes/business/src/components/OrdersOptionStatus/index.tsx +10 -1
  40. package/themes/business/src/components/PreviousMessages/index.tsx +17 -18
  41. package/themes/business/src/components/PreviousOrders/OrderItem.tsx +250 -0
  42. package/themes/business/src/components/PreviousOrders/OrdersGroupedItem.tsx +115 -0
  43. package/themes/business/src/components/PreviousOrders/index.tsx +440 -245
  44. package/themes/business/src/components/PreviousOrders/styles.tsx +31 -3
  45. package/themes/business/src/components/ProductItemAccordion/index.tsx +3 -2
  46. package/themes/business/src/components/ReviewCustomer/index.tsx +39 -15
  47. package/themes/business/src/components/shared/ODropDown.tsx +42 -8
  48. package/themes/business/src/components/shared/ODropDownCalendar.tsx +36 -7
  49. package/themes/business/src/components/shared/OLink.tsx +33 -13
  50. package/themes/business/src/components/shared/OText.tsx +8 -2
  51. package/themes/business/src/types/index.tsx +14 -3
  52. package/themes/business/src/utils/index.tsx +10 -0
  53. package/themes/doordash/src/components/BusinessesListing/index.tsx +1 -1
  54. package/themes/doordash/src/components/LoginForm/index.tsx +1 -2
  55. package/themes/instacart/src/components/BusinessesListing/index.tsx +1 -1
  56. package/themes/kiosk/src/components/BusinessesListing/index.tsx +2 -1
  57. package/themes/kiosk/src/components/Checkout/index.tsx +6 -0
  58. package/themes/kiosk/src/components/LoginForm/index.tsx +121 -10
  59. package/themes/kiosk/src/components/LoginForm/styles.tsx +5 -0
  60. package/themes/kiosk/src/components/NavBar/index.tsx +14 -14
  61. package/themes/kiosk/src/components/OptionCard/index.tsx +1 -1
  62. package/themes/kiosk/src/components/OrderTypeCardSelector/index.tsx +8 -10
  63. package/themes/kiosk/src/components/ProductForm/index.tsx +1 -14
  64. package/themes/kiosk/src/components/shared/OButton.tsx +5 -18
  65. package/themes/kiosk/src/types/index.d.ts +2 -0
  66. package/themes/original/index.tsx +6 -0
  67. package/themes/original/src/components/AddressDetails/index.tsx +10 -8
  68. package/themes/original/src/components/AddressForm/index.tsx +153 -137
  69. package/themes/original/src/components/AddressList/index.tsx +18 -18
  70. package/themes/original/src/components/AddressList/styles.tsx +4 -2
  71. package/themes/original/src/components/AppleLogin/index.tsx +4 -4
  72. package/themes/original/src/components/BusinessBasicInformation/index.tsx +49 -33
  73. package/themes/original/src/components/BusinessController/index.tsx +101 -70
  74. package/themes/original/src/components/BusinessController/styles.tsx +14 -9
  75. package/themes/original/src/components/BusinessInformation/index.tsx +10 -31
  76. package/themes/original/src/components/BusinessItemAccordion/index.tsx +12 -6
  77. package/themes/original/src/components/BusinessListingSearch/BusinessControllerSkeletons/index.tsx +57 -0
  78. package/themes/original/src/components/BusinessListingSearch/MaxSectionItem/index.tsx +59 -0
  79. package/themes/original/src/components/BusinessListingSearch/MaxSectionItem/styles.tsx +13 -0
  80. package/themes/original/src/components/BusinessListingSearch/index.tsx +87 -142
  81. package/themes/original/src/components/BusinessListingSearch/styles.tsx +10 -12
  82. package/themes/original/src/components/BusinessProductsList/SubcategoriesComponent/index.tsx +87 -0
  83. package/themes/original/src/components/BusinessProductsList/SubcategoriesComponent/styles.tsx +12 -0
  84. package/themes/original/src/components/BusinessProductsList/index.tsx +41 -62
  85. package/themes/original/src/components/BusinessProductsList/styles.tsx +0 -3
  86. package/themes/original/src/components/BusinessProductsListing/index.tsx +561 -479
  87. package/themes/original/src/components/BusinessProductsListing/styles.tsx +13 -12
  88. package/themes/original/src/components/BusinessTypeFilter/index.tsx +3 -2
  89. package/themes/original/src/components/BusinessesListing/Layout/Appointment/index.tsx +2 -1
  90. package/themes/original/src/components/BusinessesListing/Layout/Original/index.tsx +93 -98
  91. package/themes/original/src/components/BusinessesListing/Layout/Original/styles.tsx +1 -9
  92. package/themes/original/src/components/BusinessesListing/index.tsx +8 -8
  93. package/themes/original/src/components/Cart/index.tsx +75 -42
  94. package/themes/original/src/components/CartContent/index.tsx +80 -18
  95. package/themes/original/src/components/CartContent/styles.tsx +11 -1
  96. package/themes/original/src/components/Checkout/index.tsx +110 -114
  97. package/themes/original/src/components/Checkout/styles.tsx +4 -3
  98. package/themes/original/src/components/CitiesControl/index.tsx +89 -0
  99. package/themes/original/src/components/CitiesControl/styles.tsx +17 -0
  100. package/themes/original/src/components/DriverTips/index.tsx +47 -37
  101. package/themes/original/src/components/DriverTips/styles.tsx +2 -1
  102. package/themes/original/src/components/Favorite/index.tsx +7 -4
  103. package/themes/original/src/components/Favorite/styles.tsx +1 -1
  104. package/themes/original/src/components/FavoriteList/index.tsx +70 -80
  105. package/themes/original/src/components/FloatingButton/index.tsx +1 -2
  106. package/themes/original/src/components/FloatingButton/styles.tsx +1 -1
  107. package/themes/original/src/components/GPSButton/index.tsx +20 -19
  108. package/themes/original/src/components/GPSButton/styles.ts +3 -3
  109. package/themes/original/src/components/GoogleMap/index.tsx +10 -1
  110. package/themes/original/src/components/Help/index.tsx +7 -7
  111. package/themes/original/src/components/HelpAccountAndPayment/index.tsx +14 -20
  112. package/themes/original/src/components/HelpAccountAndPayment/styles.tsx +6 -0
  113. package/themes/original/src/components/HelpGuide/index.tsx +12 -11
  114. package/themes/original/src/components/HelpGuide/styles.tsx +5 -0
  115. package/themes/original/src/components/HelpOrder/index.tsx +12 -20
  116. package/themes/original/src/components/HelpOrder/styles.tsx +8 -1
  117. package/themes/original/src/components/LanguageSelector/index.tsx +19 -14
  118. package/themes/original/src/components/LastOrder/index.tsx +1 -34
  119. package/themes/original/src/components/LoginForm/Otp/index.tsx +89 -73
  120. package/themes/original/src/components/LoginForm/Otp/styles.tsx +0 -1
  121. package/themes/original/src/components/LoginForm/index.tsx +98 -41
  122. package/themes/original/src/components/LottieAnimation/index.tsx +78 -0
  123. package/themes/original/src/components/MessageListing/index.tsx +7 -40
  124. package/themes/original/src/components/Messages/index.tsx +35 -20
  125. package/themes/original/src/components/MomentOption/index.tsx +17 -11
  126. package/themes/original/src/components/MultiCart/index.tsx +50 -0
  127. package/themes/original/src/components/MultiCartsPaymethodsAndWallets/index.tsx +92 -93
  128. package/themes/original/src/components/MultiCheckout/index.tsx +158 -77
  129. package/themes/original/src/components/MultiOrdersDetails/SingleOrderCard.tsx +37 -224
  130. package/themes/original/src/components/MultiOrdersDetails/index.tsx +85 -34
  131. package/themes/original/src/components/MultiOrdersDetails/styles.tsx +1 -1
  132. package/themes/original/src/components/MyOrders/index.tsx +86 -20
  133. package/themes/original/src/components/NavBar/index.tsx +7 -6
  134. package/themes/original/src/components/NetworkError/index.tsx +5 -3
  135. package/themes/original/src/components/NotFoundSource/index.tsx +2 -1
  136. package/themes/original/src/components/Notifications/index.tsx +144 -0
  137. package/themes/original/src/components/Notifications/styles.tsx +20 -0
  138. package/themes/original/src/components/OrderDetails/index.tsx +115 -215
  139. package/themes/original/src/components/OrderDetails/styles.tsx +15 -2
  140. package/themes/original/src/components/OrderItAgain/index.tsx +46 -43
  141. package/themes/original/src/components/OrderProgress/index.tsx +79 -100
  142. package/themes/original/src/components/OrderProgress/styles.tsx +5 -0
  143. package/themes/original/src/components/OrderSummary/index.tsx +3 -36
  144. package/themes/original/src/components/OrderTypeSelector/index.tsx +13 -6
  145. package/themes/original/src/components/OrdersOption/PreviousBusinessOrdered/index.tsx +94 -98
  146. package/themes/original/src/components/OrdersOption/PreviousProductsOrdered/index.tsx +3 -0
  147. package/themes/original/src/components/OrdersOption/index.tsx +97 -88
  148. package/themes/original/src/components/PaymentOptionStripe/styles.tsx +1 -1
  149. package/themes/original/src/components/PaymentOptionWallet/index.tsx +56 -56
  150. package/themes/original/src/components/PaymentOptions/index.tsx +1 -2
  151. package/themes/original/src/components/PhoneInputNumber/index.tsx +1 -1
  152. package/themes/original/src/components/PlaceSpot/index.tsx +249 -47
  153. package/themes/original/src/components/PlaceSpot/styles.tsx +0 -2
  154. package/themes/original/src/components/PreviousOrders/index.tsx +3 -2
  155. package/themes/original/src/components/ProductForm/index.tsx +212 -253
  156. package/themes/original/src/components/ProductForm/styles.tsx +5 -8
  157. package/themes/original/src/components/ProductItemAccordion/index.tsx +199 -128
  158. package/themes/original/src/components/ProductOptionSubOption/index.tsx +17 -9
  159. package/themes/original/src/components/ProductOptionSubOption/styles.tsx +1 -2
  160. package/themes/original/src/components/ProfessionalFilter/index.tsx +2 -1
  161. package/themes/original/src/components/ProfessionalProfile/index.tsx +19 -8
  162. package/themes/original/src/components/Promotions/index.tsx +234 -220
  163. package/themes/original/src/components/Promotions/styles.tsx +7 -2
  164. package/themes/original/src/components/ReviewDriver/index.tsx +3 -3
  165. package/themes/original/src/components/ReviewOrder/index.tsx +43 -11
  166. package/themes/original/src/components/ReviewOrder/styles.tsx +7 -0
  167. package/themes/original/src/components/ReviewProducts/index.tsx +8 -5
  168. package/themes/original/src/components/ReviewTrigger/index.tsx +27 -9
  169. package/themes/original/src/components/ReviewTrigger/styles.tsx +8 -1
  170. package/themes/original/src/components/ScheduleAccordion/index.tsx +68 -0
  171. package/themes/original/src/components/ScheduleAccordion/styles.tsx +14 -0
  172. package/themes/original/src/components/ServiceForm/index.tsx +328 -264
  173. package/themes/original/src/components/SignupForm/index.tsx +134 -89
  174. package/themes/original/src/components/SingleOrderCard/index.tsx +129 -54
  175. package/themes/original/src/components/SingleOrderCard/styles.tsx +10 -8
  176. package/themes/original/src/components/SingleProductCard/index.tsx +85 -82
  177. package/themes/original/src/components/SingleProductCard/styles.tsx +2 -9
  178. package/themes/original/src/components/SingleProductReview/index.tsx +38 -5
  179. package/themes/original/src/components/SingleProductReview/styles.tsx +12 -0
  180. package/themes/original/src/components/StripeCardsList/index.tsx +1 -1
  181. package/themes/original/src/components/StripeElementsForm/index.tsx +13 -2
  182. package/themes/original/src/components/UpsellingProducts/index.tsx +244 -215
  183. package/themes/original/src/components/UpsellingProducts/styles.tsx +12 -1
  184. package/themes/original/src/components/UserDetails/index.tsx +5 -3
  185. package/themes/original/src/components/UserFormDetails/index.tsx +6 -48
  186. package/themes/original/src/components/UserProfile/index.tsx +58 -35
  187. package/themes/original/src/components/UserProfile/styles.ts +17 -0
  188. package/themes/original/src/components/UserProfileForm/index.tsx +19 -28
  189. package/themes/original/src/components/UserProfileForm/styles.tsx +7 -0
  190. package/themes/original/src/components/WalletTransactions/index.tsx +76 -0
  191. package/themes/original/src/components/WalletTransactions/styles.tsx +13 -0
  192. package/themes/original/src/components/Wallets/index.tsx +230 -164
  193. package/themes/original/src/components/Wallets/styles.tsx +12 -8
  194. package/themes/original/src/components/shared/CardAnimation.tsx +47 -0
  195. package/themes/original/src/components/shared/HeaderTitle.tsx +8 -3
  196. package/themes/original/src/components/shared/OBottomPopup.tsx +6 -4
  197. package/themes/original/src/components/shared/OButton.tsx +9 -4
  198. package/themes/original/src/components/shared/OIcon.tsx +8 -1
  199. package/themes/original/src/components/shared/OInput.tsx +10 -1
  200. package/themes/original/src/layouts/Container.tsx +13 -9
  201. package/themes/original/src/types/index.tsx +44 -6
  202. package/themes/original/src/utils/index.tsx +305 -58
  203. package/themes/uber-eats/src/components/BusinessesListing/index.tsx +1 -1
@@ -1,4 +1,4 @@
1
- import React, { useState, useEffect } from 'react';
1
+ import React, { useState, useEffect, useMemo } from 'react';
2
2
  import { View, StyleSheet, BackHandler, Platform, Linking, RefreshControl } from 'react-native';
3
3
  import LinearGradient from 'react-native-linear-gradient';
4
4
  import { _setStoreData } from '../../providers/StoreUtil';
@@ -10,6 +10,7 @@ import {
10
10
  useConfig
11
11
  } from 'ordering-components/native';
12
12
  import { useTheme } from 'styled-components/native';
13
+ import { showLocation } from 'react-native-map-link';
13
14
  import {
14
15
  OrderDetailsContainer,
15
16
  Header,
@@ -30,20 +31,23 @@ import {
30
31
  OrderDriver,
31
32
  Map,
32
33
  Divider,
33
- OrderAction
34
+ OrderAction,
35
+ PlaceSpotWrapper,
36
+ ProfessionalPhoto
34
37
  } from './styles';
35
38
  import { OButton, OIcon, OModal, OText } from '../shared';
36
39
  import { ProductItemAccordion } from '../ProductItemAccordion';
37
40
  import { TouchableOpacity } from 'react-native-gesture-handler';
38
41
  import { OrderDetailsParams } from '../../types';
39
42
  import { GoogleMap } from '../GoogleMap';
40
- import { verifyDecimals } from '../../utils';
43
+ import { verifyDecimals, getOrderStatus } from '../../utils';
41
44
  import { OSRow } from '../OrderSummary/styles';
42
45
  import AntIcon from 'react-native-vector-icons/AntDesign'
43
46
  import { TaxInformation } from '../TaxInformation';
44
47
  import { Placeholder, PlaceholderLine } from 'rn-placeholder';
45
48
  import NavBar from '../NavBar'
46
49
  import { OrderHistory } from './OrderHistory';
50
+ import { PlaceSpot } from '../PlaceSpot'
47
51
  export const OrderDetailsUI = (props: OrderDetailsParams) => {
48
52
  const {
49
53
  navigation,
@@ -66,6 +70,7 @@ export const OrderDetailsUI = (props: OrderDetailsParams) => {
66
70
  },
67
71
  statusBar: {
68
72
  height: 12,
73
+ borderRadius: 8
69
74
  },
70
75
  logo: {
71
76
  width: 75,
@@ -91,6 +96,12 @@ export const OrderDetailsUI = (props: OrderDetailsParams) => {
91
96
  display: 'flex',
92
97
  alignItems: 'center',
93
98
  flexDirection: 'row'
99
+ },
100
+ professionalBlock: {
101
+ borderBottomColor: theme.colors.border,
102
+ borderBottomWidth: 1,
103
+ marginVertical: 10,
104
+ paddingVertical: 5
94
105
  }
95
106
  });
96
107
 
@@ -105,6 +116,9 @@ export const OrderDetailsUI = (props: OrderDetailsParams) => {
105
116
  const [refreshing] = useState(false);
106
117
  const { order, businessData } = props.order;
107
118
  const mapValidStatuses = [9, 19, 23]
119
+ const placeSpotTypes = [3, 4, 5]
120
+ const directionTypes = [2, 3, 4, 5]
121
+ const enabledPoweredByOrdering = configs?.powered_by_ordering_module?.value
108
122
 
109
123
  const walletName: any = {
110
124
  cash: {
@@ -115,205 +129,6 @@ export const OrderDetailsUI = (props: OrderDetailsParams) => {
115
129
  }
116
130
  }
117
131
 
118
- const getOrderStatus = (s: string) => {
119
- const status = parseInt(s);
120
- const orderStatus = [
121
- {
122
- key: 0,
123
- value: t('PENDING', 'Pending'),
124
- slug: 'PENDING',
125
- percentage: 0.25,
126
- image: theme.images.order.status0,
127
- },
128
- {
129
- key: 1,
130
- value: t('COMPLETED', 'Completed'),
131
- slug: 'COMPLETED',
132
- percentage: 1,
133
- image: theme.images.order.status1,
134
- },
135
- {
136
- key: 2,
137
- value: t('REJECTED', 'Rejected'),
138
- slug: 'REJECTED',
139
- percentage: 0,
140
- image: theme.images.order.status2,
141
- },
142
- {
143
- key: 3,
144
- value: t('DRIVER_IN_BUSINESS', 'Driver in business'),
145
- slug: 'DRIVER_IN_BUSINESS',
146
- percentage: 0.6,
147
- image: theme.images.order.status3,
148
- },
149
- {
150
- key: 4,
151
- value: t('PREPARATION_COMPLETED', 'Preparation Completed'),
152
- slug: 'PREPARATION_COMPLETED',
153
- percentage: 0.7,
154
- image: theme.images.order.status4,
155
- },
156
- {
157
- key: 5,
158
- value: t('REJECTED_BY_BUSINESS', 'Rejected by business'),
159
- slug: 'REJECTED_BY_BUSINESS',
160
- percentage: 0,
161
- image: theme.images.order.status5,
162
- },
163
- {
164
- key: 6,
165
- value: t('REJECTED_BY_DRIVER', 'Rejected by Driver'),
166
- slug: 'REJECTED_BY_DRIVER',
167
- percentage: 0,
168
- image: theme.images.order.status6,
169
- },
170
- {
171
- key: 7,
172
- value: t('ACCEPTED_BY_BUSINESS', 'Accepted by business'),
173
- slug: 'ACCEPTED_BY_BUSINESS',
174
- percentage: 0.35,
175
- image: theme.images.order.status7,
176
- },
177
- {
178
- key: 8,
179
- value: t('ACCEPTED_BY_DRIVER', 'Accepted by driver'),
180
- slug: 'ACCEPTED_BY_DRIVER',
181
- percentage: 0.45,
182
- image: theme.images.order.status8,
183
- },
184
- {
185
- key: 9,
186
- value: t('PICK_UP_COMPLETED_BY_DRIVER', 'Pick up completed by driver'),
187
- slug: 'PICK_UP_COMPLETED_BY_DRIVER',
188
- percentage: 0.8,
189
- image: theme.images.order.status9,
190
- },
191
- {
192
- key: 10,
193
- value: t('PICK_UP_FAILED_BY_DRIVER', 'Pick up Failed by driver'),
194
- slug: 'PICK_UP_FAILED_BY_DRIVER',
195
- percentage: 0,
196
- image: theme.images.order.status10,
197
- },
198
- {
199
- key: 11,
200
- value: t(
201
- 'DELIVERY_COMPLETED_BY_DRIVER',
202
- 'Delivery completed by driver',
203
- ),
204
- slug: 'DELIVERY_COMPLETED_BY_DRIVER',
205
- percentage: 1,
206
- image: theme.images.order.status11,
207
- },
208
- {
209
- key: 12,
210
- value: t('DELIVERY_FAILED_BY_DRIVER', 'Delivery Failed by driver'),
211
- slug: 'DELIVERY_FAILED_BY_DRIVER',
212
- percentage: 0,
213
- image: theme.images.order.status12,
214
- },
215
- {
216
- key: 13,
217
- value: t('PREORDER', 'PreOrder'),
218
- slug: 'PREORDER',
219
- percentage: 0,
220
- image: theme.images.order.status13,
221
- },
222
- {
223
- key: 14,
224
- value: t('ORDER_NOT_READY', 'Order not ready'),
225
- slug: 'ORDER_NOT_READY',
226
- percentage: 0,
227
- image: theme.images.order.status13,
228
- },
229
- {
230
- key: 15,
231
- value: t(
232
- 'ORDER_PICKEDUP_COMPLETED_BY_CUSTOMER',
233
- 'Order picked up completed by customer',
234
- ),
235
- slug: 'ORDER_PICKEDUP_COMPLETED_BY_CUSTOMER',
236
- percentage: 100,
237
- image: theme.images.order.status1,
238
- },
239
- {
240
- key: 16,
241
- value: t('CANCELLED_BY_CUSTOMER', 'Cancelled by customer'),
242
- slug: 'CANCELLED_BY_CUSTOMER',
243
- percentage: 0,
244
- image: theme.images.order.status2,
245
- },
246
- {
247
- key: 17,
248
- value: t(
249
- 'ORDER_NOT_PICKEDUP_BY_CUSTOMER',
250
- 'Order not picked up by customer',
251
- ),
252
- slug: 'ORDER_NOT_PICKEDUP_BY_CUSTOMER',
253
- percentage: 0,
254
- image: theme.images.order.status2,
255
- },
256
- {
257
- key: 18,
258
- value: t(
259
- 'DRIVER_ALMOST_ARRIVED_TO_BUSINESS',
260
- 'Driver almost arrived to business',
261
- ),
262
- slug: 'DRIVER_ALMOST_ARRIVED_TO_BUSINESS',
263
- percentage: 0.15,
264
- image: theme.images.order.status3,
265
- },
266
- {
267
- key: 19,
268
- value: t(
269
- 'DRIVER_ALMOST_ARRIVED_TO_CUSTOMER',
270
- 'Driver almost arrived to customer',
271
- ),
272
- slug: 'DRIVER_ALMOST_ARRIVED_TO_CUSTOMER',
273
- percentage: 0.9,
274
- image: theme.images.order.status11,
275
- },
276
- {
277
- key: 20,
278
- value: t(
279
- 'ORDER_CUSTOMER_ALMOST_ARRIVED_BUSINESS',
280
- 'Customer almost arrived to business',
281
- ),
282
- slug: 'ORDER_CUSTOMER_ALMOST_ARRIVED_BUSINESS',
283
- percentage: 90,
284
- image: theme.images.order.status7,
285
- },
286
- {
287
- key: 21,
288
- value: t(
289
- 'ORDER_CUSTOMER_ARRIVED_BUSINESS',
290
- 'Customer arrived to business',
291
- ),
292
- slug: 'ORDER_CUSTOMER_ARRIVED_BUSINESS',
293
- percentage: 95,
294
- image: theme.images.order.status7,
295
- },
296
- {
297
- key: 22,
298
- value: t('ORDER_LOOKING_FOR_DRIVER', 'Looking for driver'),
299
- slug: 'ORDER_LOOKING_FOR_DRIVER',
300
- percentage: 35,
301
- image: theme.images.order.status8
302
- },
303
- {
304
- key: 23,
305
- value: t('ORDER_DRIVER_ON_WAY', 'Driver on way'),
306
- slug: 'ORDER_DRIVER_ON_WAY',
307
- percentage: 45,
308
- image: theme.images.order.status8
309
- }
310
- ];
311
-
312
- const objectStatus = orderStatus.find((o) => o.key === status);
313
-
314
- return objectStatus && objectStatus;
315
- };
316
-
317
132
  const handleGoToMessages = (type: string) => {
318
133
  readMessages && readMessages();
319
134
  navigation.navigate(
@@ -444,6 +259,59 @@ export const OrderDetailsUI = (props: OrderDetailsParams) => {
444
259
  lng: parseFloat(location?.location?.split(',')[1].replace(/[^-.0-9]/g, ''))
445
260
  } : location)
446
261
 
262
+ const getProductList = () => {
263
+ const professionalList = order?.products.reduce((prev: any, current: any) => {
264
+ const found = prev.find((item: any) => item.id === current?.calendar_event?.professional?.id)
265
+ if (found || !current?.calendar_event) {
266
+ return prev
267
+ }
268
+ return [...prev, current?.calendar_event?.professional]
269
+ }, [])
270
+
271
+ return (
272
+ <>
273
+ {professionalList?.length > 0 && professionalList.map((professional: any, i: number) => (
274
+ <View key={i} style={styles.professionalBlock}>
275
+ <View style={{ flexDirection: 'row', alignItems: 'center', width: '100%' }}>
276
+ {professional?.photo ? (
277
+ <ProfessionalPhoto
278
+ source={{
279
+ uri: professional?.photo
280
+ }}
281
+ imageStyle={{ borderRadius: 8 }}
282
+ />
283
+ ) : (
284
+ <OIcon
285
+ src={theme.images.general.user}
286
+ cover={false}
287
+ width={80}
288
+ height={80}
289
+ />
290
+ )}
291
+ <OText size={12} lineHeight={18} weight={'500'} numberOfLines={1}>{professional?.name} {professional?.lastname}</OText>
292
+ </View>
293
+ {order?.products.filter((product: any) => product?.calendar_event?.professional?.id === professional?.id).map((product: any, i: number) => (
294
+ <ProductItemAccordion
295
+ key={product?.id || i}
296
+ product={product}
297
+ isFromCheckout
298
+ />
299
+ ))}
300
+ </View>
301
+ ))}
302
+ {order?.products.filter((product: any) => !product?.calendar_event).map((product: any, i: number) => (
303
+ <ProductItemAccordion
304
+ key={product?.id || i}
305
+ product={product}
306
+ isFromCheckout
307
+ />
308
+ ))}
309
+ </>
310
+ )
311
+ }
312
+
313
+ const sortedProductList = useMemo(() => getProductList(), [order?.products])
314
+
447
315
  useEffect(() => {
448
316
  if (driverLocation) {
449
317
  parsedLocations[0] = {
@@ -533,6 +401,13 @@ export const OrderDetailsUI = (props: OrderDetailsParams) => {
533
401
  : parseDate(order?.delivery_datetime, { utc: false })}
534
402
  </OText>}
535
403
  />
404
+ {enabledPoweredByOrdering && (
405
+ <View style={{ display: 'flex', justifyContent: 'center', alignItems: 'center' }}>
406
+ <OText>
407
+ Powered By Ordering.co
408
+ </OText>
409
+ </View>
410
+ )}
536
411
  <OrderInfo>
537
412
  <OrderData>
538
413
  <View style={styles.linkWrapper}>
@@ -548,7 +423,7 @@ export const OrderDetailsUI = (props: OrderDetailsParams) => {
548
423
  onPress={() => handleClickOrderReview(order)}
549
424
  >
550
425
  <OText
551
- size={10}
426
+ size={12}
552
427
  lineHeight={15}
553
428
  color={theme.colors.primary}
554
429
  style={{ textDecorationLine: 'underline' }}
@@ -564,7 +439,7 @@ export const OrderDetailsUI = (props: OrderDetailsParams) => {
564
439
 
565
440
  >
566
441
  <OText
567
- size={10}
442
+ size={12}
568
443
  lineHeight={15}
569
444
  color={theme.colors.primary}
570
445
  style={{ textDecorationLine: 'underline', textTransform: 'capitalize' }}
@@ -679,7 +554,39 @@ export const OrderDetailsUI = (props: OrderDetailsParams) => {
679
554
  {order?.business?.address}
680
555
  </OText>
681
556
  </View>
557
+ {directionTypes.includes(order?.delivery_type) && (
558
+ <OButton
559
+ text={t('GET_DIRECTIONS', 'Get Directions')}
560
+ imgRightSrc=''
561
+ textStyle={{ color: theme.colors.white }}
562
+ style={{
563
+ alignSelf: 'center',
564
+ borderRadius: 10,
565
+ marginTop: 30
566
+ }}
567
+ onClick={() => showLocation({
568
+ latitude: order?.business?.location?.lat,
569
+ longitude: order?.business?.location?.lng,
570
+ naverCallerName: 'com.reactnativeappstemplate5',
571
+ dialogTitle: t('GET_DIRECTIONS', 'Get Directions'),
572
+ dialogMessage: t('WHAT_APP_WOULD_YOU_USE', 'What app would you like to use?'),
573
+ cancelText: t('CANCEL', 'Cancel'),
574
+ })}
575
+ />
576
+ )}
682
577
  </OrderBusiness>
578
+
579
+ {placeSpotTypes.includes(order?.delivery_type) && (
580
+ <PlaceSpotWrapper>
581
+ <PlaceSpot
582
+ isInputMode
583
+ cart={order}
584
+ spotNumberDefault={order?.spot_number}
585
+ vehicleDefault={order?.vehicle}
586
+ />
587
+ </PlaceSpotWrapper>
588
+ )}
589
+
683
590
  <View
684
591
  style={{
685
592
  height: 8,
@@ -746,7 +653,7 @@ export const OrderDetailsUI = (props: OrderDetailsParams) => {
746
653
  <>
747
654
  {order?.driver?.location && mapValidStatuses.includes(parseInt(order?.status)) && (
748
655
  <Map>
749
- <GoogleMap
656
+ <GoogleMap
750
657
  location={typeof order?.driver?.location?.location === 'string'
751
658
  ? {
752
659
  lat: parseFloat(driverLocationString[0]),
@@ -860,14 +767,7 @@ export const OrderDetailsUI = (props: OrderDetailsParams) => {
860
767
  </OrderAction>
861
768
  </HeaderInfo>
862
769
  <OrderProducts>
863
- {order?.products?.length &&
864
- order?.products.map((product: any, i: number) => (
865
- <ProductItemAccordion
866
- key={product?.id || i}
867
- product={product}
868
- isFromCheckout
869
- />
870
- ))}
770
+ {sortedProductList}
871
771
  </OrderProducts>
872
772
  <OrderBill>
873
773
  <View style={{ height: 1, backgroundColor: theme.colors.border, marginBottom: 17 }} />
@@ -1035,8 +935,8 @@ export const OrderDetailsUI = (props: OrderDetailsParams) => {
1035
935
  )}
1036
936
  <Total>
1037
937
  <Table>
1038
- <OText size={20} lineHeight={30} weight={'600'} color={theme.colors.textNormal}>{t('TOTAL', 'Total')}</OText>
1039
- <OText size={20} lineHeight={30} weight={'600'} color={theme.colors.textNormal}>
938
+ <OText size={14} style={{ fontWeight: 'bold' }} color={theme.colors.textNormal}>{t('TOTAL', 'Total')}</OText>
939
+ <OText size={14} style={{ fontWeight: 'bold' }} color={theme.colors.textNormal}>
1040
940
  {parsePrice(order?.summary?.total ?? order?.total)}
1041
941
  </OText>
1042
942
  </Table>
@@ -5,7 +5,6 @@ export const OrderDetailsContainer = styled.ScrollView`
5
5
  `
6
6
 
7
7
  export const NavBack = styled.TouchableOpacity`
8
-
9
8
  `
10
9
 
11
10
 
@@ -127,4 +126,18 @@ export const Divider = styled.View`
127
126
  `
128
127
  export const OrderAction = styled.View`
129
128
  flex-direction: row;
130
- `
129
+ `
130
+
131
+ export const PlaceSpotWrapper = styled.View`
132
+ padding-horizontal: 40px;
133
+ `
134
+
135
+ export const ProfessionalPhoto = styled.ImageBackground`
136
+ width: 100%;
137
+ position: relative;
138
+ max-height: 80px;
139
+ height: 80px;
140
+ width: 80px;
141
+ resize-mode: cover;
142
+ margin-right: 10px;
143
+ `;
@@ -19,54 +19,57 @@ export const OrderItAgain = (props: OrderItAgainParams) => {
19
19
  categoryState,
20
20
  currentCart,
21
21
  handleUpdateProducts,
22
- navigation
22
+ navigation,
23
+ searchValue
23
24
  } = props
24
25
 
25
26
  const [, t] = useLanguage()
26
27
  const theme = useTheme()
27
28
  const { width } = Dimensions.get('window');
28
-
29
+ const productsFilterd = productList?.length > 0 && productList.filter((product : any) => !searchValue || product?.name?.toLowerCase()?.includes(searchValue?.toLowerCase()))?.sort((a: any, b:any) => moment(b?.last_ordered_date).valueOf() - moment(a?.last_ordered_date).valueOf())
29
30
  return (
30
- <Container>
31
- <OText
32
- size={16}
33
- lineHeight={24}
34
- color={theme.colors.textNormal}
35
- style={{
36
- fontWeight: '600',
37
- marginBottom: 6
38
- }}
39
- >
40
- {t('ORDER_IT_AGAIN', 'Order it again')}
41
- </OText>
42
- <OText
43
- size={12}
44
- lineHeight={18}
45
- color={theme.colors.disabled}
46
- >
47
- {t('ORDER_IT_AGAIN_DESC', 'Quickly add items from your past orders.')}
48
- </OText>
49
- <ScrollView
50
- horizontal
51
- showsVerticalScrollIndicator={false}
52
- showsHorizontalScrollIndicator={false}
53
- >
54
- {productList?.length > 0 && productList?.sort((a: any, b:any) => moment(b?.last_ordered_date).valueOf() - moment(a?.last_ordered_date).valueOf()).map((product: any, i: number) => (
55
- <ProductWrapper key={'prod_' + product.id + `_${i}`} style={{ width: width - 120, }}>
56
- <SingleProductCard
57
- isSoldOut={product.inventoried && !product.quantity}
58
- product={product}
59
- businessId={businessId}
60
- categoryState={categoryState}
61
- onProductClick={() => onProductClick(product)}
62
- productAddedToCartLength={currentCart?.products?.reduce((productsLength: number, Cproduct: any) => { return productsLength + (Cproduct?.id === product?.id ? Cproduct?.quantity : 0) }, 0)}
63
- handleUpdateProducts={handleUpdateProducts}
64
- navigation={navigation}
65
- isPreviously
66
- />
67
- </ProductWrapper>
68
- ))}
69
- </ScrollView>
70
- </Container>
31
+ productsFilterd?.length > 0 ? (
32
+ <Container>
33
+ <OText
34
+ size={16}
35
+ lineHeight={24}
36
+ color={theme.colors.textNormal}
37
+ style={{
38
+ fontWeight: '600',
39
+ marginBottom: 6
40
+ }}
41
+ >
42
+ {t('ORDER_IT_AGAIN', 'Order it again')}
43
+ </OText>
44
+ <OText
45
+ size={12}
46
+ lineHeight={18}
47
+ color={theme.colors.disabled}
48
+ >
49
+ {t('ORDER_IT_AGAIN_DESC', 'Quickly add items from your past orders.')}
50
+ </OText>
51
+ <ScrollView
52
+ horizontal
53
+ showsVerticalScrollIndicator={false}
54
+ showsHorizontalScrollIndicator={false}
55
+ >
56
+ {productsFilterd.map((product: any, i: number) => (
57
+ <ProductWrapper key={'prod_' + product.id + `_${i}`} style={{ width: width - 120, }}>
58
+ <SingleProductCard
59
+ isSoldOut={product.inventoried && !product.quantity}
60
+ product={product}
61
+ businessId={businessId}
62
+ categoryState={categoryState}
63
+ onProductClick={() => onProductClick(product)}
64
+ productAddedToCartLength={currentCart?.products?.reduce((productsLength: number, Cproduct: any) => { return productsLength + (Cproduct?.id === product?.id ? Cproduct?.quantity : 0) }, 0)}
65
+ handleUpdateProducts={handleUpdateProducts}
66
+ navigation={navigation}
67
+ isPreviously
68
+ />
69
+ </ProductWrapper>
70
+ ))}
71
+ </ScrollView>
72
+ </Container>
73
+ ) : null
71
74
  )
72
75
  }