ordering-ui-react-native 0.17.12 → 0.17.13-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 +5 -5
  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 -77
  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 -7
  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 +98 -50
  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 +8 -0
  65. package/themes/original/src/components/AddressDetails/index.tsx +29 -11
  66. package/themes/original/src/components/AddressForm/index.tsx +41 -16
  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 +189 -9
  70. package/themes/original/src/components/AppleLogin/index.tsx +4 -4
  71. package/themes/original/src/components/BusinessBasicInformation/index.tsx +125 -82
  72. package/themes/original/src/components/BusinessBasicInformation/styles.tsx +9 -4
  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 +617 -492
  84. package/themes/original/src/components/BusinessProductsListing/styles.tsx +7 -13
  85. package/themes/original/src/components/BusinessReviews/index.tsx +3 -1
  86. package/themes/original/src/components/BusinessTypeFilter/index.tsx +3 -3
  87. package/themes/original/src/components/BusinessesListing/Layout/Appointment/index.tsx +1 -1
  88. package/themes/original/src/components/BusinessesListing/Layout/Original/index.tsx +105 -78
  89. package/themes/original/src/components/BusinessesListing/Layout/Original/styles.tsx +1 -9
  90. package/themes/original/src/components/BusinessesListing/index.tsx +5 -3
  91. package/themes/original/src/components/Cart/index.tsx +88 -43
  92. package/themes/original/src/components/CartContent/index.tsx +110 -19
  93. package/themes/original/src/components/CartContent/styles.tsx +15 -1
  94. package/themes/original/src/components/Checkout/index.tsx +323 -178
  95. package/themes/original/src/components/Checkout/styles.tsx +4 -2
  96. package/themes/original/src/components/CitiesControl/index.tsx +89 -0
  97. package/themes/original/src/components/CitiesControl/styles.tsx +17 -0
  98. package/themes/original/src/components/CouponControl/index.tsx +10 -3
  99. package/themes/original/src/components/DriverTips/index.tsx +52 -37
  100. package/themes/original/src/components/DriverTips/styles.tsx +2 -1
  101. package/themes/original/src/components/Favorite/index.tsx +7 -4
  102. package/themes/original/src/components/Favorite/styles.tsx +1 -1
  103. package/themes/original/src/components/FavoriteList/index.tsx +51 -80
  104. package/themes/original/src/components/FloatingButton/index.tsx +1 -2
  105. package/themes/original/src/components/FloatingButton/styles.tsx +1 -1
  106. package/themes/original/src/components/GPSButton/styles.ts +3 -3
  107. package/themes/original/src/components/GiftCard/GiftCardUI/index.tsx +96 -0
  108. package/themes/original/src/components/GiftCard/GiftCardUI/styles.tsx +5 -0
  109. package/themes/original/src/components/GiftCard/PurchaseGiftCard/index.tsx +100 -0
  110. package/themes/original/src/components/GiftCard/PurchaseGiftCard/styles.tsx +8 -0
  111. package/themes/original/src/components/GiftCard/RedeemGiftCard/index.tsx +178 -0
  112. package/themes/original/src/components/GiftCard/RedeemGiftCard/styles.tsx +8 -0
  113. package/themes/original/src/components/GiftCard/SendGiftCard/index.tsx +165 -0
  114. package/themes/original/src/components/GiftCard/SendGiftCard/styles.tsx +9 -0
  115. package/themes/original/src/components/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 +19 -14
  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 +48 -19
  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 +195 -116
  134. package/themes/original/src/components/MultiCheckout/index.tsx +262 -83
  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 +66 -17
  139. package/themes/original/src/components/NavBar/index.tsx +6 -11
  140. package/themes/original/src/components/Notifications/index.tsx +144 -0
  141. package/themes/original/src/components/Notifications/styles.tsx +20 -0
  142. package/themes/original/src/components/OrderDetails/OrderEta.tsx +61 -0
  143. package/themes/original/src/components/OrderDetails/OrderHistory.tsx +10 -3
  144. package/themes/original/src/components/OrderDetails/index.tsx +262 -347
  145. package/themes/original/src/components/OrderDetails/styles.tsx +10 -1
  146. package/themes/original/src/components/OrderItAgain/index.tsx +47 -43
  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 +67 -29
  150. package/themes/original/src/components/OrderTypeSelector/index.tsx +3 -2
  151. package/themes/original/src/components/OrdersOption/PreviousBusinessOrdered/index.tsx +28 -19
  152. package/themes/original/src/components/OrdersOption/index.tsx +99 -89
  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 +231 -253
  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 +7 -4
  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 +358 -275
  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 +148 -62
  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 -218
  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 +53 -54
  195. package/themes/original/src/components/UserProfile/index.tsx +58 -35
  196. package/themes/original/src/components/UserProfile/styles.ts +17 -0
  197. package/themes/original/src/components/UserProfileForm/index.tsx +21 -28
  198. package/themes/original/src/components/UserProfileForm/styles.tsx +7 -0
  199. package/themes/original/src/components/Wallets/index.tsx +31 -17
  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 +10 -1
  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 +43 -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,
