ordering-ui-react-native 0.17.72 → 0.17.73-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 (201) hide show
  1. package/package.json +8 -7
  2. package/src/DeliveryApp.tsx +43 -1
  3. package/src/components/BusinessInformation/index.tsx +10 -9
  4. package/src/components/BusinessesListing/index.tsx +1 -1
  5. package/src/components/OrderCreating/index.tsx +1 -21
  6. package/src/components/PaymentOptionsWebView/index.tsx +29 -8
  7. package/src/components/PhoneInputNumber/index.tsx +6 -2
  8. package/src/components/StripeMethodForm/index.tsx +136 -102
  9. package/src/components/VerifyPhone/styles.tsx +1 -2
  10. package/src/components/shared/OToast.tsx +3 -2
  11. package/src/types/index.tsx +5 -0
  12. package/src/utils/index.tsx +5 -0
  13. package/themes/business/index.tsx +2 -0
  14. package/themes/business/src/components/AcceptOrRejectOrder/index.tsx +28 -24
  15. package/themes/business/src/components/BusinessController/index.tsx +0 -1
  16. package/themes/business/src/components/Chat/index.tsx +149 -118
  17. package/themes/business/src/components/DriverMap/index.tsx +17 -6
  18. package/themes/business/src/components/DriverSchedule/index.tsx +45 -8
  19. package/themes/business/src/components/GoogleMap/index.tsx +58 -57
  20. package/themes/business/src/components/LoginForm/Otp/index.tsx +31 -3
  21. package/themes/business/src/components/LoginForm/index.tsx +15 -22
  22. package/themes/business/src/components/MapView/index.tsx +10 -10
  23. package/themes/business/src/components/MessagesOption/index.tsx +20 -93
  24. package/themes/business/src/components/NewOrderNotification/index.tsx +37 -21
  25. package/themes/business/src/components/NotFoundSource/index.tsx +2 -2
  26. package/themes/business/src/components/OrderDetails/Business.tsx +1 -1
  27. package/themes/business/src/components/OrderDetails/Delivery.tsx +191 -6
  28. package/themes/business/src/components/OrderDetails/OrderContentComponent.tsx +103 -39
  29. package/themes/business/src/components/OrderDetails/OrderHeaderComponent.tsx +61 -60
  30. package/themes/business/src/components/OrderDetailsLogistic/index.tsx +195 -0
  31. package/themes/business/src/components/OrderDetailsLogistic/styles.tsx +5 -0
  32. package/themes/business/src/components/OrderMessage/index.tsx +19 -18
  33. package/themes/business/src/components/OrderSummary/index.tsx +114 -123
  34. package/themes/business/src/components/OrdersOption/index.tsx +17 -15
  35. package/themes/business/src/components/PreviousMessages/FooterMessageComponent.tsx +103 -0
  36. package/themes/business/src/components/PreviousMessages/index.tsx +97 -55
  37. package/themes/business/src/components/PreviousOrders/OrderItem.tsx +17 -12
  38. package/themes/business/src/components/PreviousOrders/OrderList.tsx +88 -0
  39. package/themes/business/src/components/PreviousOrders/OrdersGroupedItem.tsx +1 -1
  40. package/themes/business/src/components/PreviousOrders/index.tsx +186 -114
  41. package/themes/business/src/components/PreviousOrders/styles.tsx +1 -1
  42. package/themes/business/src/components/ProductItemAccordion/index.tsx +27 -3
  43. package/themes/business/src/components/ReviewCustomer/index.tsx +18 -13
  44. package/themes/business/src/components/StoresList/index.tsx +3 -4
  45. package/themes/business/src/components/UserProfileForm/index.tsx +14 -15
  46. package/themes/business/src/components/shared/OLink.tsx +11 -3
  47. package/themes/business/src/components/shared/OModal.tsx +16 -9
  48. package/themes/business/src/components/shared/OText.tsx +6 -1
  49. package/themes/business/src/types/index.tsx +25 -10
  50. package/themes/business/src/utils/index.tsx +29 -2
  51. package/themes/doordash/src/components/BusinessesListing/index.tsx +1 -1
  52. package/themes/doordash/src/components/LoginForm/index.tsx +1 -2
  53. package/themes/instacart/src/components/BusinessesListing/index.tsx +1 -1
  54. package/themes/kiosk/src/components/Checkout/index.tsx +6 -0
  55. package/themes/kiosk/src/components/Intro/index.tsx +16 -1
  56. package/themes/kiosk/src/components/LoginForm/index.tsx +7 -9
  57. package/themes/kiosk/src/components/NavBar/index.tsx +14 -14
  58. package/themes/kiosk/src/components/OptionCard/index.tsx +1 -1
  59. package/themes/kiosk/src/components/OrderTypeCardSelector/index.tsx +8 -10
  60. package/themes/kiosk/src/components/PhoneInputNumber/index.tsx +2 -2
  61. package/themes/kiosk/src/components/shared/OButton.tsx +5 -18
  62. package/themes/original/index.tsx +1 -1
  63. package/themes/original/src/components/AddressDetails/index.tsx +19 -3
  64. package/themes/original/src/components/AddressForm/index.tsx +61 -39
  65. package/themes/original/src/components/AddressList/index.tsx +25 -24
  66. package/themes/original/src/components/AddressList/styles.tsx +4 -2
  67. package/themes/original/src/components/AnalyticsSegment/index.tsx +193 -10
  68. package/themes/original/src/components/AppleLogin/index.tsx +4 -4
  69. package/themes/original/src/components/AppleLogin/styles.tsx +3 -1
  70. package/themes/original/src/components/BusinessBasicInformation/index.tsx +153 -96
  71. package/themes/original/src/components/BusinessBasicInformation/styles.tsx +10 -12
  72. package/themes/original/src/components/BusinessController/index.tsx +80 -66
  73. package/themes/original/src/components/BusinessController/styles.tsx +12 -5
  74. package/themes/original/src/components/BusinessFeaturedController/index.tsx +21 -54
  75. package/themes/original/src/components/BusinessFeaturedController/styles.tsx +8 -0
  76. package/themes/original/src/components/BusinessInformation/index.tsx +139 -85
  77. package/themes/original/src/components/BusinessItemAccordion/index.tsx +15 -20
  78. package/themes/original/src/components/BusinessListingSearch/index.tsx +349 -339
  79. package/themes/original/src/components/BusinessListingSearch/styles.tsx +0 -18
  80. package/themes/original/src/components/BusinessPreorder/index.tsx +103 -19
  81. package/themes/original/src/components/BusinessProductsCategories/index.tsx +1 -2
  82. package/themes/original/src/components/BusinessProductsList/index.tsx +15 -7
  83. package/themes/original/src/components/BusinessProductsList/styles.tsx +8 -3
  84. package/themes/original/src/components/BusinessProductsListing/UpsellingRedirect.tsx +1 -1
  85. package/themes/original/src/components/BusinessProductsListing/index.tsx +684 -557
  86. package/themes/original/src/components/BusinessProductsListing/styles.tsx +2 -2
  87. package/themes/original/src/components/BusinessReviews/index.tsx +3 -1
  88. package/themes/original/src/components/BusinessesListing/Layout/Original/index.tsx +69 -38
  89. package/themes/original/src/components/BusinessesListing/Layout/Original/styles.tsx +0 -1
  90. package/themes/original/src/components/BusinessesListing/index.tsx +0 -1
  91. package/themes/original/src/components/Cart/index.tsx +77 -79
  92. package/themes/original/src/components/CartContent/index.tsx +117 -20
  93. package/themes/original/src/components/CartContent/styles.tsx +17 -7
  94. package/themes/original/src/components/Checkout/index.tsx +355 -123
  95. package/themes/original/src/components/CitiesControl/index.tsx +1 -1
  96. package/themes/original/src/components/CouponControl/index.tsx +10 -3
  97. package/themes/original/src/components/DriverTips/index.tsx +52 -34
  98. package/themes/original/src/components/FacebookLogin/styles.tsx +3 -1
  99. package/themes/original/src/components/Favorite/index.tsx +2 -6
  100. package/themes/original/src/components/FavoriteList/index.tsx +1 -35
  101. package/themes/original/src/components/FloatingButton/index.tsx +10 -13
  102. package/themes/original/src/components/GPSButton/index.tsx +6 -4
  103. package/themes/original/src/components/GiftCard/GiftCardUI/index.tsx +96 -0
  104. package/themes/original/src/components/GiftCard/GiftCardUI/styles.tsx +5 -0
  105. package/themes/original/src/components/GiftCard/PurchaseGiftCard/index.tsx +100 -0
  106. package/themes/original/src/components/GiftCard/PurchaseGiftCard/styles.tsx +8 -0
  107. package/themes/original/src/components/GiftCard/RedeemGiftCard/index.tsx +191 -0
  108. package/themes/original/src/components/GiftCard/RedeemGiftCard/styles.tsx +8 -0
  109. package/themes/original/src/components/GiftCard/SendGiftCard/index.tsx +165 -0
  110. package/themes/original/src/components/GiftCard/SendGiftCard/styles.tsx +9 -0
  111. package/themes/original/src/components/GoogleLogin/styles.tsx +1 -1
  112. package/themes/original/src/components/GoogleMap/index.tsx +60 -5
  113. package/themes/original/src/components/Help/index.tsx +2 -2
  114. package/themes/original/src/components/HelpAccountAndPayment/index.tsx +10 -31
  115. package/themes/original/src/components/HelpAccountAndPayment/styles.tsx +5 -3
  116. package/themes/original/src/components/HelpGuide/index.tsx +6 -6
  117. package/themes/original/src/components/HelpGuide/styles.tsx +6 -0
  118. package/themes/original/src/components/HelpOrder/index.tsx +6 -15
  119. package/themes/original/src/components/HelpOrder/styles.tsx +8 -1
  120. package/themes/original/src/components/Home/index.tsx +13 -4
  121. package/themes/original/src/components/LastOrder/index.tsx +1 -34
  122. package/themes/original/src/components/LoginForm/Otp/index.tsx +91 -25
  123. package/themes/original/src/components/LoginForm/index.tsx +64 -34
  124. package/themes/original/src/components/LottieAnimation/index.tsx +88 -63
  125. package/themes/original/src/components/MessageListing/index.tsx +16 -42
  126. package/themes/original/src/components/Messages/index.tsx +14 -7
  127. package/themes/original/src/components/MomentOption/index.tsx +193 -90
  128. package/themes/original/src/components/MomentSelector/index.tsx +1 -1
  129. package/themes/original/src/components/MultiCart/index.tsx +41 -54
  130. package/themes/original/src/components/MultiCartsPaymethodsAndWallets/index.tsx +162 -50
  131. package/themes/original/src/components/MultiCheckout/index.tsx +329 -100
  132. package/themes/original/src/components/MultiCheckout/styles.tsx +3 -1
  133. package/themes/original/src/components/MultiOrdersDetails/SingleOrderCard.tsx +37 -224
  134. package/themes/original/src/components/MultiOrdersDetails/index.tsx +54 -21
  135. package/themes/original/src/components/MultiOrdersDetails/styles.tsx +1 -1
  136. package/themes/original/src/components/MyOrders/index.tsx +40 -29
  137. package/themes/original/src/components/NavBar/index.tsx +20 -17
  138. package/themes/original/src/components/NotFoundSource/index.tsx +14 -10
  139. package/themes/original/src/components/Notifications/index.tsx +42 -52
  140. package/themes/original/src/components/Notifications/styles.tsx +6 -3
  141. package/themes/original/src/components/OrderDetails/OrderEta.tsx +76 -0
  142. package/themes/original/src/components/OrderDetails/OrderHistory.tsx +21 -5
  143. package/themes/original/src/components/OrderDetails/index.tsx +191 -363
  144. package/themes/original/src/components/OrderDetails/styles.tsx +0 -1
  145. package/themes/original/src/components/OrderItAgain/index.tsx +3 -1
  146. package/themes/original/src/components/OrderProgress/index.tsx +30 -56
  147. package/themes/original/src/components/OrderSummary/index.tsx +88 -59
  148. package/themes/original/src/components/OrderTypeSelector/index.tsx +2 -1
  149. package/themes/original/src/components/OrdersOption/PreviousProductsOrdered/index.tsx +14 -14
  150. package/themes/original/src/components/OrdersOption/index.tsx +67 -85
  151. package/themes/original/src/components/OrdersOption/styles.tsx +1 -1
  152. package/themes/original/src/components/PageBanner/index.tsx +98 -38
  153. package/themes/original/src/components/PageBanner/styles.tsx +0 -10
  154. package/themes/original/src/components/PaymentOptionCard/index.tsx +180 -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 +78 -35
  158. package/themes/original/src/components/PhoneInputNumber/index.tsx +18 -4
  159. package/themes/original/src/components/ProductForm/index.tsx +104 -29
  160. package/themes/original/src/components/ProductForm/styles.tsx +5 -5
  161. package/themes/original/src/components/ProductItemAccordion/index.tsx +12 -9
  162. package/themes/original/src/components/ProductOptionSubOption/index.tsx +20 -18
  163. package/themes/original/src/components/ProductOptionSubOption/styles.tsx +5 -9
  164. package/themes/original/src/components/ProfessionalFilter/SingleProfessionalCard/index.tsx +108 -0
  165. package/themes/original/src/components/ProfessionalFilter/index.tsx +20 -50
  166. package/themes/original/src/components/ProfessionalProfile/index.tsx +36 -7
  167. package/themes/original/src/components/Promotions/index.tsx +2 -2
  168. package/themes/original/src/components/Promotions/styles.tsx +3 -1
  169. package/themes/original/src/components/ReviewProducts/index.tsx +16 -7
  170. package/themes/original/src/components/ScheduleAccordion/index.tsx +3 -3
  171. package/themes/original/src/components/ServiceForm/index.tsx +63 -20
  172. package/themes/original/src/components/Sessions/index.tsx +11 -8
  173. package/themes/original/src/components/Sessions/styles.tsx +5 -0
  174. package/themes/original/src/components/SignupForm/index.tsx +43 -27
  175. package/themes/original/src/components/SingleOrderCard/index.tsx +102 -63
  176. package/themes/original/src/components/SingleOrderCard/styles.tsx +1 -1
  177. package/themes/original/src/components/SingleProductCard/index.tsx +72 -31
  178. package/themes/original/src/components/SingleProductCard/styles.tsx +20 -4
  179. package/themes/original/src/components/SingleProductReview/styles.tsx +1 -1
  180. package/themes/original/src/components/StripeCardsList/index.tsx +49 -5
  181. package/themes/original/src/components/StripeElementsForm/index.tsx +48 -34
  182. package/themes/original/src/components/StripeElementsForm/naked.tsx +12 -1
  183. package/themes/original/src/components/UpsellingProducts/index.tsx +238 -224
  184. package/themes/original/src/components/UpsellingProducts/styles.tsx +12 -1
  185. package/themes/original/src/components/UserDetails/index.tsx +3 -1
  186. package/themes/original/src/components/UserFormDetails/index.tsx +76 -7
  187. package/themes/original/src/components/UserFormDetails/styles.tsx +1 -1
  188. package/themes/original/src/components/UserProfile/index.tsx +88 -79
  189. package/themes/original/src/components/UserProfileForm/index.tsx +17 -21
  190. package/themes/original/src/components/UserProfileForm/styles.tsx +7 -0
  191. package/themes/original/src/components/UserVerification/index.tsx +55 -50
  192. package/themes/original/src/components/WalletTransactionItem/index.tsx +2 -2
  193. package/themes/original/src/components/WalletTransactions/index.tsx +3 -3
  194. package/themes/original/src/components/Wallets/index.tsx +66 -30
  195. package/themes/original/src/components/Wallets/styles.tsx +3 -4
  196. package/themes/original/src/components/shared/OButton.tsx +6 -2
  197. package/themes/original/src/components/shared/OInput.tsx +6 -1
  198. package/themes/original/src/components/shared/OModal.tsx +3 -3
  199. package/themes/original/src/types/index.tsx +40 -11
  200. package/themes/original/src/utils/index.tsx +273 -1
  201. package/themes/uber-eats/src/components/BusinessesListing/index.tsx +1 -1
