ordering-ui-react-native 0.17.23 → 0.17.24-release

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (211) hide show
  1. package/package.json +8 -7
  2. package/src/DeliveryApp.tsx +43 -1
  3. package/src/components/BusinessesListing/index.tsx +1 -1
  4. package/src/components/OrderCreating/index.tsx +1 -21
  5. package/src/components/PaymentOptionsWebView/index.tsx +119 -120
  6. package/src/components/StripeMethodForm/index.tsx +108 -79
  7. package/src/components/VerifyPhone/styles.tsx +1 -2
  8. package/src/components/shared/OToast.tsx +4 -4
  9. package/src/types/index.tsx +5 -0
  10. package/src/utils/index.tsx +7 -1
  11. package/themes/business/index.tsx +2 -0
  12. package/themes/business/src/components/AcceptOrRejectOrder/index.tsx +265 -240
  13. package/themes/business/src/components/AcceptOrRejectOrder/styles.tsx +6 -4
  14. package/themes/business/src/components/BusinessController/index.tsx +0 -1
  15. package/themes/business/src/components/Chat/index.tsx +118 -107
  16. package/themes/business/src/components/DriverMap/index.tsx +17 -6
  17. package/themes/business/src/components/GoogleMap/index.tsx +58 -57
  18. package/themes/business/src/components/LoginForm/Otp/index.tsx +120 -0
  19. package/themes/business/src/components/LoginForm/Otp/styles.tsx +7 -0
  20. package/themes/business/src/components/LoginForm/index.tsx +238 -80
  21. package/themes/business/src/components/LoginForm/styles.tsx +10 -0
  22. package/themes/business/src/components/MapView/index.tsx +10 -10
  23. package/themes/business/src/components/NewOrderNotification/index.tsx +43 -50
  24. package/themes/business/src/components/OrderDetails/Delivery.tsx +4 -3
  25. package/themes/business/src/components/OrderDetails/OrderContentComponent.tsx +90 -47
  26. package/themes/business/src/components/OrderDetails/OrderHeaderComponent.tsx +59 -62
  27. package/themes/business/src/components/OrderDetailsLogistic/index.tsx +195 -0
  28. package/themes/business/src/components/OrderDetailsLogistic/styles.tsx +5 -0
  29. package/themes/business/src/components/OrderMessage/index.tsx +18 -17
  30. package/themes/business/src/components/OrderSummary/index.tsx +113 -121
  31. package/themes/business/src/components/OrdersOption/index.tsx +32 -75
  32. package/themes/business/src/components/PreviousOrders/OrderItem.tsx +250 -0
  33. package/themes/business/src/components/PreviousOrders/OrdersGroupedItem.tsx +115 -0
  34. package/themes/business/src/components/PreviousOrders/index.tsx +445 -243
  35. package/themes/business/src/components/PreviousOrders/styles.tsx +31 -3
  36. package/themes/business/src/components/ProductItemAccordion/index.tsx +27 -3
  37. package/themes/business/src/components/ReviewCustomer/index.tsx +41 -24
  38. package/themes/business/src/components/StoresList/index.tsx +2 -2
  39. package/themes/business/src/components/shared/OLink.tsx +33 -13
  40. package/themes/business/src/components/shared/OModal.tsx +16 -9
  41. package/themes/business/src/components/shared/OText.tsx +8 -2
  42. package/themes/business/src/types/index.tsx +32 -2
  43. package/themes/business/src/utils/index.tsx +44 -1
  44. package/themes/doordash/src/components/BusinessesListing/index.tsx +1 -1
  45. package/themes/doordash/src/components/LoginForm/index.tsx +1 -2
  46. package/themes/instacart/src/components/BusinessesListing/index.tsx +1 -1
  47. package/themes/kiosk/src/components/BusinessesListing/index.tsx +2 -1
  48. package/themes/kiosk/src/components/Checkout/index.tsx +6 -0
  49. package/themes/kiosk/src/components/LoginForm/Otp/index.tsx +92 -0
  50. package/themes/kiosk/src/components/LoginForm/Otp/styles.tsx +7 -0
  51. package/themes/kiosk/src/components/LoginForm/index.tsx +473 -151
  52. package/themes/kiosk/src/components/LoginForm/styles.tsx +14 -1
  53. package/themes/kiosk/src/components/NavBar/index.tsx +14 -14
  54. package/themes/kiosk/src/components/OptionCard/index.tsx +1 -1
  55. package/themes/kiosk/src/components/OrderTypeCardSelector/index.tsx +8 -10
  56. package/themes/kiosk/src/components/PhoneInputNumber/index.tsx +3 -2
  57. package/themes/kiosk/src/components/PhoneInputNumber/styles.tsx +1 -3
  58. package/themes/kiosk/src/components/ProductForm/index.tsx +1 -14
  59. package/themes/kiosk/src/components/shared/OButton.tsx +5 -18
  60. package/themes/kiosk/src/components/shared/OModal.tsx +14 -11
  61. package/themes/kiosk/src/layouts/Container.tsx +7 -1
  62. package/themes/kiosk/src/types/index.d.ts +13 -0
  63. package/themes/kiosk/src/utils/index.tsx +15 -0
  64. package/themes/original/index.tsx +6 -0
  65. package/themes/original/src/components/AddressDetails/index.tsx +29 -11
  66. package/themes/original/src/components/AddressForm/index.tsx +50 -19
  67. package/themes/original/src/components/AddressList/index.tsx +26 -21
  68. package/themes/original/src/components/AddressList/styles.tsx +4 -2
  69. package/themes/original/src/components/AnalyticsSegment/index.tsx +193 -10
  70. package/themes/original/src/components/AppleLogin/index.tsx +4 -4
  71. package/themes/original/src/components/BusinessBasicInformation/index.tsx +166 -89
  72. package/themes/original/src/components/BusinessBasicInformation/styles.tsx +9 -7
  73. package/themes/original/src/components/BusinessController/index.tsx +145 -68
  74. package/themes/original/src/components/BusinessController/styles.tsx +22 -9
  75. package/themes/original/src/components/BusinessFeaturedController/index.tsx +21 -54
  76. package/themes/original/src/components/BusinessFeaturedController/styles.tsx +8 -0
  77. package/themes/original/src/components/BusinessInformation/index.tsx +10 -31
  78. package/themes/original/src/components/BusinessItemAccordion/index.tsx +23 -22
  79. package/themes/original/src/components/BusinessListingSearch/index.tsx +350 -323
  80. package/themes/original/src/components/BusinessPreorder/index.tsx +97 -16
  81. package/themes/original/src/components/BusinessProductsList/index.tsx +20 -11
  82. package/themes/original/src/components/BusinessProductsList/styles.tsx +8 -3
  83. package/themes/original/src/components/BusinessProductsListing/index.tsx +616 -495
  84. package/themes/original/src/components/BusinessProductsListing/styles.tsx +7 -9
  85. package/themes/original/src/components/BusinessReviews/index.tsx +3 -1
  86. package/themes/original/src/components/BusinessesListing/Layout/Appointment/index.tsx +1 -1
  87. package/themes/original/src/components/BusinessesListing/Layout/Original/index.tsx +105 -78
  88. package/themes/original/src/components/BusinessesListing/Layout/Original/styles.tsx +1 -9
  89. package/themes/original/src/components/BusinessesListing/index.tsx +5 -3
  90. package/themes/original/src/components/Cart/index.tsx +102 -69
  91. package/themes/original/src/components/CartContent/index.tsx +110 -19
  92. package/themes/original/src/components/CartContent/styles.tsx +15 -1
  93. package/themes/original/src/components/Checkout/index.tsx +323 -178
  94. package/themes/original/src/components/Checkout/styles.tsx +4 -2
  95. package/themes/original/src/components/CitiesControl/index.tsx +89 -0
  96. package/themes/original/src/components/CitiesControl/styles.tsx +17 -0
  97. package/themes/original/src/components/CouponControl/index.tsx +10 -3
  98. package/themes/original/src/components/DriverTips/index.tsx +52 -34
  99. package/themes/original/src/components/Favorite/index.tsx +7 -4
  100. package/themes/original/src/components/Favorite/styles.tsx +1 -1
  101. package/themes/original/src/components/FavoriteList/index.tsx +51 -80
  102. package/themes/original/src/components/FloatingButton/index.tsx +1 -2
  103. package/themes/original/src/components/FloatingButton/styles.tsx +1 -1
  104. package/themes/original/src/components/GPSButton/index.tsx +6 -4
  105. package/themes/original/src/components/GPSButton/styles.ts +3 -3
  106. package/themes/original/src/components/GiftCard/GiftCardUI/index.tsx +96 -0
  107. package/themes/original/src/components/GiftCard/GiftCardUI/styles.tsx +5 -0
  108. package/themes/original/src/components/GiftCard/PurchaseGiftCard/index.tsx +100 -0
  109. package/themes/original/src/components/GiftCard/PurchaseGiftCard/styles.tsx +8 -0
  110. package/themes/original/src/components/GiftCard/RedeemGiftCard/index.tsx +178 -0
  111. package/themes/original/src/components/GiftCard/RedeemGiftCard/styles.tsx +8 -0
  112. package/themes/original/src/components/GiftCard/SendGiftCard/index.tsx +165 -0
  113. package/themes/original/src/components/GiftCard/SendGiftCard/styles.tsx +9 -0
  114. package/themes/original/src/components/GoogleMap/index.tsx +4 -2
  115. package/themes/original/src/components/Help/index.tsx +8 -8
  116. package/themes/original/src/components/HelpAccountAndPayment/index.tsx +11 -22
  117. package/themes/original/src/components/HelpAccountAndPayment/styles.tsx +6 -0
  118. package/themes/original/src/components/HelpGuide/index.tsx +12 -16
  119. package/themes/original/src/components/HelpGuide/styles.tsx +6 -0
  120. package/themes/original/src/components/HelpOrder/index.tsx +12 -25
  121. package/themes/original/src/components/HelpOrder/styles.tsx +8 -1
  122. package/themes/original/src/components/Home/index.tsx +13 -4
  123. package/themes/original/src/components/LanguageSelector/index.tsx +17 -13
  124. package/themes/original/src/components/LastOrder/index.tsx +1 -34
  125. package/themes/original/src/components/LoginForm/Otp/index.tsx +89 -73
  126. package/themes/original/src/components/LoginForm/Otp/styles.tsx +0 -1
  127. package/themes/original/src/components/LoginForm/index.tsx +59 -22
  128. package/themes/original/src/components/LottieAnimation/index.tsx +78 -0
  129. package/themes/original/src/components/MessageListing/index.tsx +16 -42
  130. package/themes/original/src/components/Messages/index.tsx +32 -10
  131. package/themes/original/src/components/MomentOption/index.tsx +195 -88
  132. package/themes/original/src/components/MultiCart/index.tsx +50 -0
  133. package/themes/original/src/components/MultiCartsPaymethodsAndWallets/index.tsx +197 -116
  134. package/themes/original/src/components/MultiCheckout/index.tsx +288 -86
  135. package/themes/original/src/components/MultiOrdersDetails/SingleOrderCard.tsx +37 -224
  136. package/themes/original/src/components/MultiOrdersDetails/index.tsx +67 -20
  137. package/themes/original/src/components/MultiOrdersDetails/styles.tsx +1 -1
  138. package/themes/original/src/components/MyOrders/index.tsx +55 -51
  139. package/themes/original/src/components/NavBar/index.tsx +6 -11
  140. package/themes/original/src/components/Notifications/index.tsx +46 -50
  141. package/themes/original/src/components/Notifications/styles.tsx +6 -3
  142. package/themes/original/src/components/OrderDetails/OrderEta.tsx +64 -0
  143. package/themes/original/src/components/OrderDetails/OrderHistory.tsx +15 -3
  144. package/themes/original/src/components/OrderDetails/index.tsx +262 -368
  145. package/themes/original/src/components/OrderDetails/styles.tsx +3 -4
  146. package/themes/original/src/components/OrderItAgain/index.tsx +3 -1
  147. package/themes/original/src/components/OrderProgress/index.tsx +74 -112
  148. package/themes/original/src/components/OrderProgress/styles.tsx +5 -0
  149. package/themes/original/src/components/OrderSummary/index.tsx +87 -59
  150. package/themes/original/src/components/OrderTypeSelector/index.tsx +3 -2
  151. package/themes/original/src/components/OrdersOption/PreviousBusinessOrdered/index.tsx +24 -19
  152. package/themes/original/src/components/OrdersOption/index.tsx +96 -88
  153. package/themes/original/src/components/PageBanner/index.tsx +171 -0
  154. package/themes/original/src/components/PageBanner/styles.tsx +11 -0
  155. package/themes/original/src/components/PaymentOptionStripe/styles.tsx +1 -1
  156. package/themes/original/src/components/PaymentOptionWallet/index.tsx +56 -56
  157. package/themes/original/src/components/PaymentOptions/index.tsx +34 -6
  158. package/themes/original/src/components/PhoneInputNumber/index.tsx +3 -3
  159. package/themes/original/src/components/PlaceSpot/index.tsx +12 -6
  160. package/themes/original/src/components/PreviousOrders/index.tsx +3 -2
  161. package/themes/original/src/components/ProductForm/index.tsx +230 -261
  162. package/themes/original/src/components/ProductForm/styles.tsx +4 -7
  163. package/themes/original/src/components/ProductItemAccordion/index.tsx +197 -138
  164. package/themes/original/src/components/ProductOptionSubOption/index.tsx +18 -10
  165. package/themes/original/src/components/ProductOptionSubOption/styles.tsx +1 -2
  166. package/themes/original/src/components/ProfessionalFilter/SingleProfessionalCard/index.tsx +108 -0
  167. package/themes/original/src/components/ProfessionalFilter/index.tsx +20 -50
  168. package/themes/original/src/components/ProfessionalProfile/index.tsx +36 -7
  169. package/themes/original/src/components/Promotions/index.tsx +234 -220
  170. package/themes/original/src/components/Promotions/styles.tsx +10 -3
  171. package/themes/original/src/components/ReviewDriver/index.tsx +3 -3
  172. package/themes/original/src/components/ReviewOrder/index.tsx +26 -9
  173. package/themes/original/src/components/ReviewOrder/styles.tsx +7 -0
  174. package/themes/original/src/components/ReviewProducts/index.tsx +23 -11
  175. package/themes/original/src/components/ReviewTrigger/index.tsx +27 -9
  176. package/themes/original/src/components/ReviewTrigger/styles.tsx +8 -1
  177. package/themes/original/src/components/ScheduleAccordion/index.tsx +68 -0
  178. package/themes/original/src/components/ScheduleAccordion/styles.tsx +14 -0
  179. package/themes/original/src/components/ServiceForm/index.tsx +366 -288
  180. package/themes/original/src/components/Sessions/index.tsx +11 -8
  181. package/themes/original/src/components/Sessions/styles.tsx +5 -0
  182. package/themes/original/src/components/SignupForm/index.tsx +82 -67
  183. package/themes/original/src/components/SingleOrderCard/index.tsx +149 -63
  184. package/themes/original/src/components/SingleOrderCard/styles.tsx +11 -9
  185. package/themes/original/src/components/SingleProductCard/index.tsx +99 -55
  186. package/themes/original/src/components/SingleProductCard/styles.tsx +27 -13
  187. package/themes/original/src/components/SingleProductReview/index.tsx +8 -2
  188. package/themes/original/src/components/SingleProductReview/styles.tsx +1 -1
  189. package/themes/original/src/components/StripeCardsList/index.tsx +9 -2
  190. package/themes/original/src/components/StripeElementsForm/index.tsx +28 -15
  191. package/themes/original/src/components/UpsellingProducts/index.tsx +238 -224
  192. package/themes/original/src/components/UpsellingProducts/styles.tsx +12 -1
  193. package/themes/original/src/components/UserDetails/index.tsx +8 -4
  194. package/themes/original/src/components/UserFormDetails/index.tsx +47 -7
  195. package/themes/original/src/components/UserProfile/index.tsx +9 -14
  196. package/themes/original/src/components/UserProfileForm/index.tsx +21 -28
  197. package/themes/original/src/components/UserProfileForm/styles.tsx +7 -0
  198. package/themes/original/src/components/WalletTransactionItem/index.tsx +2 -2
  199. package/themes/original/src/components/Wallets/index.tsx +94 -33
  200. package/themes/original/src/components/Wallets/styles.tsx +2 -0
  201. package/themes/original/src/components/shared/CardAnimation.tsx +47 -0
  202. package/themes/original/src/components/shared/HeaderTitle.tsx +8 -3
  203. package/themes/original/src/components/shared/OBottomPopup.tsx +1 -1
  204. package/themes/original/src/components/shared/OButton.tsx +6 -2
  205. package/themes/original/src/components/shared/OIcon.tsx +8 -1
  206. package/themes/original/src/components/shared/OInput.tsx +16 -2
  207. package/themes/original/src/components/shared/OModal.tsx +3 -3
  208. package/themes/original/src/layouts/Container.tsx +13 -9
  209. package/themes/original/src/types/index.tsx +39 -9
  210. package/themes/original/src/utils/index.tsx +375 -58
  211. 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,