@@ -31,14 +32,15 @@ import {
31
32
  Map,
32
33
  Divider,
33
34
  OrderAction,
34
- PlaceSpotWrapper
35
+ PlaceSpotWrapper,
36
+ ProfessionalPhoto
35
37
  } from './styles';
36
38
  import { OButton, OIcon, OModal, OText } from '../shared';
37
39
  import { ProductItemAccordion } from '../ProductItemAccordion';
38
40
  import { TouchableOpacity } from 'react-native-gesture-handler';
39
41
  import { OrderDetailsParams } from '../../types';
40
42
  import { GoogleMap } from '../GoogleMap';
41
- import { verifyDecimals } from '../../utils';
43
+ import { verifyDecimals, getOrderStatus } from '../../utils';
42
44
  import { OSRow } from '../OrderSummary/styles';
43
45
  import AntIcon from 'react-native-vector-icons/AntDesign'
44
46
  import { TaxInformation } from '../TaxInformation';
@@ -46,6 +48,8 @@ import { Placeholder, PlaceholderLine } from 'rn-placeholder';
46
48
  import NavBar from '../NavBar'
47
49
  import { OrderHistory } from './OrderHistory';
48
50
  import { PlaceSpot } from '../PlaceSpot'
51
+ import { OrderEta } from './OrderEta'
52
+ import { SendGiftCard } from '../GiftCard/SendGiftCard'
49
53
  export const OrderDetailsUI = (props: OrderDetailsParams) => {
50
54
  const {
51
55
  navigation,
@@ -94,6 +98,12 @@ export const OrderDetailsUI = (props: OrderDetailsParams) => {
94
98
  display: 'flex',
95
99
  alignItems: 'center',
96
100
  flexDirection: 'row'
101
+ },
102
+ professionalBlock: {
103
+ borderBottomColor: theme.colors.border,
104
+ borderBottomWidth: 1,
105
+ marginVertical: 10,
106
+ paddingVertical: 5
97
107
  }
98
108
  });
99
109
 