@@ -40,7 +40,7 @@ import { ProductItemAccordion } from '../ProductItemAccordion';
40
40
  import { TouchableOpacity } from 'react-native-gesture-handler';
41
41
  import { OrderDetailsParams } from '../../types';
42
42
  import { GoogleMap } from '../GoogleMap';
43
- import { verifyDecimals } from '../../utils';
43
+ import { verifyDecimals, getOrderStatus } from '../../utils';
44
44
  import { OSRow } from '../OrderSummary/styles';
45
45
  import AntIcon from 'react-native-vector-icons/AntDesign'
46
46
  import { TaxInformation } from '../TaxInformation';
@@ -48,6 +48,8 @@ import { Placeholder, PlaceholderLine } from 'rn-placeholder';
48
48
  import NavBar from '../NavBar'
49
49
  import { OrderHistory } from './OrderHistory';
50
50
  import { PlaceSpot } from '../PlaceSpot'
51
+ import { OrderEta } from './OrderEta'
52
+ import { SendGiftCard } from '../GiftCard/SendGiftCard'
51
53
  export const OrderDetailsUI = (props: OrderDetailsParams) => {
52
54
  const {
53
55
  navigation,
@@ -111,6 +113,7 @@ export const OrderDetailsUI = (props: OrderDetailsParams) => {
111
113
  const [{ carts }] = useOrder()
112
114
 
113
115
  const [isReviewed, setIsReviewed] = useState(false)
116
+ const [isGiftCardSent, setIsGiftCardSent] = useState(false)
114
117
  const [isOrderHistory, setIsOrderHistory] = useState(false)
115
118
  const [openTaxModal, setOpenTaxModal] = useState<any>({ open: false, tax: null, type: '' })
116
119
  const [refreshing] = useState(false);
@@ -118,8 +121,10 @@ export const OrderDetailsUI = (props: OrderDetailsParams) => {
118
121
  const mapValidStatuses = [9, 19, 23]
119
122
  const placeSpotTypes = [3, 4, 5]
120
123
  const directionTypes = [2, 3, 4, 5]
121
- const activeStatus = [0, 3, 4, 7, 8, 9, 14, 18, 19, 20, 21, 22, 23]
124
+ const activeStatus = [0, 3, 4, 7, 8, 9, 13, 14, 18, 19, 20, 21, 22, 23]
122
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
123
128
 
124
129
  const walletName: any = {
125
130
  cash: {
@@ -130,205 +135,6 @@ export const OrderDetailsUI = (props: OrderDetailsParams) => {
130
135
  }
131
136
  }
132
137
 
133
- const getOrderStatus = (s: string) => {
134
- const status = parseInt(s);
135
- const orderStatus = [
136
- {
137
- key: 0,
138
- value: t('PENDING', 'Pending'),
139
- slug: 'PENDING',
140
- percentage: 0.25,
141
- image: theme.images.order.status0,
142
- },
143
- {
144
- key: 1,
145
- value: t('COMPLETED', 'Completed'),
146
- slug: 'COMPLETED',
147
- percentage: 1,
148
- image: theme.images.order.status1,
149
- },
150
- {
151
- key: 2,
152
- value: t('REJECTED', 'Rejected'),
153
- slug: 'REJECTED',
154
- percentage: 0,
155
- image: theme.images.order.status2,
156
- },
157
- {
158
- key: 3,
159
- value: t('DRIVER_IN_BUSINESS', 'Driver in business'),
160
- slug: 'DRIVER_IN_BUSINESS',
161
- percentage: 0.6,
162
- image: theme.images.order.status3,
163
- },
164
- {
165
- key: 4,
166
- value: t('PREPARATION_COMPLETED', 'Preparation Completed'),
167
- slug: 'PREPARATION_COMPLETED',
168
- percentage: 0.7,
169
- image: theme.images.order.status4,
170
- },
171
- {
172
- key: 5,
173
- value: t('REJECTED_BY_BUSINESS', 'Rejected by business'),
174
- slug: 'REJECTED_BY_BUSINESS',
175
- percentage: 0,
176
- image: theme.images.order.status5,
177
- },
178
- {
179
- key: 6,
180
- value: t('REJECTED_BY_DRIVER', 'Rejected by Driver'),
181
- slug: 'REJECTED_BY_DRIVER',
182
- percentage: 0,
183
- image: theme.images.order.status6,
184
- },
185
- {
186
- key: 7,
187
- value: t('ACCEPTED_BY_BUSINESS', 'Accepted by business'),
188
- slug: 'ACCEPTED_BY_BUSINESS',
189
- percentage: 0.35,
190
- image: theme.images.order.status7,
191
- },
192
- {
193
- key: 8,
194
- value: t('ACCEPTED_BY_DRIVER', 'Accepted by driver'),
195
- slug: 'ACCEPTED_BY_DRIVER',
196
- percentage: 0.45,
197
- image: theme.images.order.status8,
198
- },
199
- {
200
- key: 9,
201
- value: t('PICK_UP_COMPLETED_BY_DRIVER', 'Pick up completed by driver'),
202
- slug: 'PICK_UP_COMPLETED_BY_DRIVER',
203
- percentage: 0.8,
204
- image: theme.images.order.status9,
205
- },
206
- {
207
- key: 10,
208
- value: t('PICK_UP_FAILED_BY_DRIVER', 'Pick up Failed by driver'),
209
- slug: 'PICK_UP_FAILED_BY_DRIVER',
210
- percentage: 0,
211
- image: theme.images.order.status10,
212
- },
213
- {
214
- key: 11,
215
- value: t(
216
- 'DELIVERY_COMPLETED_BY_DRIVER',
217
- 'Delivery completed by driver',
218
- ),
219
- slug: 'DELIVERY_COMPLETED_BY_DRIVER',
220
- percentage: 1,
221
- image: theme.images.order.status11,
222
- },
223
- {
224
- key: 12,
225
- value: t('DELIVERY_FAILED_BY_DRIVER', 'Delivery Failed by driver'),
226
- slug: 'DELIVERY_FAILED_BY_DRIVER',
227
- percentage: 0,
228
- image: theme.images.order.status12,
229
- },
230
- {
231
- key: 13,
232
- value: t('PREORDER', 'PreOrder'),
233
- slug: 'PREORDER',
234
- percentage: 0,
235
- image: theme.images.order.status13,
236
- },
237
- {
238
- key: 14,
239
- value: t('ORDER_NOT_READY', 'Order not ready'),
240
- slug: 'ORDER_NOT_READY',
241
- percentage: 0,
242
- image: theme.images.order.status13,
243
- },
244
- {
245
- key: 15,
246
- value: t(
247
- 'ORDER_PICKEDUP_COMPLETED_BY_CUSTOMER',
248
- 'Order picked up completed by customer',
249
- ),
250
- slug: 'ORDER_PICKEDUP_COMPLETED_BY_CUSTOMER',
251
- percentage: 100,
252
- image: theme.images.order.status1,
253
- },
254
- {
255
- key: 16,
256
- value: t('CANCELLED_BY_CUSTOMER', 'Cancelled by customer'),
257
- slug: 'CANCELLED_BY_CUSTOMER',
258
- percentage: 0,
259
- image: theme.images.order.status2,
260
- },
261
- {
262
- key: 17,
263
- value: t(
264
- 'ORDER_NOT_PICKEDUP_BY_CUSTOMER',
265
- 'Order not picked up by customer',
266
- ),
267
- slug: 'ORDER_NOT_PICKEDUP_BY_CUSTOMER',
268
- percentage: 0,
269
- image: theme.images.order.status2,
270
- },
271
- {
272
- key: 18,
273
- value: t(
274
- 'DRIVER_ALMOST_ARRIVED_TO_BUSINESS',
275
- 'Driver almost arrived to business',
276
- ),
277
- slug: 'DRIVER_ALMOST_ARRIVED_TO_BUSINESS',
278
- percentage: 0.15,
279
- image: theme.images.order.status3,
280
- },
281
- {
282
- key: 19,
283
- value: t(
284
- 'DRIVER_ALMOST_ARRIVED_TO_CUSTOMER',
285
- 'Driver almost arrived to customer',
286
- ),
287
- slug: 'DRIVER_ALMOST_ARRIVED_TO_CUSTOMER',
288
- percentage: 0.9,
289
- image: theme.images.order.status11,
290
- },
291
- {
292
- key: 20,
293
- value: t(
294
- 'ORDER_CUSTOMER_ALMOST_ARRIVED_BUSINESS',
295
- 'Customer almost arrived to business',
296
- ),
297
- slug: 'ORDER_CUSTOMER_ALMOST_ARRIVED_BUSINESS',
298
- percentage: 90,
299
- image: theme.images.order.status7,
300
- },
301
- {
302
- key: 21,
303
- value: t(
304
- 'ORDER_CUSTOMER_ARRIVED_BUSINESS',
305
- 'Customer arrived to business',
306
- ),
307
- slug: 'ORDER_CUSTOMER_ARRIVED_BUSINESS',
308
- percentage: 95,
309
- image: theme.images.order.status7,
310
- },
311
- {
312
- key: 22,
313
- value: t('ORDER_LOOKING_FOR_DRIVER', 'Looking for driver'),
314
- slug: 'ORDER_LOOKING_FOR_DRIVER',
315
- percentage: 35,
316
- image: theme.images.order.status8
317
- },
318
- {
319
- key: 23,
320
- value: t('ORDER_DRIVER_ON_WAY', 'Driver on way'),
321
- slug: 'ORDER_DRIVER_ON_WAY',
322
- percentage: 45,
323
- image: theme.images.order.status8
324
- }
325
- ];
326
-
327
- const objectStatus = orderStatus.find((o) => o.key === status);
328
-
329
- return objectStatus && objectStatus;
330
- };
331
-
332
138
  const handleGoToMessages = (type: string) => {
333
139
  readMessages && readMessages();
334
140
  navigation.navigate(
@@ -595,14 +401,12 @@ export const OrderDetailsUI = (props: OrderDetailsParams) => {
595
401
  style={{ marginTop: Platform.OS === 'ios' ? 0 : 20 }}
596
402
  titleWrapStyle={{ paddingHorizontal: 0 }}
597
403
  titleStyle={{ marginRight: 0, marginLeft: 0 }}
598
- subTitle={<OText size={12} lineHeight={18} color={theme.colors.textNormal}>
599
- {
600
- activeStatus.includes(order?.status)
601
- ? order?.eta_time + 'min'
602
- : order?.delivery_datetime_utc
603
- ? parseDate(order?.delivery_datetime_utc)
604
- : parseDate(order?.delivery_datetime, { utc: false })
605
- }
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
+ )}
606
410
  </OText>}
607
411
  />
608
412
  {enabledPoweredByOrdering && (
@@ -612,175 +416,179 @@ export const OrderDetailsUI = (props: OrderDetailsParams) => {
612
416
  </OText>
613
417
  </View>
614
418
  )}
615
- <OrderInfo>
616
- <OrderData>
617
- <View style={styles.linkWrapper}>
618
- {
619
- (
620
- parseInt(order?.status) === 1 ||
621
- parseInt(order?.status) === 11 ||
622
- parseInt(order?.status) === 15
623
- ) && !order.review && !isReviewed && (
624
- <TouchableOpacity
625
- activeOpacity={0.7}
626
- style={{ marginTop: 6, marginRight: 10 }}
627
- onPress={() => handleClickOrderReview(order)}
628
- >
629
- <OText
630
- size={12}
631
- lineHeight={15}
632
- color={theme.colors.primary}
633
- style={{ textDecorationLine: 'underline' }}
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)}
634
433
  >
635
- {t('REVIEW_YOUR_ORDER', 'Review your order')}
636
- </OText>
637
- </TouchableOpacity>
638
- )}
639
- <TouchableOpacity
640
- activeOpacity={0.7}
641
- style={{ marginTop: 6 }}
642
- onPress={() => setIsOrderHistory(true)}
643
-
644
- >
645
- <OText
646
- size={12}
647
- lineHeight={15}
648
- color={theme.colors.primary}
649
- 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
+
650
449
  >
651
- {t('VIEW_DETAILS', 'View Details')}
652
- </OText>
653
- </TouchableOpacity>
654
- </View>
655
-
656
- <StaturBar>
657
- <LinearGradient
658
- start={{ x: 0.0, y: 0.0 }}
659
- end={{
660
- x: getOrderStatus(order?.status)?.percentage || 0,
661
- y: 0,
662
- }}
663
- locations={[0.9999, 0.9999]}
664
- colors={[theme.colors.primary, theme.colors.backgroundGray100]}
665
- style={styles.statusBar}
666
- />
667
- </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>
668
495
  <OText
669
496
  size={16}
670
497
  lineHeight={24}
671
- weight={'600'}
672
- color={theme.colors.textNormal}>
673
- {getOrderStatus(order?.status)?.value}
498
+ weight={'500'}
499
+ color={theme.colors.textNormal}
500
+ mBottom={12}>
501
+ {t('FROM', 'From')}
674
502
  </OText>
675
- </OrderData>
676
- <View
677
- style={{
678
- height: 8,
679
- backgroundColor: theme.colors.backgroundGray100,
680
- marginTop: 18,
681
- marginHorizontal: -40,
682
- }}
683
- />
684
- </OrderInfo>
685
- </Header>
686
- <OrderContent>
687
- <OrderBusiness>
688
- <OText
689
- size={16}
690
- lineHeight={24}
691
- weight={'500'}
692
- color={theme.colors.textNormal}
693
- mBottom={12}>
694
- {t('FROM', 'From')}
695
- </OText>
696
- <View
697
- style={{
698
- display: 'flex',
699
- flexDirection: 'column',
700
- alignItems: 'flex-start',
701
- }}>
702
503
  <View
703
504
  style={{
704
- flexDirection: 'row',
705
- alignItems: 'center',
706
- justifyContent: 'space-between',
505
+ display: 'flex',
506
+ flexDirection: 'column',
507
+ alignItems: 'flex-start',
707
508
  }}>
708
- <OText
709
- size={13}
710
- lineHeight={20}
711
- color={theme.colors.textNormal}
712
- style={{ flexGrow: 1, flexBasis: '80%' }}>
713
- {order?.business?.name}
714
- </OText>
715
- <Icons>
716
- {!!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
+ )}
717
537
  <TouchableOpacity
718
- onPress={() => order?.business?.cellphone &&
719
- Linking.openURL(`tel:${order?.business?.cellphone}`)
720
- }
721
- style={{ paddingEnd: 5 }}
722
- >
538
+ style={{ paddingStart: 5 }}
539
+ onPress={() => handleGoToMessages('business')}>
723
540
  <OIcon
724
- src={theme.images.general.phone}
541
+ src={theme.images.general.chat}
725
542
  width={16}
726
543
  color={theme.colors.disabled}
727
544
  />
728
545
  </TouchableOpacity>
729
- )}
730
- <TouchableOpacity
731
- style={{ paddingStart: 5 }}
732
- onPress={() => handleGoToMessages('business')}>
733
- <OIcon
734
- src={theme.images.general.chat}
735
- width={16}
736
- color={theme.colors.disabled}
737
- />
738
- </TouchableOpacity>
739
- </Icons>
740
- </View>
741
- <OText
742
- size={12}
743
- lineHeight={18}
744
- color={theme.colors.textNormal}
745
- mBottom={2}>
746
- {order?.business?.email}
747
- </OText>
748
- {!!order?.business?.cellphone && (
546
+ </Icons>
547
+ </View>
749
548
  <OText
750
549
  size={12}
751
550
  lineHeight={18}
752
551
  color={theme.colors.textNormal}
753
552
  mBottom={2}>
754
- {order?.business?.cellphone}
553
+ {order?.business?.email}
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}
755
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
+ />
756
587
  )}
757
- <OText size={12} lineHeight={18} color={theme.colors.textNormal}>
758
- {order?.business?.address}
759
- </OText>
760
- </View>
761
- {directionTypes.includes(order?.delivery_type) && (
762
- <OButton
763
- text={t('GET_DIRECTIONS', 'Get Directions')}
764
- imgRightSrc=''
765
- textStyle={{ color: theme.colors.white }}
766
- style={{
767
- alignSelf: 'center',
768
- borderRadius: 10,
769
- marginTop: 30
770
- }}
771
- onClick={() => showLocation({
772
- latitude: order?.business?.location?.lat,
773
- longitude: order?.business?.location?.lng,
774
- naverCallerName: 'com.reactnativeappstemplate5',
775
- dialogTitle: t('GET_DIRECTIONS', 'Get Directions'),
776
- dialogMessage: t('WHAT_APP_WOULD_YOU_USE', 'What app would you like to use?'),
777
- cancelText: t('CANCEL', 'Cancel'),
778
- })}
779
- />
780
- )}
781
- </OrderBusiness>
588
+ </OrderBusiness>
589
+ )}
782
590
 