@@ -39,7 +40,7 @@ import { ProductItemAccordion } from '../ProductItemAccordion';
39
40
  import { TouchableOpacity } from 'react-native-gesture-handler';
40
41
  import { OrderDetailsParams } from '../../types';
41
42
  import { GoogleMap } from '../GoogleMap';
42
- import { verifyDecimals } from '../../utils';
43
+ import { verifyDecimals, getOrderStatus } from '../../utils';
43
44
  import { OSRow } from '../OrderSummary/styles';
44
45
  import AntIcon from 'react-native-vector-icons/AntDesign'
45
46
  import { TaxInformation } from '../TaxInformation';
@@ -47,6 +48,8 @@ import { Placeholder, PlaceholderLine } from 'rn-placeholder';
47
48
  import NavBar from '../NavBar'
48
49
  import { OrderHistory } from './OrderHistory';
49
50
  import { PlaceSpot } from '../PlaceSpot'
51
+ import { OrderEta } from './OrderEta'
52
+ import { SendGiftCard } from '../GiftCard/SendGiftCard'
50
53
  export const OrderDetailsUI = (props: OrderDetailsParams) => {
51
54
  const {
52
55
  navigation,
@@ -95,6 +98,12 @@ export const OrderDetailsUI = (props: OrderDetailsParams) => {
95
98
  display: 'flex',
96
99
  alignItems: 'center',
97
100
  flexDirection: 'row'
101
+ },
102
+ professionalBlock: {
103
+ borderBottomColor: theme.colors.border,
104
+ borderBottomWidth: 1,
105
+ marginVertical: 10,
106
+ paddingVertical: 5
98
107
  }
99
108
  });