@@ -103,12 +113,18 @@ export const OrderDetailsUI = (props: OrderDetailsParams) => {
103
113
  const [{ carts }] = useOrder()
104
114
 
105
115
  const [isReviewed, setIsReviewed] = useState(false)
116
+ const [isGiftCardSent, setIsGiftCardSent] = useState(false)
106
117
  const [isOrderHistory, setIsOrderHistory] = useState(false)
107
118
  const [openTaxModal, setOpenTaxModal] = useState<any>({ open: false, tax: null, type: '' })
108
119
  const [refreshing] = useState(false);
109
120
  const { order, businessData } = props.order;
110
121
  const mapValidStatuses = [9, 19, 23]
111
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
112
128
 
113
129
  const walletName: any = {
114
130
  cash: {
@@ -119,205 +135,6 @@ export const OrderDetailsUI = (props: OrderDetailsParams) => {
119
135
  }
120
136
  }
121
137
 
122
- const getOrderStatus = (s: string) => {
123
- const status = parseInt(s);
124
- const orderStatus = [
125
- {
126
- key: 0,
127
- value: t('PENDING', 'Pending'),
128
- slug: 'PENDING',
129
- percentage: 0.25,
130
- image: theme.images.order.status0,
131
- },
132
- {
133
- key: 1,
134
- value: t('COMPLETED', 'Completed'),
135
- slug: 'COMPLETED',
136
- percentage: 1,
137
- image: theme.images.order.status1,
138
- },
139
- {
140
- key: 2,
141
- value: t('REJECTED', 'Rejected'),
142
- slug: 'REJECTED',
143
- percentage: 0,
144
- image: theme.images.order.status2,
145
- },
146
- {
147
- key: 3,
148
- value: t('DRIVER_IN_BUSINESS', 'Driver in business'),
149
- slug: 'DRIVER_IN_BUSINESS',
150
- percentage: 0.6,
151
- image: theme.images.order.status3,
152
- },
153
- {
154
- key: 4,
155
- value: t('PREPARATION_COMPLETED', 'Preparation Completed'),
156
- slug: 'PREPARATION_COMPLETED',
157
- percentage: 0.7,
158
- image: theme.images.order.status4,
159
- },
160
- {
161
- key: 5,
162
- value: t('REJECTED_BY_BUSINESS', 'Rejected by business'),
163
- slug: 'REJECTED_BY_BUSINESS',
164
- percentage: 0,
165
- image: theme.images.order.status5,
166
- },
167
- {
168
- key: 6,
169
- value: t('REJECTED_BY_DRIVER', 'Rejected by Driver'),
170
- slug: 'REJECTED_BY_DRIVER',
171
- percentage: 0,
172
- image: theme.images.order.status6,
173
- },
174
- {
175
- key: 7,
176
- value: t('ACCEPTED_BY_BUSINESS', 'Accepted by business'),
177
- slug: 'ACCEPTED_BY_BUSINESS',
178
- percentage: 0.35,
179
- image: theme.images.order.status7,
180
- },
181
- {
182
- key: 8,
183
- value: t('ACCEPTED_BY_DRIVER', 'Accepted by driver'),
184
- slug: 'ACCEPTED_BY_DRIVER',
185
- percentage: 0.45,
186
- image: theme.images.order.status8,
187
- },
188
- {
189
- key: 9,
190
- value: t('PICK_UP_COMPLETED_BY_DRIVER', 'Pick up completed by driver'),
191
- slug: 'PICK_UP_COMPLETED_BY_DRIVER',
192
- percentage: 0.8,
193
- image: theme.images.order.status9,
194
- },
195
- {
196
- key: 10,
197
- value: t('PICK_UP_FAILED_BY_DRIVER', 'Pick up Failed by driver'),
198
- slug: 'PICK_UP_FAILED_BY_DRIVER',
199
- percentage: 0,
200
- image: theme.images.order.status10,
201
- },
202
- {
203
- key: 11,
204
- value: t(
205
- 'DELIVERY_COMPLETED_BY_DRIVER',
206
- 'Delivery completed by driver',
207
- ),
208
- slug: 'DELIVERY_COMPLETED_BY_DRIVER',
209
- percentage: 1,
210
- image: theme.images.order.status11,
211
- },
212
- {
213
- key: 12,
214
- value: t('DELIVERY_FAILED_BY_DRIVER', 'Delivery Failed by driver'),
215
- slug: 'DELIVERY_FAILED_BY_DRIVER',
216
- percentage: 0,
217
- image: theme.images.order.status12,
218
- },
219
- {
220
- key: 13,
221
- value: t('PREORDER', 'PreOrder'),
222
- slug: 'PREORDER',
223
- percentage: 0,
224
- image: theme.images.order.status13,
225
- },
226
- {
227
- key: 14,
228
- value: t('ORDER_NOT_READY', 'Order not ready'),
229
- slug: 'ORDER_NOT_READY',
230
- percentage: 0,
231
- image: theme.images.order.status13,
232
- },
233
- {
234
- key: 15,
235
- value: t(
236
- 'ORDER_PICKEDUP_COMPLETED_BY_CUSTOMER',
237
- 'Order picked up completed by customer',
238
- ),
239
- slug: 'ORDER_PICKEDUP_COMPLETED_BY_CUSTOMER',
240
- percentage: 100,
241
- image: theme.images.order.status1,
242
- },
243
- {
244
- key: 16,
245
- value: t('CANCELLED_BY_CUSTOMER', 'Cancelled by customer'),
246
- slug: 'CANCELLED_BY_CUSTOMER',
247
- percentage: 0,
248
- image: theme.images.order.status2,
249
- },
250
- {
251
- key: 17,
252
- value: t(
253
- 'ORDER_NOT_PICKEDUP_BY_CUSTOMER',
254
- 'Order not picked up by customer',
255
- ),
256
- slug: 'ORDER_NOT_PICKEDUP_BY_CUSTOMER',
257
- percentage: 0,
258
- image: theme.images.order.status2,
259
- },
260
- {
261
- key: 18,
262
- value: t(
263
- 'DRIVER_ALMOST_ARRIVED_TO_BUSINESS',
264
- 'Driver almost arrived to business',
265
- ),
266
- slug: 'DRIVER_ALMOST_ARRIVED_TO_BUSINESS',
267
- percentage: 0.15,
268
- image: theme.images.order.status3,
269
- },
270
- {
271
- key: 19,
272
- value: t(
273
- 'DRIVER_ALMOST_ARRIVED_TO_CUSTOMER',
274
- 'Driver almost arrived to customer',
275
- ),
276
- slug: 'DRIVER_ALMOST_ARRIVED_TO_CUSTOMER',
277
- percentage: 0.9,
278
- image: theme.images.order.status11,
279
- },
280
- {
281
- key: 20,
282
- value: t(
283
- 'ORDER_CUSTOMER_ALMOST_ARRIVED_BUSINESS',
284
- 'Customer almost arrived to business',
285
- ),
286
- slug: 'ORDER_CUSTOMER_ALMOST_ARRIVED_BUSINESS',
287
- percentage: 90,
288
- image: theme.images.order.status7,
289
- },
290
- {
291
- key: 21,
292
- value: t(
293
- 'ORDER_CUSTOMER_ARRIVED_BUSINESS',
294
- 'Customer arrived to business',
295
- ),
296
- slug: 'ORDER_CUSTOMER_ARRIVED_BUSINESS',
297
- percentage: 95,
298
- image: theme.images.order.status7,
299
- },
300
- {
301
- key: 22,
302
- value: t('ORDER_LOOKING_FOR_DRIVER', 'Looking for driver'),
303
- slug: 'ORDER_LOOKING_FOR_DRIVER',
304
- percentage: 35,
305
- image: theme.images.order.status8
306
- },
307
- {
308
- key: 23,
309
- value: t('ORDER_DRIVER_ON_WAY', 'Driver on way'),
310
- slug: 'ORDER_DRIVER_ON_WAY',
311
- percentage: 45,
312
- image: theme.images.order.status8
313
- }
314
- ];
315
-
316
- const objectStatus = orderStatus.find((o) => o.key === status);
317
-
318
- return objectStatus && objectStatus;
319
- };
320
-
321
138
  const handleGoToMessages = (type: string) => {
322
139
  readMessages && readMessages();
323
140
  navigation.navigate(
@@ -448,6 +265,59 @@ export const OrderDetailsUI = (props: OrderDetailsParams) => {
448
265
  lng: parseFloat(location?.location?.split(',')[1].replace(/[^-.0-9]/g, ''))
449
266
  } : location)
450
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
+
451
321
  useEffect(() => {
452
322
  if (driverLocation) {
453
323
  parsedLocations[0] = {
@@ -531,161 +401,194 @@ export const OrderDetailsUI = (props: OrderDetailsParams) => {
531
401
  style={{ marginTop: Platform.OS === 'ios' ? 0 : 20 }}
532
402
  titleWrapStyle={{ paddingHorizontal: 0 }}
533
403
  titleStyle={{ marginRight: 0, marginLeft: 0 }}
534
- subTitle={<OText size={12} lineHeight={18} color={theme.colors.textNormal}>
535
- {order?.delivery_datetime_utc
536
- ? parseDate(order?.delivery_datetime_utc)
537
- : 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
+ )}
538
410
  </OText>}
539
411
  />
540
- <OrderInfo>
541
- <OrderData>
542
- <View style={styles.linkWrapper}>
543
- {
544
- (
545
- parseInt(order?.status) === 1 ||
546
- parseInt(order?.status) === 11 ||
547
- parseInt(order?.status) === 15
548
- ) && !order.review && !isReviewed && (
549
- <TouchableOpacity
550
- activeOpacity={0.7}
551
- style={{ marginTop: 6, marginRight: 10 }}
552
- onPress={() => handleClickOrderReview(order)}
553
- >
554
- <OText
555
- size={10}
556
- lineHeight={15}
557
- color={theme.colors.primary}
558
- 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)}
559
433
  >
560
- {t('REVIEW_YOUR_ORDER', 'Review your order')}
561
- </OText>
562
- </TouchableOpacity>
563
- )}
564
- <TouchableOpacity
565
- activeOpacity={0.7}
566
- style={{ marginTop: 6 }}
567
- onPress={() => setIsOrderHistory(true)}
568
-
569
- >
570
- <OText
571
- size={10}
572
- lineHeight={15}
573
- color={theme.colors.primary}
574
- 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
+
575
449
  >
576
- {t('VIEW_DETAILS', 'View Details')}
577
- </OText>
578
- </TouchableOpacity>
579
- </View>
580
-
581
- <StaturBar>
582
- <LinearGradient
583
- start={{ x: 0.0, y: 0.0 }}
584
- end={{
585
- x: getOrderStatus(order?.status)?.percentage || 0,
586
- y: 0,
587
- }}
588
- locations={[0.9999, 0.9999]}
589
- colors={[theme.colors.primary, theme.colors.backgroundGray100]}
590
- style={styles.statusBar}
591
- />
592
- </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>
593
495
  <OText
594
496
  size={16}
595
497
  lineHeight={24}
596
- weight={'600'}
597
- color={theme.colors.textNormal}>
598
- {getOrderStatus(order?.status)?.value}
498
+ weight={'500'}
499
+ color={theme.colors.textNormal}
500
+ mBottom={12}>
501
+ {t('FROM', 'From')}
599
502
  </OText>
600
- </OrderData>
601
- <View
602
- style={{
603
- height: 8,
604
- backgroundColor: theme.colors.backgroundGray100,
605
- marginTop: 18,
606
- marginHorizontal: -40,
607
- }}
608
- />
609
- </OrderInfo>
610
- </Header>
611
- <OrderContent>
612
- <OrderBusiness>
613
- <OText
614
- size={16}
615
- lineHeight={24}
616
- weight={'500'}
617
- color={theme.colors.textNormal}
618
- mBottom={12}>
619
- {t('FROM', 'From')}
620
- </OText>
621
- <View
622
- style={{
623
- display: 'flex',
624
- flexDirection: 'column',
625
- alignItems: 'flex-start',
626
- }}>
627
503
  <View
628
504
  style={{
629
- flexDirection: 'row',
630
- alignItems: 'center',
631
- justifyContent: 'space-between',
505
+ display: 'flex',
506
+ flexDirection: 'column',
507
+ alignItems: 'flex-start',
632
508
  }}>
633
- <OText
634
- size={13}
635
- lineHeight={20}
636
- color={theme.colors.textNormal}
637
- style={{ flexGrow: 1, flexBasis: '80%' }}>
638
- {order?.business?.name}
639
- </OText>
640
- <Icons>
641
- {!!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
+ )}
642
537
  <TouchableOpacity
643
- onPress={() => order?.business?.cellphone &&
644
- Linking.openURL(`tel:${order?.business?.cellphone}`)
645
- }
646
- style={{ paddingEnd: 5 }}
647
- >
538
+ style={{ paddingStart: 5 }}
539
+ onPress={() => handleGoToMessages('business')}>
648
540
  <OIcon
649
- src={theme.images.general.phone}
541
+ src={theme.images.general.chat}
650
542
  width={16}
651
543
  color={theme.colors.disabled}
652
544
  />
653
545
  </TouchableOpacity>
654
- )}
655
- <TouchableOpacity
656
- style={{ paddingStart: 5 }}
657
- onPress={() => handleGoToMessages('business')}>
658
- <OIcon
659
- src={theme.images.general.chat}
660
- width={16}
661
- color={theme.colors.disabled}
662
- />
663
- </TouchableOpacity>
664
- </Icons>
665
- </View>
666
- <OText
667
- size={12}
668
- lineHeight={18}
669
- color={theme.colors.textNormal}
670
- mBottom={2}>
671
- {order?.business?.email}
672
- </OText>
673
- {!!order?.business?.cellphone && (
546
+ </Icons>
547
+ </View>
674
548
  <OText
675
549
  size={12}
676
550
  lineHeight={18}
677
551
  color={theme.colors.textNormal}
678
552
  mBottom={2}>
679
- {order?.business?.cellphone}
553
+ {order?.business?.email}
680
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
+ />
681
587
  )}
682
- <OText size={12} lineHeight={18} color={theme.colors.textNormal}>
683
- {order?.business?.address}
684
- </OText>
685
- </View>
686
- </OrderBusiness>
588
+ </OrderBusiness>
589
+ )}
687
590
 