783
- {placeSpotTypes.includes(order?.delivery_type) && (
591
+ {!isGiftCardOrder && placeSpotTypes.includes(order?.delivery_type) && (
784
592
  <PlaceSpotWrapper>
785
593
  <PlaceSpot
786
594
  isInputMode
@@ -806,7 +614,7 @@ export const OrderDetailsUI = (props: OrderDetailsParams) => {
806
614
  weight={'500'}
807
615
  color={theme.colors.textNormal}
808
616
  mBottom={12}>
809
- {t('TO', 'To')}
617
+ {isGiftCardOrder ? t('CUSTOMER', 'Customer') : t('TO', 'To')}
810
618
  </OText>
811
619
  <Customer>
812
620
  <InfoBlock>
@@ -835,7 +643,7 @@ export const OrderDetailsUI = (props: OrderDetailsParams) => {
835
643
  )}
836
644
  </InfoBlock>
837
645
  </Customer>
838
- {order?.delivery_option !== undefined && order?.delivery_type === 1 && (
646
+ {!isGiftCardOrder && order?.delivery_option !== undefined && order?.delivery_type === 1 && (
839
647
  <View style={{ marginTop: 15 }}>
840
648
  <OText size={16} style={{ textAlign: 'left' }} color={theme.colors.textNormal}>
841
649
  {t('DELIVERY_PREFERENCE', 'Delivery Preference')}
@@ -857,7 +665,7 @@ export const OrderDetailsUI = (props: OrderDetailsParams) => {
857
665
  <>
858
666
  {order?.driver?.location && mapValidStatuses.includes(parseInt(order?.status)) && (
859
667
  <Map>
860
- <GoogleMap
668
+ <GoogleMap
861
669
  location={typeof order?.driver?.location?.location === 'string'
862
670
  ? {
863
671
  lat: parseFloat(driverLocationString[0]),
@@ -1017,7 +825,9 @@ export const OrderDetailsUI = (props: OrderDetailsParams) => {
1017
825
  </Table>
1018
826
  ))
1019
827
  }
1020
- <Divider />
828
+ {!isGiftCardOrder && (
829
+ <Divider />
830
+ )}
1021
831
  {order?.summary?.subtotal_with_discount > 0 && order?.summary?.discount > 0 && order?.summary?.total >= 0 && (
1022
832
  <Table>
1023
833
  <OText size={12} lineHeight={18} weight={'400'} color={theme.colors.textNormal}>{t('SUBTOTAL_WITH_DISCOUNT', 'Subtotal with discount')}</OText>
@@ -1099,7 +909,7 @@ export const OrderDetailsUI = (props: OrderDetailsParams) => {
1099
909
  </Table>
1100
910
  ))
1101
911
  }
1102
- {order?.summary?.delivery_price > 0 && (
912
+ {typeof order?.summary?.delivery_price === 'number' && (
1103
913
  <Table>
1104
914
  <OText size={12} lineHeight={18} weight={'400'} color={theme.colors.textNormal}>{t('DELIVERY_FEE', 'Delivery Fee')}</OText>
1105
915
  <OText size={12} lineHeight={18} weight={'400'} color={theme.colors.textNormal}>{parsePrice(order?.summary?.delivery_price)}</OText>
@@ -1174,13 +984,13 @@ export const OrderDetailsUI = (props: OrderDetailsParams) => {
1174
984
  <OText>
1175
985
  {event?.wallet_event
1176
986
  ? walletName[event?.wallet_event?.wallet?.type]?.name
1177
- : event?.paymethod?.name}
987
+ : t(event?.paymethod?.name.toUpperCase()?.replace(/ /g, '_'), event?.paymethod?.name)}
1178
988
  </OText>
1179
- {event?.data?.charge_id && (
989
+ {/* {event?.data?.charge_id && (
1180
990
  <OText>
1181
991
  {`${t('CODE', 'Code')}: ${event?.data?.charge_id}`}
1182
992
  </OText>
1183
- )}
993
+ )} */}
1184
994
  </View>
1185
995
  <OText>
1186
996
  -{parsePrice(event.amount, { isTruncable: true })}
@@ -1191,6 +1001,23 @@ export const OrderDetailsUI = (props: OrderDetailsParams) => {
1191
1001
  </View>
1192
1002
  )}
1193
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
+ )}
1194
1021
  </OrderContent>
1195
1022
  </>
1196
1023
  )}
@@ -1212,6 +1039,7 @@ export const OrderDetailsUI = (props: OrderDetailsParams) => {
1212
1039
  >
1213
1040
  <OrderHistory
1214
1041
  order={order}
1042
+ hideViaText={props.hideViaText}
1215
1043
  messages={messages}
1216
1044
  enableReview={(
1217
1045
  parseInt(order?.status) === 1 ||