100
109
 
@@ -104,12 +113,18 @@ export const OrderDetailsUI = (props: OrderDetailsParams) => {
104
113
  const [{ carts }] = useOrder()
105
114
 
106
115
  const [isReviewed, setIsReviewed] = useState(false)
116
+ const [isGiftCardSent, setIsGiftCardSent] = useState(false)
107
117
  const [isOrderHistory, setIsOrderHistory] = useState(false)
108
118
  const [openTaxModal, setOpenTaxModal] = useState<any>({ open: false, tax: null, type: '' })
109
119
  const [refreshing] = useState(false);
110
120
  const { order, businessData } = props.order;
111
121
  const mapValidStatuses = [9, 19, 23]
112
122
  const placeSpotTypes = [3, 4, 5]
123
+ const directionTypes = [2, 3, 4, 5]
124
+ const activeStatus = [0, 3, 4, 7, 8, 9, 13, 14, 18, 19, 20, 21, 22, 23]
125
+ const enabledPoweredByOrdering = configs?.powered_by_ordering_module?.value
126
+ const hideDeliveryDate = theme?.confirmation?.components?.order?.components?.date?.hidden
127
+ const isGiftCardOrder = !order?.business_id
113
128
 
114
129
  const walletName: any = {
115
130
  cash: {
@@ -120,205 +135,6 @@ export const OrderDetailsUI = (props: OrderDetailsParams) => {
120
135
  }
121
136
  }
122
137
 
123
- const getOrderStatus = (s: string) => {
124
- const status = parseInt(s);
125
- const orderStatus = [
126
- {
127
- key: 0,
128
- value: t('PENDING', 'Pending'),
129
- slug: 'PENDING',
130
- percentage: 0.25,
131
- image: theme.images.order.status0,
132
- },
133
- {
134
- key: 1,
135
- value: t('COMPLETED', 'Completed'),
136
- slug: 'COMPLETED',
137
- percentage: 1,
138
- image: theme.images.order.status1,
139
- },
140
- {
141
- key: 2,
142
- value: t('REJECTED', 'Rejected'),
143
- slug: 'REJECTED',
144
- percentage: 0,
145
- image: theme.images.order.status2,
146
- },
147
- {
148
- key: 3,
149
- value: t('DRIVER_IN_BUSINESS', 'Driver in business'),
150
- slug: 'DRIVER_IN_BUSINESS',
151
- percentage: 0.6,
152
- image: theme.images.order.status3,
153
- },
154
- {
155
- key: 4,
156
- value: t('PREPARATION_COMPLETED', 'Preparation Completed'),
157
- slug: 'PREPARATION_COMPLETED',
158
- percentage: 0.7,
159
- image: theme.images.order.status4,
160
- },
161
- {
162
- key: 5,
163
- value: t('REJECTED_BY_BUSINESS', 'Rejected by business'),
164
- slug: 'REJECTED_BY_BUSINESS',
165
- percentage: 0,
166
- image: theme.images.order.status5,
167
- },
168
- {
169
- key: 6,
170
- value: t('REJECTED_BY_DRIVER', 'Rejected by Driver'),
171
- slug: 'REJECTED_BY_DRIVER',
172
- percentage: 0,
173
- image: theme.images.order.status6,
174
- },
175
- {
176
- key: 7,
177
- value: t('ACCEPTED_BY_BUSINESS', 'Accepted by business'),
178
- slug: 'ACCEPTED_BY_BUSINESS',
179
- percentage: 0.35,
180
- image: theme.images.order.status7,
181
- },
182
- {
183
- key: 8,
184
- value: t('ACCEPTED_BY_DRIVER', 'Accepted by driver'),
185
- slug: 'ACCEPTED_BY_DRIVER',
186
- percentage: 0.45,
187
- image: theme.images.order.status8,
188
- },
189
- {
190
- key: 9,
191
- value: t('PICK_UP_COMPLETED_BY_DRIVER', 'Pick up completed by driver'),
192
- slug: 'PICK_UP_COMPLETED_BY_DRIVER',
193
- percentage: 0.8,
194
- image: theme.images.order.status9,
195
- },
196
- {
197
- key: 10,
198
- value: t('PICK_UP_FAILED_BY_DRIVER', 'Pick up Failed by driver'),
199
- slug: 'PICK_UP_FAILED_BY_DRIVER',
200
- percentage: 0,
201
- image: theme.images.order.status10,
202
- },
203
- {
204
- key: 11,
205
- value: t(
206
- 'DELIVERY_COMPLETED_BY_DRIVER',
207
- 'Delivery completed by driver',
208
- ),
209
- slug: 'DELIVERY_COMPLETED_BY_DRIVER',
210
- percentage: 1,
211
- image: theme.images.order.status11,
212
- },
213
- {
214
- key: 12,
215
- value: t('DELIVERY_FAILED_BY_DRIVER', 'Delivery Failed by driver'),
216
- slug: 'DELIVERY_FAILED_BY_DRIVER',
217
- percentage: 0,
218
- image: theme.images.order.status12,
219
- },
220
- {
221
- key: 13,
222
- value: t('PREORDER', 'PreOrder'),
223
- slug: 'PREORDER',
224
- percentage: 0,
225
- image: theme.images.order.status13,
226
- },
227
- {
228
- key: 14,
229
- value: t('ORDER_NOT_READY', 'Order not ready'),
230
- slug: 'ORDER_NOT_READY',
231
- percentage: 0,
232
- image: theme.images.order.status13,
233
- },
234
- {
235
- key: 15,
236
- value: t(
237
- 'ORDER_PICKEDUP_COMPLETED_BY_CUSTOMER',
238
- 'Order picked up completed by customer',
239
- ),
240
- slug: 'ORDER_PICKEDUP_COMPLETED_BY_CUSTOMER',
241
- percentage: 100,
242
- image: theme.images.order.status1,
243
- },
244
- {
245
- key: 16,
246
- value: t('CANCELLED_BY_CUSTOMER', 'Cancelled by customer'),
247
- slug: 'CANCELLED_BY_CUSTOMER',
248
- percentage: 0,
249
- image: theme.images.order.status2,
250
- },
251
- {
252
- key: 17,
253
- value: t(
254
- 'ORDER_NOT_PICKEDUP_BY_CUSTOMER',
255
- 'Order not picked up by customer',
256
- ),
257
- slug: 'ORDER_NOT_PICKEDUP_BY_CUSTOMER',
258
- percentage: 0,
259
- image: theme.images.order.status2,
260
- },
261
- {
262
- key: 18,
263
- value: t(
264
- 'DRIVER_ALMOST_ARRIVED_TO_BUSINESS',
265
- 'Driver almost arrived to business',
266
- ),
267
- slug: 'DRIVER_ALMOST_ARRIVED_TO_BUSINESS',
268
- percentage: 0.15,
269
- image: theme.images.order.status3,
270
- },
271
- {
272
- key: 19,
273
- value: t(
274
- 'DRIVER_ALMOST_ARRIVED_TO_CUSTOMER',
275
- 'Driver almost arrived to customer',
276
- ),
277
- slug: 'DRIVER_ALMOST_ARRIVED_TO_CUSTOMER',
278
- percentage: 0.9,
279
- image: theme.images.order.status11,
280
- },
281
- {
282
- key: 20,
283
- value: t(
284
- 'ORDER_CUSTOMER_ALMOST_ARRIVED_BUSINESS',
285
- 'Customer almost arrived to business',
286
- ),
287
- slug: 'ORDER_CUSTOMER_ALMOST_ARRIVED_BUSINESS',
288
- percentage: 90,
289
- image: theme.images.order.status7,
290
- },
291
- {
292
- key: 21,
293
- value: t(
294
- 'ORDER_CUSTOMER_ARRIVED_BUSINESS',
295
- 'Customer arrived to business',
296
- ),
297
- slug: 'ORDER_CUSTOMER_ARRIVED_BUSINESS',
298
- percentage: 95,
299
- image: theme.images.order.status7,
300
- },
301
- {
302
- key: 22,
303
- value: t('ORDER_LOOKING_FOR_DRIVER', 'Looking for driver'),
304
- slug: 'ORDER_LOOKING_FOR_DRIVER',
305
- percentage: 35,
306
- image: theme.images.order.status8
307
- },
308
- {
309
- key: 23,
310
- value: t('ORDER_DRIVER_ON_WAY', 'Driver on way'),
311
- slug: 'ORDER_DRIVER_ON_WAY',
312
- percentage: 45,
313
- image: theme.images.order.status8
314
- }
315
- ];
316
-
317
- const objectStatus = orderStatus.find((o) => o.key === status);
318
-
319
- return objectStatus && objectStatus;
320
- };
321
-
322
138
  const handleGoToMessages = (type: string) => {
323
139
  readMessages && readMessages();
324
140
  navigation.navigate(
@@ -449,6 +265,59 @@ export const OrderDetailsUI = (props: OrderDetailsParams) => {
449
265
  lng: parseFloat(location?.location?.split(',')[1].replace(/[^-.0-9]/g, ''))
450
266
  } : location)
451
267
 
268
+ const getProductList = () => {
269
+ const professionalList = order?.products.reduce((prev: any, current: any) => {
270
+ const found = prev.find((item: any) => item.id === current?.calendar_event?.professional?.id)
271
+ if (found || !current?.calendar_event) {
272
+ return prev
273
+ }
274
+ return [...prev, current?.calendar_event?.professional]
275
+ }, [])
276
+
277
+ return (
278
+ <>
279
+ {professionalList?.length > 0 && professionalList.map((professional: any, i: number) => (
280
+ <View key={i} style={styles.professionalBlock}>
281
+ <View style={{ flexDirection: 'row', alignItems: 'center', width: '100%' }}>
282
+ {professional?.photo ? (
283
+ <ProfessionalPhoto
284
+ source={{
285
+ uri: professional?.photo
286
+ }}
287
+ imageStyle={{ borderRadius: 8 }}
288
+ />
289
+ ) : (
290
+ <OIcon
291
+ src={theme.images.general.user}
292
+ cover={false}
293
+ width={80}
294
+ height={80}
295
+ />
296
+ )}
297
+ <OText size={12} lineHeight={18} weight={'500'} numberOfLines={1}>{professional?.name} {professional?.lastname}</OText>
298
+ </View>
299
+ {order?.products.filter((product: any) => product?.calendar_event?.professional?.id === professional?.id).map((product: any, i: number) => (
300
+ <ProductItemAccordion
301
+ key={product?.id || i}
302
+ product={product}
303
+ isFromCheckout
304
+ />
305
+ ))}
306
+ </View>
307
+ ))}
308
+ {order?.products.filter((product: any) => !product?.calendar_event).map((product: any, i: number) => (
309
+ <ProductItemAccordion
310
+ key={product?.id || i}
311
+ product={product}
312
+ isFromCheckout
313
+ />
314
+ ))}
315
+ </>
316
+ )
317
+ }
318
+
319
+ const sortedProductList = useMemo(() => getProductList(), [order?.products])
320
+
452
321
  useEffect(() => {
453
322
  if (driverLocation) {
454
323
  parsedLocations[0] = {
@@ -532,161 +401,194 @@ export const OrderDetailsUI = (props: OrderDetailsParams) => {
532
401
  style={{ marginTop: Platform.OS === 'ios' ? 0 : 20 }}
533
402
  titleWrapStyle={{ paddingHorizontal: 0 }}
534
403
  titleStyle={{ marginRight: 0, marginLeft: 0 }}
535
- subTitle={<OText size={12} lineHeight={18} color={theme.colors.textNormal}>
536
- {order?.delivery_datetime_utc
537
- ? parseDate(order?.delivery_datetime_utc)
538
- : parseDate(order?.delivery_datetime, { utc: false })}
404
+ subTitle={!hideDeliveryDate && <OText size={12} lineHeight={18} color={theme.colors.textNormal}>
405
+ {activeStatus.includes(order?.status) ? (
406
+ <OrderEta order={order} />
407
+ ) : (
408
+ parseDate(order?.reporting_data?.at[`status:${order.status}`])
409
+ )}
539
410
  </OText>}
540
411
  />
541
- <OrderInfo>
542
- <OrderData>
543
- <View style={styles.linkWrapper}>
544
- {
545
- (
546
- parseInt(order?.status) === 1 ||
547
- parseInt(order?.status) === 11 ||
548
- parseInt(order?.status) === 15
549
- ) && !order.review && !isReviewed && (
550
- <TouchableOpacity
551
- activeOpacity={0.7}
552
- style={{ marginTop: 6, marginRight: 10 }}
553
- onPress={() => handleClickOrderReview(order)}
554
- >
555
- <OText
556
- size={10}
557
- lineHeight={15}
558
- color={theme.colors.primary}
559
- style={{ textDecorationLine: 'underline' }}
412
+ {enabledPoweredByOrdering && (
413
+ <View style={{ display: 'flex', justifyContent: 'center', alignItems: 'center' }}>
414
+ <OText>
415
+ Powered By Ordering.co
416
+ </OText>
417
+ </View>
418
+ )}
419
+ {!isGiftCardOrder && (
420
+ <OrderInfo>
421
+ <OrderData>
422
+ <View style={styles.linkWrapper}>
423
+ {
424
+ (
425
+ parseInt(order?.status) === 1 ||
426
+ parseInt(order?.status) === 11 ||
427
+ parseInt(order?.status) === 15
428
+ ) && !order.review && !isReviewed && (
429
+ <TouchableOpacity
430
+ activeOpacity={0.7}
431
+ style={{ marginTop: 6, marginRight: 10 }}
432
+ onPress={() => handleClickOrderReview(order)}
560
433
  >
561
- {t('REVIEW_YOUR_ORDER', 'Review your order')}
562
- </OText>
563
- </TouchableOpacity>
564
- )}
565
- <TouchableOpacity
566
- activeOpacity={0.7}
567
- style={{ marginTop: 6 }}
568
- onPress={() => setIsOrderHistory(true)}
569
-
570
- >
571
- <OText
572
- size={10}
573
- lineHeight={15}
574
- color={theme.colors.primary}
575
- style={{ textDecorationLine: 'underline', textTransform: 'capitalize' }}
434
+ <OText
435
+ size={12}
436
+ lineHeight={15}
437
+ color={theme.colors.primary}
438
+ style={{ textDecorationLine: 'underline' }}
439
+ >
440
+ {t('REVIEW_YOUR_ORDER', 'Review your order')}
441
+ </OText>
442
+ </TouchableOpacity>
443
+ )}
444
+ <TouchableOpacity
445
+ activeOpacity={0.7}
446
+ style={{ marginTop: 6 }}
447
+ onPress={() => setIsOrderHistory(true)}
448
+
576
449
  >
577
- {t('VIEW_DETAILS', 'View Details')}
578
- </OText>
579
- </TouchableOpacity>
580
- </View>
581
-
582
- <StaturBar>
583
- <LinearGradient
584
- start={{ x: 0.0, y: 0.0 }}
585
- end={{
586
- x: getOrderStatus(order?.status)?.percentage || 0,
587
- y: 0,
588
- }}
589
- locations={[0.9999, 0.9999]}
590
- colors={[theme.colors.primary, theme.colors.backgroundGray100]}
591
- style={styles.statusBar}
592
- />
593
- </StaturBar>
450
+ <OText
451
+ size={12}
452
+ lineHeight={15}
453
+ color={theme.colors.primary}
454
+ style={{ textDecorationLine: 'underline', textTransform: 'capitalize' }}
455
+ >
456
+ {t('VIEW_DETAILS', 'View Details')}
457
+ </OText>
458
+ </TouchableOpacity>
459
+ </View>
460
+
461
+ <StaturBar>
462
+ <LinearGradient
463
+ start={{ x: 0.0, y: 0.0 }}
464
+ end={{
465
+ x: getOrderStatus(order?.status)?.percentage || 0,
466
+ y: 0,
467
+ }}
468
+ locations={[0.9999, 0.9999]}
469
+ colors={[theme.colors.primary, theme.colors.backgroundGray100]}
470
+ style={styles.statusBar}
471
+ />
472
+ </StaturBar>
473
+ <OText
474
+ size={16}
475
+ lineHeight={24}
476
+ weight={'600'}
477
+ color={theme.colors.textNormal}>
478
+ {getOrderStatus(order?.status)?.value}
479
+ </OText>
480
+ </OrderData>
481
+ <View
482
+ style={{
483
+ height: 8,
484
+ backgroundColor: theme.colors.backgroundGray100,
485
+ marginTop: 18,
486
+ marginHorizontal: -40,
487
+ }}
488
+ />
489
+ </OrderInfo>
490
+ )}
491
+ </Header>
492
+ <OrderContent>
493
+ {!isGiftCardOrder && (
494
+ <OrderBusiness>
594
495
  <OText
595
496
  size={16}
596
497
  lineHeight={24}
597
- weight={'600'}
598
- color={theme.colors.textNormal}>
599
- {getOrderStatus(order?.status)?.value}
498
+ weight={'500'}
499
+ color={theme.colors.textNormal}
500
+ mBottom={12}>
501
+ {t('FROM', 'From')}
600
502
  </OText>
601
- </OrderData>
602
- <View
603
- style={{
604
- height: 8,
605
- backgroundColor: theme.colors.backgroundGray100,
606
- marginTop: 18,
607
- marginHorizontal: -40,
608
- }}
609
- />
610
- </OrderInfo>
611
- </Header>
612
- <OrderContent>
613
- <OrderBusiness>
614
- <OText
615
- size={16}
616
- lineHeight={24}
617
- weight={'500'}
618
- color={theme.colors.textNormal}
619
- mBottom={12}>
620
- {t('FROM', 'From')}
621
- </OText>
622
- <View
623
- style={{
624
- display: 'flex',
625
- flexDirection: 'column',
626
- alignItems: 'flex-start',
627
- }}>
628
503
  <View
629
504
  style={{
630
- flexDirection: 'row',
631
- alignItems: 'center',
632
- justifyContent: 'space-between',
505
+ display: 'flex',
506
+ flexDirection: 'column',
507
+ alignItems: 'flex-start',
633
508
  }}>
634
- <OText
635
- size={13}
636
- lineHeight={20}
637
- color={theme.colors.textNormal}
638
- style={{ flexGrow: 1, flexBasis: '80%' }}>
639
- {order?.business?.name}
640
- </OText>
641
- <Icons>
642
- {!!order?.business?.cellphone && (
509
+ <View
510
+ style={{
511
+ flexDirection: 'row',
512
+ alignItems: 'center',
513
+ justifyContent: 'space-between',
514
+ }}>
515
+ <OText
516
+ size={13}
517
+ lineHeight={20}
518
+ color={theme.colors.textNormal}
519
+ style={{ flexGrow: 1, flexBasis: '80%' }}>
520
+ {order?.business?.name}
521
+ </OText>
522
+ <Icons>
523
+ {!!order?.business?.cellphone && (
524
+ <TouchableOpacity
525
+ onPress={() => order?.business?.cellphone &&
526
+ Linking.openURL(`tel:${order?.business?.cellphone}`)
527
+ }
528
+ style={{ paddingEnd: 5 }}
529
+ >
530
+ <OIcon
531
+ src={theme.images.general.phone}
532
+ width={16}
533
+ color={theme.colors.disabled}
534
+ />
535
+ </TouchableOpacity>
536
+ )}
643
537
  <TouchableOpacity
644
- onPress={() => order?.business?.cellphone &&
645
- Linking.openURL(`tel:${order?.business?.cellphone}`)
646
- }
647
- style={{ paddingEnd: 5 }}
648
- >
538
+ style={{ paddingStart: 5 }}
539
+ onPress={() => handleGoToMessages('business')}>
649
540
  <OIcon
650
- src={theme.images.general.phone}
541
+ src={theme.images.general.chat}
651
542
  width={16}
652
543
  color={theme.colors.disabled}
653
544
  />
654
545
  </TouchableOpacity>
655
- )}
656
- <TouchableOpacity
657
- style={{ paddingStart: 5 }}
658
- onPress={() => handleGoToMessages('business')}>
659
- <OIcon
660
- src={theme.images.general.chat}
661
- width={16}
662
- color={theme.colors.disabled}
663
- />
664
- </TouchableOpacity>
665
- </Icons>
666
- </View>
667
- <OText
668
- size={12}
669
- lineHeight={18}
670
- color={theme.colors.textNormal}
671
- mBottom={2}>
672
- {order?.business?.email}
673
- </OText>
674
- {!!order?.business?.cellphone && (
546
+ </Icons>
547
+ </View>
675
548
  <OText
676
549
  size={12}
677
550
  lineHeight={18}
678
551
  color={theme.colors.textNormal}
679
552
  mBottom={2}>
680
- {order?.business?.cellphone}
553
+ {order?.business?.email}
681
554
  </OText>
555
+ {!!order?.business?.cellphone && (
556
+ <OText
557
+ size={12}
558
+ lineHeight={18}
559
+ color={theme.colors.textNormal}
560
+ mBottom={2}>
561
+ {order?.business?.cellphone}
562
+ </OText>
563
+ )}
564
+ <OText size={12} lineHeight={18} color={theme.colors.textNormal}>
565
+ {order?.business?.address}
566
+ </OText>
567
+ </View>
568
+ {directionTypes.includes(order?.delivery_type) && (
569
+ <OButton
570
+ text={t('GET_DIRECTIONS', 'Get Directions')}
571
+ imgRightSrc=''
572
+ textStyle={{ color: theme.colors.white }}
573
+ style={{
574
+ alignSelf: 'center',
575
+ borderRadius: 10,
576
+ marginTop: 30
577
+ }}
578
+ onClick={() => showLocation({
579
+ latitude: order?.business?.location?.lat,
580
+ longitude: order?.business?.location?.lng,
581
+ naverCallerName: 'com.reactnativeappstemplate5',
582
+ dialogTitle: t('GET_DIRECTIONS', 'Get Directions'),
583
+ dialogMessage: t('WHAT_APP_WOULD_YOU_USE', 'What app would you like to use?'),
584
+ cancelText: t('CANCEL', 'Cancel'),
585
+ })}
586
+ />
682
587
  )}
683
- <OText size={12} lineHeight={18} color={theme.colors.textNormal}>
684
- {order?.business?.address}
685
- </OText>
686
- </View>
687
- </OrderBusiness>
588
+ </OrderBusiness>
589
+ )}
688
590
 
689
- {placeSpotTypes.includes(order?.delivery_type) && (
591
+ {!isGiftCardOrder && placeSpotTypes.includes(order?.delivery_type) && (
690
592
  <PlaceSpotWrapper>
691
593
  <PlaceSpot
692
594
  isInputMode
@@ -712,7 +614,7 @@ export const OrderDetailsUI = (props: OrderDetailsParams) => {
712
614
  weight={'500'}
713
615
  color={theme.colors.textNormal}
714
616
  mBottom={12}>
715
- {t('TO', 'To')}
617
+ {isGiftCardOrder ? t('CUSTOMER', 'Customer') : t('TO', 'To')}
716
618
  </OText>
717
619
  <Customer>
718
620
  <InfoBlock>
@@ -741,7 +643,7 @@ export const OrderDetailsUI = (props: OrderDetailsParams) => {
741
643
  )}
742
644
  </InfoBlock>
743
645
  </Customer>
744
- {order?.delivery_option !== undefined && order?.delivery_type === 1 && (
646
+ {!isGiftCardOrder && order?.delivery_option !== undefined && order?.delivery_type === 1 && (
745
647
  <View style={{ marginTop: 15 }}>
746
648
  <OText size={16} style={{ textAlign: 'left' }} color={theme.colors.textNormal}>
747
649
  {t('DELIVERY_PREFERENCE', 'Delivery Preference')}
@@ -763,7 +665,7 @@ export const OrderDetailsUI = (props: OrderDetailsParams) => {
763
665
  <>
764
666
  {order?.driver?.location && mapValidStatuses.includes(parseInt(order?.status)) && (
765
667
  <Map>
766
- <GoogleMap
668
+ <GoogleMap
767
669
  location={typeof order?.driver?.location?.location === 'string'
768
670
  ? {
769
671
  lat: parseFloat(driverLocationString[0]),
@@ -877,34 +779,7 @@ export const OrderDetailsUI = (props: OrderDetailsParams) => {
877
779
  </OrderAction>
878
780
  </HeaderInfo>
879
781
  <OrderProducts>
880
- {!!order?.products[0]?.calendar_event?.professional && (
881
- <View style={{ flexDirection: 'row', alignItems: 'center', width: '100%' }}>
882
- {!!order?.products[0]?.calendar_event?.professional?.photo ? (
883
- <ProfessionalPhoto
884
- source={{
885
- uri: order?.products[0]?.calendar_event?.professional?.photo
886
- }}
887
- imageStyle={{ borderRadius: 8 }}
888
- />
889
- ) : (
890
- <OIcon
891
- src={theme.images.general.user}
892
- cover={false}
893
- width={82}
894
- height={82}
895
- />
896
- )}
897
- <OText size={12} lineHeight={18} weight={'500'} numberOfLines={1}>{order?.products[0]?.calendar_event?.professional?.name} {order?.products[0]?.calendar_event?.professional?.lastname}</OText>
898
- </View>
899
- )}
900
- {order?.products?.length &&
901
- order?.products.map((product: any, i: number) => (
902
- <ProductItemAccordion
903
- key={product?.id || i}
904
- product={product}
905
- isFromCheckout
906
- />
907
- ))}
782
+ {sortedProductList}
908
783
  </OrderProducts>
909
784
  <OrderBill>
910
785
  <View style={{ height: 1, backgroundColor: theme.colors.border, marginBottom: 17 }} />
@@ -950,7 +825,9 @@ export const OrderDetailsUI = (props: OrderDetailsParams) => {
950
825
  </Table>
951
826
  ))
952
827
  }
953
- <Divider />
828
+ {!isGiftCardOrder && (
829
+ <Divider />
830
+ )}
954
831
  {order?.summary?.subtotal_with_discount > 0 && order?.summary?.discount > 0 && order?.summary?.total >= 0 && (
955
832
  <Table>
956
833
  <OText size={12} lineHeight={18} weight={'400'} color={theme.colors.textNormal}>{t('SUBTOTAL_WITH_DISCOUNT', 'Subtotal with discount')}</OText>
@@ -1072,8 +949,8 @@ export const OrderDetailsUI = (props: OrderDetailsParams) => {
1072
949
  )}
1073
950
  <Total>
1074
951
  <Table>
1075
- <OText size={20} lineHeight={30} weight={'600'} color={theme.colors.textNormal}>{t('TOTAL', 'Total')}</OText>
1076
- <OText size={20} lineHeight={30} weight={'600'} color={theme.colors.textNormal}>
952
+ <OText size={14} style={{ fontWeight: 'bold' }} color={theme.colors.textNormal}>{t('TOTAL', 'Total')}</OText>
953
+ <OText size={14} style={{ fontWeight: 'bold' }} color={theme.colors.textNormal}>
1077
954
  {parsePrice(order?.summary?.total ?? order?.total)}
1078
955
  </OText>
1079
956
  </Table>
@@ -1107,13 +984,13 @@ export const OrderDetailsUI = (props: OrderDetailsParams) => {
1107
984
  <OText>
1108
985
  {event?.wallet_event
1109
986
  ? walletName[event?.wallet_event?.wallet?.type]?.name
1110
- : event?.paymethod?.name}
987
+ : t(event?.paymethod?.name.toUpperCase()?.replace(/ /g, '_'), event?.paymethod?.name)}
1111
988
  </OText>
1112
- {event?.data?.charge_id && (
989
+ {/* {event?.data?.charge_id && (
1113
990
  <OText>
1114
991
  {`${t('CODE', 'Code')}: ${event?.data?.charge_id}`}
1115
992
  </OText>
1116
- )}
993
+ )} */}
1117
994
  </View>
1118
995
  <OText>
1119
996
  -{parsePrice(event.amount, { isTruncable: true })}
@@ -1124,6 +1001,23 @@ export const OrderDetailsUI = (props: OrderDetailsParams) => {
1124
1001
  </View>
1125
1002
  )}
1126
1003
  </OrderBill>
1004
+ {isGiftCardOrder && order?.products[0]?.gift_card?.status === 'pending' && !isGiftCardSent && (
1005
+ <>
1006
+ <View
1007
+ style={{
1008
+ height: 8,
1009
+ backgroundColor: theme.colors.backgroundGray100,
1010
+ marginTop: 10,
1011
+ marginHorizontal: -40,
1012
+ marginBottom: 20
1013
+ }}
1014
+ />
1015
+ <SendGiftCard
1016
+ giftCardId={order?.products[0]?.gift_card?.id}
1017
+ setIsGiftCardSent={setIsGiftCardSent}
1018
+ />
1019
+ </>
1020
+ )}
1127
1021
  </OrderContent>
1128
1022
  </>
1129
1023
  )}