688
- {placeSpotTypes.includes(order?.delivery_type) && (
591
+ {!isGiftCardOrder && placeSpotTypes.includes(order?.delivery_type) && (
689
592
  <PlaceSpotWrapper>
690
593
  <PlaceSpot
691
594
  isInputMode
@@ -711,7 +614,7 @@ export const OrderDetailsUI = (props: OrderDetailsParams) => {
711
614
  weight={'500'}
712
615
  color={theme.colors.textNormal}
713
616
  mBottom={12}>
714
- {t('TO', 'To')}
617
+ {isGiftCardOrder ? t('CUSTOMER', 'Customer') : t('TO', 'To')}
715
618
  </OText>
716
619
  <Customer>
717
620
  <InfoBlock>
@@ -740,7 +643,7 @@ export const OrderDetailsUI = (props: OrderDetailsParams) => {
740
643
  )}
741
644
  </InfoBlock>
742
645
  </Customer>
743
- {order?.delivery_option !== undefined && order?.delivery_type === 1 && (
646
+ {!isGiftCardOrder && order?.delivery_option !== undefined && order?.delivery_type === 1 && (
744
647
  <View style={{ marginTop: 15 }}>
745
648
  <OText size={16} style={{ textAlign: 'left' }} color={theme.colors.textNormal}>
746
649
  {t('DELIVERY_PREFERENCE', 'Delivery Preference')}
@@ -762,7 +665,7 @@ export const OrderDetailsUI = (props: OrderDetailsParams) => {
762
665
  <>
763
666
  {order?.driver?.location && mapValidStatuses.includes(parseInt(order?.status)) && (
764
667
  <Map>
765
- <GoogleMap
668
+ <GoogleMap
766
669
  location={typeof order?.driver?.location?.location === 'string'
767
670
  ? {
768
671
  lat: parseFloat(driverLocationString[0]),
@@ -876,14 +779,7 @@ export const OrderDetailsUI = (props: OrderDetailsParams) => {
876
779
  </OrderAction>
877
780
  </HeaderInfo>
878
781
  <OrderProducts>
879
- {order?.products?.length &&
880
- order?.products.map((product: any, i: number) => (
881
- <ProductItemAccordion
882
- key={product?.id || i}
883
- product={product}
884
- isFromCheckout
885
- />
886
- ))}
782
+ {sortedProductList}
887
783
  </OrderProducts>
888
784
  <OrderBill>
889
785
  <View style={{ height: 1, backgroundColor: theme.colors.border, marginBottom: 17 }} />
@@ -929,7 +825,9 @@ export const OrderDetailsUI = (props: OrderDetailsParams) => {
929
825
  </Table>
930
826
  ))
931
827
  }
932
- <Divider />
828
+ {!isGiftCardOrder && (
829
+ <Divider />
830
+ )}
933
831
  {order?.summary?.subtotal_with_discount > 0 && order?.summary?.discount > 0 && order?.summary?.total >= 0 && (
934
832
  <Table>
935
833
  <OText size={12} lineHeight={18} weight={'400'} color={theme.colors.textNormal}>{t('SUBTOTAL_WITH_DISCOUNT', 'Subtotal with discount')}</OText>
@@ -1051,8 +949,8 @@ export const OrderDetailsUI = (props: OrderDetailsParams) => {
1051
949
  )}
1052
950
  <Total>
1053
951
  <Table>
1054
- <OText size={20} lineHeight={30} weight={'600'} color={theme.colors.textNormal}>{t('TOTAL', 'Total')}</OText>
1055
- <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}>
1056
954
  {parsePrice(order?.summary?.total ?? order?.total)}
1057
955
  </OText>
1058
956
  </Table>
@@ -1086,7 +984,7 @@ export const OrderDetailsUI = (props: OrderDetailsParams) => {
1086
984
  <OText>
1087
985
  {event?.wallet_event
1088
986
  ? walletName[event?.wallet_event?.wallet?.type]?.name
1089
- : event?.paymethod?.name}
987
+ : t(event?.paymethod?.name.toUpperCase()?.replace(/ /g, '_'), event?.paymethod?.name)}
1090
988
  </OText>
1091
989
  {event?.data?.charge_id && (
1092
990
  <OText>
@@ -1103,6 +1001,23 @@ export const OrderDetailsUI = (props: OrderDetailsParams) => {
1103
1001
  </View>
1104
1002
  )}
1105
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
+ )}
1106
1021
  </OrderContent>
1107
1022
  </>
1108
1023
  )}