ordering-ui-react-native 0.21.50 → 0.21.51-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 (198) hide show
  1. package/package.json +8 -8
  2. package/src/DeliveryApp.tsx +43 -1
  3. package/src/components/BusinessesListing/index.tsx +1 -1
  4. package/src/components/PaymentOptionsWebView/index.tsx +1 -0
  5. package/src/components/StripeMethodForm/index.tsx +6 -4
  6. package/src/components/VerifyPhone/styles.tsx +1 -2
  7. package/src/types/index.tsx +3 -1
  8. package/themes/business/index.tsx +4 -0
  9. package/themes/business/src/components/AcceptOrRejectOrder/index.tsx +4 -3
  10. package/themes/business/src/components/BusinessController/index.tsx +19 -17
  11. package/themes/business/src/components/BusinessProductList/ProductList.tsx +72 -27
  12. package/themes/business/src/components/BusinessProductList/index.tsx +57 -25
  13. package/themes/business/src/components/DriverMap/index.tsx +36 -23
  14. package/themes/business/src/components/GoogleMap/index.tsx +15 -8
  15. package/themes/business/src/components/Home/index.tsx +5 -1
  16. package/themes/business/src/components/LanguageSelector/index.tsx +1 -2
  17. package/themes/business/src/components/LanguageSelector/lang_country.json +515 -70
  18. package/themes/business/src/components/LogoutButton/index.tsx +1 -1
  19. package/themes/business/src/components/MapView/index.tsx +30 -15
  20. package/themes/business/src/components/NewOrderNotification/index.tsx +66 -26
  21. package/themes/business/src/components/OrderDetails/Business.tsx +52 -2
  22. package/themes/business/src/components/OrderDetails/Delivery.tsx +42 -23
  23. package/themes/business/src/components/OrderDetails/OrderContentComponent.tsx +68 -61
  24. package/themes/business/src/components/OrderDetails/OrderHeaderComponent.tsx +40 -20
  25. package/themes/business/src/components/OrderDetails/usePrinterCommands.tsx +220 -0
  26. package/themes/business/src/components/OrderSummary/index.tsx +240 -76
  27. package/themes/business/src/components/OrdersOption/index.tsx +263 -135
  28. package/themes/business/src/components/PhoneInputNumber/index.tsx +8 -5
  29. package/themes/business/src/components/PreviousOrders/OrderItem.tsx +37 -40
  30. package/themes/business/src/components/PreviousOrders/OrderList.tsx +1 -1
  31. package/themes/business/src/components/PreviousOrders/index.tsx +5 -3
  32. package/themes/business/src/components/PreviousOrders/styles.tsx +10 -0
  33. package/themes/business/src/components/PrinterEdition/index.tsx +363 -0
  34. package/themes/business/src/components/PrinterEdition/styles.tsx +61 -0
  35. package/themes/business/src/components/PrinterSettings/index.tsx +267 -0
  36. package/themes/business/src/components/PrinterSettings/styles.tsx +30 -0
  37. package/themes/business/src/components/ProductItemAccordion/index.tsx +2 -2
  38. package/themes/business/src/components/ReviewCustomer/index.tsx +2 -0
  39. package/themes/business/src/components/SearchBar/index.tsx +2 -1
  40. package/themes/business/src/components/Sessions/index.tsx +187 -0
  41. package/themes/business/src/components/Sessions/styles.tsx +20 -0
  42. package/themes/business/src/components/StoresList/index.tsx +5 -3
  43. package/themes/business/src/components/UserFormDetails/index.tsx +111 -107
  44. package/themes/business/src/components/UserProfileForm/index.tsx +106 -54
  45. package/themes/business/src/components/WebsocketStatus/index.tsx +2 -2
  46. package/themes/business/src/components/shared/OInput.tsx +2 -0
  47. package/themes/business/src/components/shared/OTextarea.tsx +8 -9
  48. package/themes/business/src/hooks/useLocation.tsx +5 -4
  49. package/themes/business/src/types/index.tsx +23 -5
  50. package/themes/business/src/utils/index.tsx +5 -0
  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/NavBar/index.tsx +14 -14
  56. package/themes/kiosk/src/components/OptionCard/index.tsx +1 -1
  57. package/themes/kiosk/src/components/OrderTypeCardSelector/index.tsx +8 -10
  58. package/themes/kiosk/src/components/shared/OButton.tsx +5 -18
  59. package/themes/original/index.tsx +6 -2
  60. package/themes/original/src/components/AddressDetails/index.tsx +20 -10
  61. package/themes/original/src/components/AddressForm/index.tsx +41 -15
  62. package/themes/original/src/components/AddressForm/styles.tsx +1 -1
  63. package/themes/original/src/components/AddressList/index.tsx +18 -4
  64. package/themes/original/src/components/AddressList/styles.tsx +4 -4
  65. package/themes/original/src/components/AnalyticsSegment/index.tsx +6 -6
  66. package/themes/original/src/components/AppleLogin/index.tsx +4 -4
  67. package/themes/original/src/components/BusinessBasicInformation/index.tsx +7 -10
  68. package/themes/original/src/components/BusinessBasicInformation/styles.tsx +1 -1
  69. package/themes/original/src/components/BusinessController/index.tsx +18 -10
  70. package/themes/original/src/components/BusinessController/styles.tsx +8 -7
  71. package/themes/original/src/components/BusinessInformation/styles.tsx +2 -2
  72. package/themes/original/src/components/BusinessItemAccordion/index.tsx +4 -3
  73. package/themes/original/src/components/BusinessListingSearch/BusinessSearchFooter.tsx +317 -0
  74. package/themes/original/src/components/BusinessListingSearch/BusinessSearchHeader.tsx +96 -0
  75. package/themes/original/src/components/BusinessListingSearch/index.tsx +47 -358
  76. package/themes/original/src/components/BusinessListingSearch/styles.tsx +1 -1
  77. package/themes/original/src/components/BusinessPreorder/index.tsx +4 -3
  78. package/themes/original/src/components/BusinessProductsCategories/index.tsx +1 -1
  79. package/themes/original/src/components/BusinessProductsList/index.tsx +1 -1
  80. package/themes/original/src/components/BusinessProductsList/styles.tsx +0 -3
  81. package/themes/original/src/components/BusinessProductsListing/index.tsx +30 -18
  82. package/themes/original/src/components/BusinessProductsListing/styles.tsx +2 -2
  83. package/themes/original/src/components/BusinessReviews/index.tsx +1 -1
  84. package/themes/original/src/components/BusinessesListing/Layout/Appointment/index.tsx +1 -1
  85. package/themes/original/src/components/BusinessesListing/Layout/Appointment/styles.tsx +5 -5
  86. package/themes/original/src/components/BusinessesListing/Layout/Original/FlatListBusinessListFooter.tsx +1 -1
  87. package/themes/original/src/components/BusinessesListing/Layout/Original/FlatListBusinessListHeader.tsx +7 -7
  88. package/themes/original/src/components/BusinessesListing/Layout/Original/index.tsx +2 -2
  89. package/themes/original/src/components/BusinessesListing/Layout/Original/styles.tsx +1 -1
  90. package/themes/original/src/components/BusinessesListing/index.tsx +0 -1
  91. package/themes/original/src/components/Cart/index.tsx +30 -9
  92. package/themes/original/src/components/CartContent/index.tsx +96 -58
  93. package/themes/original/src/components/CartStoresListing/styles.tsx +2 -2
  94. package/themes/original/src/components/Checkout/index.tsx +144 -62
  95. package/themes/original/src/components/Checkout/styles.tsx +17 -0
  96. package/themes/original/src/components/CitiesControl/styles.tsx +1 -1
  97. package/themes/original/src/components/DatePicker/index.tsx +18 -2
  98. package/themes/original/src/components/Favorite/index.tsx +9 -9
  99. package/themes/original/src/components/Favorite/styles.tsx +0 -2
  100. package/themes/original/src/components/FloatingButton/styles.tsx +1 -1
  101. package/themes/original/src/components/ForgotPasswordForm/index.tsx +5 -0
  102. package/themes/original/src/components/GPSButton/index.tsx +1 -1
  103. package/themes/original/src/components/GiftCard/GiftCardOrdersList/index.tsx +64 -0
  104. package/themes/original/src/components/GiftCard/GiftCardOrdersList/styles.tsx +8 -0
  105. package/themes/original/src/components/GiftCard/PurchaseGiftCard/styles.tsx +1 -1
  106. package/themes/original/src/components/GiftCard/RedeemGiftCard/styles.tsx +1 -1
  107. package/themes/original/src/components/GiftCard/SendGiftCard/index.tsx +2 -2
  108. package/themes/original/src/components/GiftCard/SendGiftCard/styles.tsx +1 -1
  109. package/themes/original/src/components/GiftCard/SingleGiftCard/index.tsx +101 -0
  110. package/themes/original/src/components/GiftCard/SingleGiftCard/styles.tsx +4 -0
  111. package/themes/original/src/components/GiftCard/VerticalGiftCardOrdersLayout/index.tsx +83 -0
  112. package/themes/original/src/components/GiftCard/VerticalGiftCardOrdersLayout/styles.tsx +9 -0
  113. package/themes/original/src/components/GoogleMap/index.tsx +39 -18
  114. package/themes/original/src/components/Help/index.tsx +7 -0
  115. package/themes/original/src/components/HelpAccountAndPayment/index.tsx +5 -0
  116. package/themes/original/src/components/HelpGuide/index.tsx +5 -0
  117. package/themes/original/src/components/HelpOrder/index.tsx +5 -0
  118. package/themes/original/src/components/HighestRatedBusinesses/index.tsx +2 -2
  119. package/themes/original/src/components/HighestRatedBusinesses/styles.tsx +1 -1
  120. package/themes/original/src/components/Home/index.tsx +3 -8
  121. package/themes/original/src/components/LoginForm/Otp/index.tsx +4 -16
  122. package/themes/original/src/components/LoginForm/index.tsx +9 -3
  123. package/themes/original/src/components/MessageListing/index.tsx +6 -0
  124. package/themes/original/src/components/Messages/index.tsx +8 -7
  125. package/themes/original/src/components/Messages/styles.tsx +1 -1
  126. package/themes/original/src/components/MomentOption/index.tsx +19 -4
  127. package/themes/original/src/components/MultiCart/index.tsx +1 -1
  128. package/themes/original/src/components/MultiCartsPaymethodsAndWallets/index.tsx +7 -3
  129. package/themes/original/src/components/MultiCheckout/index.tsx +126 -61
  130. package/themes/original/src/components/MultiCheckout/styles.tsx +17 -0
  131. package/themes/original/src/components/MultiOrdersDetails/index.tsx +20 -15
  132. package/themes/original/src/components/MyOrders/index.tsx +28 -28
  133. package/themes/original/src/components/NavBar/index.tsx +5 -0
  134. package/themes/original/src/components/NetworkError/index.tsx +2 -3
  135. package/themes/original/src/components/NetworkError/styles.tsx +2 -2
  136. package/themes/original/src/components/Notifications/index.tsx +9 -8
  137. package/themes/original/src/components/Notifications/styles.tsx +0 -1
  138. package/themes/original/src/components/OrderDetails/OrderHistory.tsx +1 -1
  139. package/themes/original/src/components/OrderDetails/index.tsx +701 -662
  140. package/themes/original/src/components/OrderDetails/styles.tsx +24 -8
  141. package/themes/original/src/components/OrderProgress/index.tsx +22 -3
  142. package/themes/original/src/components/OrderProgress/styles.tsx +1 -1
  143. package/themes/original/src/components/OrderSummary/index.tsx +3 -1
  144. package/themes/original/src/components/OrderTypeSelector/index.tsx +10 -6
  145. package/themes/original/src/components/OrdersOption/PreviousBusinessOrdered/styles.tsx +1 -1
  146. package/themes/original/src/components/OrdersOption/PreviousProductsOrdered/styles.tsx +1 -1
  147. package/themes/original/src/components/OrdersOption/index.tsx +3 -5
  148. package/themes/original/src/components/OrdersOption/styles.tsx +1 -1
  149. package/themes/original/src/components/PaymentOptionCard/index.tsx +4 -2
  150. package/themes/original/src/components/PaymentOptionWallet/index.tsx +56 -56
  151. package/themes/original/src/components/PaymentOptions/index.tsx +47 -4
  152. package/themes/original/src/components/PreviousOrders/index.tsx +2 -0
  153. package/themes/original/src/components/ProductForm/ActionButton.tsx +122 -0
  154. package/themes/original/src/components/ProductForm/ExtraOptions.tsx +56 -0
  155. package/themes/original/src/components/ProductForm/index.tsx +170 -252
  156. package/themes/original/src/components/ProductItemAccordion/index.tsx +55 -44
  157. package/themes/original/src/components/ProductItemAccordion/styles.tsx +3 -4
  158. package/themes/original/src/components/ProductOptionSubOption/index.tsx +112 -91
  159. package/themes/original/src/components/ProfessionalProfile/styles.tsx +3 -3
  160. package/themes/original/src/components/Promotions/index.tsx +13 -11
  161. package/themes/original/src/components/Promotions/styles.tsx +0 -2
  162. package/themes/original/src/components/ReviewDriver/index.tsx +5 -0
  163. package/themes/original/src/components/ReviewDriver/styles.tsx +1 -1
  164. package/themes/original/src/components/ReviewOrder/index.tsx +5 -0
  165. package/themes/original/src/components/ReviewOrder/styles.tsx +1 -1
  166. package/themes/original/src/components/ReviewProducts/index.tsx +5 -0
  167. package/themes/original/src/components/ReviewProducts/styles.tsx +1 -1
  168. package/themes/original/src/components/ServiceForm/index.tsx +1 -1
  169. package/themes/original/src/components/ServiceForm/styles.tsx +4 -4
  170. package/themes/original/src/components/Sessions/index.tsx +5 -0
  171. package/themes/original/src/components/SignupForm/index.tsx +67 -59
  172. package/themes/original/src/components/SingleOrderCard/index.tsx +1 -1
  173. package/themes/original/src/components/SingleProductCard/index.tsx +4 -3
  174. package/themes/original/src/components/SingleProductCard/styles.tsx +0 -3
  175. package/themes/original/src/components/StripeCardsList/index.tsx +12 -35
  176. package/themes/original/src/components/StripeElementsForm/index.tsx +79 -59
  177. package/themes/original/src/components/StripeElementsForm/naked.tsx +48 -1
  178. package/themes/original/src/components/UpsellingProducts/UpsellingContent.tsx +170 -0
  179. package/themes/original/src/components/UpsellingProducts/UpsellingLayout.tsx +91 -0
  180. package/themes/original/src/components/UpsellingProducts/index.tsx +15 -199
  181. package/themes/original/src/components/UpsellingProducts/styles.tsx +19 -0
  182. package/themes/original/src/components/UserFormDetails/index.tsx +100 -86
  183. package/themes/original/src/components/UserFormDetails/styles.tsx +7 -0
  184. package/themes/original/src/components/UserProfile/index.tsx +3 -2
  185. package/themes/original/src/components/UserProfileForm/index.tsx +5 -0
  186. package/themes/original/src/components/WalletTransactions/styles.tsx +1 -0
  187. package/themes/original/src/components/Wallets/index.tsx +7 -4
  188. package/themes/original/src/components/Wallets/styles.tsx +2 -1
  189. package/themes/original/src/components/WebsocketStatus/index.tsx +172 -0
  190. package/themes/original/src/components/WebsocketStatus/styles.tsx +28 -0
  191. package/themes/original/src/components/shared/HeaderTitle.tsx +1 -1
  192. package/themes/original/src/components/shared/OButton.tsx +5 -5
  193. package/themes/original/src/components/shared/OInput.tsx +1 -4
  194. package/themes/original/src/components/shared/OModal.tsx +12 -14
  195. package/themes/original/src/layouts/Container.tsx +5 -3
  196. package/themes/original/src/types/index.tsx +6 -1
  197. package/themes/original/src/utils/index.tsx +12 -1
  198. package/themes/uber-eats/src/components/BusinessesListing/index.tsx +1 -1
@@ -1,6 +1,7 @@
1
1
  import React, { useState, useEffect, useMemo } from 'react';
2
- import { View, StyleSheet, BackHandler, Platform, Linking, RefreshControl } from 'react-native';
2
+ import { View, StyleSheet, BackHandler, Platform, Linking, RefreshControl, SafeAreaView } from 'react-native';
3
3
  import LinearGradient from 'react-native-linear-gradient';
4
+ import IconAntDesign from 'react-native-vector-icons/AntDesign';
4
5
  import { _setStoreData } from '../../providers/StoreUtil';
5
6
  import {
6
7
  useLanguage,
@@ -35,7 +36,9 @@ import {
35
36
  Divider,
36
37
  OrderAction,
37
38
  PlaceSpotWrapper,
38
- ProfessionalPhoto
39
+ ProfessionalPhoto,
40
+ TopHeader,
41
+ TopActions
39
42
  } from './styles';
40
43
  import { OButton, OIcon, OModal, OText } from '../shared';
41
44
  import { ProductItemAccordion } from '../ProductItemAccordion';
@@ -106,6 +109,10 @@ export const OrderDetailsUI = (props: OrderDetailsParams) => {
106
109
  borderBottomWidth: 1,
107
110
  marginVertical: 10,
108
111
  paddingVertical: 5
112
+ },
113
+ wrapperNavbar: {
114
+ paddingHorizontal: 20,
115
+ paddingTop: 0,
109
116
  }
110
117
  });
111
118
 
@@ -119,6 +126,8 @@ export const OrderDetailsUI = (props: OrderDetailsParams) => {
119
126
  const [isOrderHistory, setIsOrderHistory] = useState(false)
120
127
  const [openTaxModal, setOpenTaxModal] = useState<any>({ open: false, tax: null, type: '' })
121
128
  const [refreshing] = useState(false);
129
+ const [showTitle, setShowTitle] = useState(false)
130
+
122
131
  const { order, businessData } = props.order;
123
132
  const mapValidStatuses = [9, 19, 23]
124
133
  const placeSpotTypes = [3, 4, 5]
@@ -222,6 +231,10 @@ export const OrderDetailsUI = (props: OrderDetailsParams) => {
222
231
  getOrder()
223
232
  }
224
233
 
234
+ const handleScroll = ({ nativeEvent: { contentOffset } }: any) => {
235
+ setShowTitle(contentOffset.y > 30)
236
+ }
237
+
225
238
  useEffect(() => {
226
239
  const _businessId = 'businessId:' + businessData?.id
227
240
  if (reorderState?.error) {
@@ -257,7 +270,7 @@ export const OrderDetailsUI = (props: OrderDetailsParams) => {
257
270
  title: t('DRIVER', 'Driver'),
258
271
  icon:
259
272
  order?.driver?.photo ||
260
- 'https://res.cloudinary.com/demo/image/fetch/c_thumb,g_face,r_max/https://www.freeiconspng.com/thumbs/driver-icon/driver-icon-14.png',
273
+ theme?.images?.general?.driverPng,
261
274
  },
262
275
  {
263
276
  ...order?.business?.location,
@@ -355,157 +368,52 @@ export const OrderDetailsUI = (props: OrderDetailsParams) => {
355
368
  }, [order?.delivery_type])
356
369
 
357
370
  return (
358
- <OrderDetailsContainer
359
- keyboardShouldPersistTaps="handled"
360
- refreshControl={
361
- <RefreshControl
362
- refreshing={refreshing}
363
- onRefresh={() => resfreshOrder()}
364
- />
365
- }
366
- >
367
- {(!order || Object.keys(order).length === 0) && (
368
- <Placeholder style={{ marginTop: 30 }}>
369
- <Header>
370
- <OrderInfo>
371
- <OrderData>
372
- <PlaceholderLine width={60} height={15} />
373
- <PlaceholderLine width={60} height={10} />
374
- <StaturBar>
375
- <PlaceholderLine height={15} />
376
- <PlaceholderLine width={40} height={20} />
377
- </StaturBar>
378
- </OrderData>
379
- <View
380
- style={{
381
- height: 8,
382
- backgroundColor: theme.colors.backgroundGray100,
383
- marginTop: 18,
384
- marginHorizontal: -40,
385
- }}
371
+ <>
372
+ <View style={styles.wrapperNavbar}>
373
+ <TopHeader>
374
+ <>
375
+ <TopActions onPress={() => handleArrowBack()}>
376
+ <IconAntDesign
377
+ name='arrowleft'
378
+ size={26}
386
379
  />
387
- </OrderInfo>
388
- </Header>
389
- <OrderContent>
390
- <OrderBusiness>
391
- <PlaceholderLine width={30} height={20} />
392
- <PlaceholderLine width={60} height={15} />
393
- <PlaceholderLine width={75} height={10} />
394
- <PlaceholderLine width={40} height={10} />
395
- <PlaceholderLine width={95} height={10} />
396
- </OrderBusiness>
397
- </OrderContent>
398
- <View
399
- style={{
400
- height: 8,
401
- backgroundColor: theme.colors.backgroundGray100,
402
- marginTop: 18,
403
- marginHorizontal: -40,
404
- }}
405
- />
406
- <OrderCustomer>
407
- <PlaceholderLine width={20} height={20} />
408
- <PlaceholderLine width={70} height={15} />
409
- <PlaceholderLine width={65} height={10} />
410
- <PlaceholderLine width={80} height={10} />
411
- <PlaceholderLine width={70} height={10} />
412
- <View style={{ marginTop: 10 }}>
413
- <PlaceholderLine width={60} height={20} />
414
- <PlaceholderLine width={40} height={10} />
415
- </View>
416
- </OrderCustomer>
417
- </Placeholder>
418
- )}
419
- {order && Object.keys(order).length > 0 && (
420
- <>
421
- <Header>
422
- <NavBar
423
- title={`${t('ORDER', 'Order')} #${order?.id}`}
424
- titleAlign={'center'}
425
- onActionLeft={handleArrowBack}
426
- showCall={false}
427
- btnStyle={{ paddingLeft: 0 }}
428
- style={{ marginTop: Platform.OS === 'ios' ? 0 : 20 }}
429
- titleWrapStyle={{ paddingHorizontal: 0 }}
430
- titleStyle={{ marginRight: 0, marginLeft: 0 }}
431
- subTitle={!hideDeliveryDate && <OText size={12} lineHeight={18} color={theme.colors.textNormal}>
432
- {activeStatus.includes(order?.status) ? (
433
- <OrderEta order={order} />
434
- ) : (
435
- parseDate(order?.reporting_data?.at[`status:${order.status}`])
436
- )}
437
- </OText>}
438
- />
439
- {enabledPoweredByOrdering && (
440
- <View style={{ display: 'flex', justifyContent: 'center', alignItems: 'center' }}>
441
- <OText>
442
- Powered By Ordering.co
443
- </OText>
444
- </View>
380
+ </TopActions>
381
+ {showTitle && (
382
+ <OText
383
+ size={16}
384
+ style={{ flex: 1, textAlign: 'center', right: 15 }}
385
+ weight={Platform.OS === 'ios' ? '600' : 'bold'}
386
+ numberOfLines={2}
387
+ ellipsizeMode='tail'
388
+ >
389
+ {`${t('ORDER', 'Order')} #${order?.id}`}
390
+ </OText>
445
391
  )}
446
- {!isGiftCardOrder && (
392
+ </>
393
+ </TopHeader>
394
+ </View>
395
+ <OrderDetailsContainer
396
+ keyboardShouldPersistTaps="handled"
397
+ refreshControl={
398
+ <RefreshControl
399
+ refreshing={refreshing}
400
+ onRefresh={() => resfreshOrder()}
401
+ />
402
+ }
403
+ onScroll={handleScroll}
404
+ >
405
+
406
+ {(!order || Object.keys(order).length === 0) && (
407
+ <Placeholder style={{ marginTop: 30 }}>
408
+ <Header>
447
409
  <OrderInfo>
448
410
  <OrderData>
449
- <View style={styles.linkWrapper}>
450
- {
451
- (
452
- parseInt(order?.status) === 1 ||
453
- parseInt(order?.status) === 11 ||
454
- parseInt(order?.status) === 15
455
- ) && !order.review && !isReviewed && (
456
- <TouchableOpacity
457
- activeOpacity={0.7}
458
- style={{ marginTop: 6, marginRight: 10 }}
459
- onPress={() => handleClickOrderReview(order)}
460
- >
461
- <OText
462
- size={12}
463
- lineHeight={15}
464
- color={theme.colors.primary}
465
- style={{ textDecorationLine: 'underline' }}
466
- >
467
- {t('REVIEW_YOUR_ORDER', 'Review your order')}
468
- </OText>
469
- </TouchableOpacity>
470
- )}
471
- <TouchableOpacity
472
- activeOpacity={0.7}
473
- style={{ marginTop: 6 }}
474
- onPress={() => setIsOrderHistory(true)}
475
- >
476
- <OText
477
- size={12}
478
- lineHeight={15}
479
- color={theme.colors.primary}
480
- style={{ textDecorationLine: 'underline', textTransform: 'capitalize' }}
481
- >
482
- {t('VIEW_DETAILS', 'View Details')}
483
- </OText>
484
- </TouchableOpacity>
485
- </View>
486
- {!hideDeliveryProgress && (
487
- <>
488
- <StaturBar>
489
- <LinearGradient
490
- start={{ x: 0.0, y: 0.0 }}
491
- end={{
492
- x: progressBarObjt(order?.status)?.percentage || 0,
493
- y: 0,
494
- }}
495
- locations={[0.9999, 0.9999]}
496
- colors={[theme.colors.primary, theme.colors.backgroundGray100]}
497
- style={styles.statusBar}
498
- />
499
- </StaturBar>
500
- <OText
501
- size={16}
502
- lineHeight={24}
503
- weight={'600'}
504
- color={theme.colors.textNormal}>
505
- {progressBarObjt(order?.status)?.value}
506
- </OText>
507
- </>
508
- )}
411
+ <PlaceholderLine width={60} height={15} />
412
+ <PlaceholderLine width={60} height={10} />
413
+ <StaturBar>
414
+ <PlaceholderLine height={15} />
415
+ <PlaceholderLine width={40} height={20} />
416
+ </StaturBar>
509
417
  </OrderData>
510
418
  <View
511
419
  style={{
@@ -516,124 +424,16 @@ export const OrderDetailsUI = (props: OrderDetailsParams) => {
516
424
  }}
517
425
  />
518
426
  </OrderInfo>
519
- )}
520
- </Header>
521
- <OrderContent>
522
- {!isGiftCardOrder && (
427
+ </Header>
428
+ <OrderContent>
523
429
  <OrderBusiness>
524
- <OText
525
- size={16}
526
- lineHeight={24}
527
- weight={'500'}
528
- color={theme.colors.textNormal}
529
- mBottom={12}>
530
- {t('FROM', 'From')}
531
- </OText>
532
- <View
533
- style={{
534
- display: 'flex',
535
- flexDirection: 'column',
536
- alignItems: 'flex-start',
537
- }}>
538
- <View
539
- style={{
540
- flexDirection: 'row',
541
- alignItems: 'center',
542
- justifyContent: 'space-between',
543
- }}>
544
- <OText
545
- size={13}
546
- lineHeight={20}
547
- color={theme.colors.textNormal}
548
- style={{ flexGrow: 1, flexBasis: '80%' }}>
549
- {order?.business?.name}
550
- </OText>
551
- <Icons>
552
- {!!order?.business?.cellphone && !hideBusinessPhone && (
553
- <TouchableOpacity
554
- onPress={() => order?.business?.cellphone &&
555
- Linking.openURL(`tel:${order?.business?.cellphone}`)
556
- }
557
- style={{ paddingEnd: 5 }}
558
- >
559
- <OIcon
560
- src={theme.images.general.phone}
561
- width={16}
562
- color={theme.colors.disabled}
563
- />
564
- </TouchableOpacity>
565
- )}
566
- {!hideBusinessMessages && (
567
- <TouchableOpacity
568
- style={{ paddingStart: 5 }}
569
- onPress={() => handleGoToMessages('business')}>
570
- <OIcon
571
- src={theme.images.general.chat}
572
- width={16}
573
- color={theme.colors.disabled}
574
- />
575
- </TouchableOpacity>
576
- )}
577
- </Icons>
578
- </View>
579
- {!hideBusinessEmail && (
580
- <OText
581
- size={12}
582
- lineHeight={18}
583
- color={theme.colors.textNormal}
584
- mBottom={2}>
585
- {order?.business?.email}
586
- </OText>
587
- )}
588
- {!!order?.business?.cellphone && !hideBusinessPhone && (
589
- <OText
590
- size={12}
591
- lineHeight={18}
592
- color={theme.colors.textNormal}
593
- mBottom={2}>
594
- {order?.business?.cellphone}
595
- </OText>
596
- )}
597
- {!hideBusinessAddress && (
598
- <OText size={12} lineHeight={18} color={theme.colors.textNormal}>
599
- {order?.business?.address}
600
- </OText>
601
- )}
602
- </View>
603
- {directionTypes.includes(order?.delivery_type) && (
604
- <OButton
605
- text={t('GET_DIRECTIONS', 'Get Directions')}
606
- imgRightSrc=''
607
- textStyle={{ color: theme.colors.white }}
608
- style={{
609
- alignSelf: 'center',
610
- borderRadius: 10,
611
- marginTop: 30
612
- }}
613
- onClick={() => showLocation({
614
- latitude: order?.business?.location?.lat,
615
- longitude: order?.business?.location?.lng,
616
- naverCallerName: 'com.reactnativeappstemplate5',
617
- dialogTitle: t('GET_DIRECTIONS', 'Get Directions'),
618
- dialogMessage: t('WHAT_APP_WOULD_YOU_USE', 'What app would you like to use?'),
619
- cancelText: t('CANCEL', 'Cancel'),
620
- })}
621
- />
622
- )}
430
+ <PlaceholderLine width={30} height={20} />
431
+ <PlaceholderLine width={60} height={15} />
432
+ <PlaceholderLine width={75} height={10} />
433
+ <PlaceholderLine width={40} height={10} />
434
+ <PlaceholderLine width={95} height={10} />
623
435
  </OrderBusiness>
624
- )}
625
-
626
- {!isGiftCardOrder && placeSpotTypes.includes(order?.delivery_type) && (
627
- <PlaceSpotWrapper>
628
- <PlaceSpot
629
- isInputMode
630
- cart={order}
631
- spotNumberDefault={order?.spot_number}
632
- vehicleDefault={order?.vehicle}
633
- />
634
- </PlaceSpotWrapper>
635
- )}
636
-
436
+ </OrderContent>
637
437
  <View
638
438
  style={{
639
439
  height: 8,
@@ -643,449 +443,688 @@ export const OrderDetailsUI = (props: OrderDetailsParams) => {
643
443
  }}
644
444
  />
645
445
  <OrderCustomer>
646
- <OText
647
- size={16}
648
- lineHeight={24}
649
- weight={'500'}
650
- color={theme.colors.textNormal}
651
- mBottom={12}>
652
- {isGiftCardOrder ? t('CUSTOMER', 'Customer') : t('TO', 'To')}
653
- </OText>
654
- <Customer>
655
- <InfoBlock>
446
+ <PlaceholderLine width={20} height={20} />
447
+ <PlaceholderLine width={70} height={15} />
448
+ <PlaceholderLine width={65} height={10} />
449
+ <PlaceholderLine width={80} height={10} />
450
+ <PlaceholderLine width={70} height={10} />
451
+ <View style={{ marginTop: 10 }}>
452
+ <PlaceholderLine width={60} height={20} />
453
+ <PlaceholderLine width={40} height={10} />
454
+ </View>
455
+ </OrderCustomer>
456
+ </Placeholder>
457
+ )}
458
+ {order && Object.keys(order).length > 0 && (
459
+ <>
460
+ <Header>
461
+ <NavBar
462
+ hideArrowLeft
463
+ title={`${t('ORDER', 'Order')} #${order?.id}`}
464
+ titleAlign={'center'}
465
+ showCall={false}
466
+ btnStyle={{ paddingLeft: 0 }}
467
+ style={{ marginTop: Platform.OS === 'ios' ? 0 : 20 }}
468
+ titleWrapStyle={{ paddingHorizontal: 0 }}
469
+ titleStyle={{ marginRight: 0, marginLeft: 0 }}
470
+ subTitle={!hideDeliveryDate && <OText size={12} lineHeight={18} color={theme.colors.textNormal}>
471
+ {activeStatus.includes(order?.status) ? (
472
+ <OrderEta order={order} />
473
+ ) : (
474
+ parseDate(order?.reporting_data?.at[`status:${order.status}`])
475
+ )}
476
+ </OText>}
477
+ />
478
+ {enabledPoweredByOrdering && (
479
+ <View style={{ display: 'flex', justifyContent: 'center', alignItems: 'center' }}>
480
+ <OText>
481
+ Powered By Ordering.co
482
+ </OText>
483
+ </View>
484
+ )}
485
+ {!isGiftCardOrder && (
486
+ <OrderInfo>
487
+ <OrderData>
488
+ <View style={styles.linkWrapper}>
489
+ {
490
+ (
491
+ parseInt(order?.status) === 1 ||
492
+ parseInt(order?.status) === 11 ||
493
+ parseInt(order?.status) === 15
494
+ ) && !order.review && !isReviewed && (
495
+ <TouchableOpacity
496
+ activeOpacity={0.7}
497
+ style={{ marginTop: 6, marginRight: 10 }}
498
+ onPress={() => handleClickOrderReview(order)}
499
+ >
500
+ <OText
501
+ size={12}
502
+ lineHeight={15}
503
+ color={theme.colors.primary}
504
+ style={{ textDecorationLine: 'underline' }}
505
+ >
506
+ {t('REVIEW_YOUR_ORDER', 'Review your order')}
507
+ </OText>
508
+ </TouchableOpacity>
509
+ )}
510
+ <TouchableOpacity
511
+ activeOpacity={0.7}
512
+ style={{ marginTop: 6 }}
513
+ onPress={() => setIsOrderHistory(true)}
514
+ >
515
+ <OText
516
+ size={12}
517
+ lineHeight={15}
518
+ color={theme.colors.primary}
519
+ style={{ textDecorationLine: 'underline', textTransform: 'capitalize' }}
520
+ >
521
+ {t('VIEW_DETAILS', 'View Details')}
522
+ </OText>
523
+ </TouchableOpacity>
524
+ </View>
525
+ {!hideDeliveryProgress && (
526
+ <>
527
+ <StaturBar>
528
+ <LinearGradient
529
+ start={{ x: 0.0, y: 0.0 }}
530
+ end={{
531
+ x: progressBarObjt(order?.status)?.percentage || 0,
532
+ y: 0,
533
+ }}
534
+ locations={[0.9999, 0.9999]}
535
+ colors={[theme.colors.primary, theme.colors.backgroundGray100]}
536
+ style={styles.statusBar}
537
+ />
538
+ </StaturBar>
539
+ <OText
540
+ size={16}
541
+ lineHeight={24}
542
+ weight={'600'}
543
+ color={theme.colors.textNormal}>
544
+ {progressBarObjt(order?.status)?.value}
545
+ </OText>
546
+ </>
547
+ )}
548
+ </OrderData>
549
+ <View
550
+ style={{
551
+ height: 8,
552
+ backgroundColor: theme.colors.backgroundGray100,
553
+ marginTop: 18,
554
+ marginHorizontal: -40,
555
+ }}
556
+ />
557
+ </OrderInfo>
558
+ )}
559
+ </Header>
560
+ <OrderContent>
561
+ {!isGiftCardOrder && (
562
+ <OrderBusiness>
656
563
  <OText
657
- size={12}
658
- lineHeight={18}
564
+ size={16}
565
+ lineHeight={24}
566
+ weight={'500'}
659
567
  color={theme.colors.textNormal}
660
- mBottom={2}>
661
- {order?.customer?.name} {order?.customer?.lastname}
568
+ mBottom={12}>
569
+ {t('FROM', 'From')}
662
570
  </OText>
663
- {!hideCustomerAddress && (
664
- <OText
665
- size={12}
666
- lineHeight={18}
667
- color={theme.colors.textNormal}
668
- mBottom={2}>
669
- {order?.customer?.address}
670
- </OText>
571
+ <View
572
+ style={{
573
+ display: 'flex',
574
+ flexDirection: 'column',
575
+ alignItems: 'flex-start',
576
+ }}>
577
+ <View
578
+ style={{
579
+ flexDirection: 'row',
580
+ alignItems: 'center',
581
+ justifyContent: 'space-between',
582
+ }}>
583
+ <OText
584
+ size={13}
585
+ lineHeight={20}
586
+ color={theme.colors.textNormal}
587
+ style={{ flexGrow: 1, flexBasis: '80%' }}>
588
+ {order?.business?.name}
589
+ </OText>
590
+ <Icons>
591
+ {!!order?.business?.cellphone && !hideBusinessPhone && (
592
+ <TouchableOpacity
593
+ onPress={() => order?.business?.cellphone &&
594
+ Linking.openURL(`tel:${order?.business?.cellphone}`)
595
+ }
596
+ style={{ paddingEnd: 5 }}
597
+ >
598
+ <OIcon
599
+ src={theme.images.general.phone}
600
+ width={16}
601
+ color={theme.colors.disabled}
602
+ />
603
+ </TouchableOpacity>
604
+ )}
605
+ {!hideBusinessMessages && (
606
+ <TouchableOpacity
607
+ style={{ paddingStart: 5 }}
608
+ onPress={() => handleGoToMessages('business')}>
609
+ <OIcon
610
+ src={theme.images.general.chat}
611
+ width={16}
612
+ color={theme.colors.disabled}
613
+ />
614
+ </TouchableOpacity>
615
+ )}
616
+ </Icons>
617
+ </View>
618
+ {!hideBusinessEmail && (
619
+ <OText
620
+ size={12}
621
+ lineHeight={18}
622
+ color={theme.colors.textNormal}
623
+ mBottom={2}>
624
+ {order?.business?.email}
625
+ </OText>
626
+ )}
627
+ {!!order?.business?.cellphone && !hideBusinessPhone && (
628
+ <OText
629
+ size={12}
630
+ lineHeight={18}
631
+ color={theme.colors.textNormal}
632
+ mBottom={2}>
633
+ {order?.business?.cellphone}
634
+ </OText>
635
+ )}
636
+ {!hideBusinessAddress && (
637
+ <OText size={12} lineHeight={18} color={theme.colors.textNormal}>
638
+ {order?.business?.address}
639
+ </OText>
640
+ )}
641
+ </View>
642
+ {directionTypes.includes(order?.delivery_type) && (
643
+ <OButton
644
+ text={t('GET_DIRECTIONS', 'Get Directions')}
645
+ imgRightSrc=''
646
+ style={{
647
+ alignSelf: 'center',
648
+ borderRadius: 10,
649
+ marginTop: 30
650
+ }}
651
+ onClick={() => showLocation({
652
+ latitude: order?.business?.location?.lat,
653
+ longitude: order?.business?.location?.lng,
654
+ naverCallerName: 'com.reactnativeappstemplate5',
655
+ dialogTitle: t('GET_DIRECTIONS', 'Get Directions'),
656
+ dialogMessage: t('WHAT_APP_WOULD_YOU_USE', 'What app would you like to use?'),
657
+ cancelText: t('CANCEL', 'Cancel'),
658
+ })}
659
+ />
671
660
  )}
672
- {(!!order?.customer?.cellphone && !hideCustomerPhone) && (
661
+ </OrderBusiness>
662
+ )}
663
+
664
+ {!isGiftCardOrder && placeSpotTypes.includes(order?.delivery_type) && (
665
+ <PlaceSpotWrapper>
666
+ <PlaceSpot
667
+ isInputMode
668
+ cart={order}
669
+ spotNumberDefault={order?.spot_number}
670
+ vehicleDefault={order?.vehicle}
671
+ />
672
+ </PlaceSpotWrapper>
673
+ )}
674
+
675
+ <View
676
+ style={{
677
+ height: 8,
678
+ backgroundColor: theme.colors.backgroundGray100,
679
+ marginTop: 18,
680
+ marginHorizontal: -40,
681
+ }}
682
+ />
683
+ <OrderCustomer>
684
+ <OText
685
+ size={16}
686
+ lineHeight={24}
687
+ weight={'500'}
688
+ color={theme.colors.textNormal}
689
+ mBottom={12}>
690
+ {isGiftCardOrder ? t('CUSTOMER', 'Customer') : t('TO', 'To')}
691
+ </OText>
692
+ <Customer>
693
+ <InfoBlock>
673
694
  <OText
674
695
  size={12}
675
696
  lineHeight={18}
676
697
  color={theme.colors.textNormal}
677
698
  mBottom={2}>
678
- {`${!!order?.customer?.country_phone_code ? '+' + order?.customer?.country_phone_code : ''} ${order?.customer?.cellphone}`}
699
+ {order?.customer?.name} {order?.customer?.lastname}
679
700
  </OText>
680
- )}
681
- </InfoBlock>
682
- </Customer>
683
- {!isGiftCardOrder && order?.delivery_option !== undefined && order?.delivery_type === 1 && (
684
- <View style={{ marginTop: 15 }}>
685
- <OText size={16} style={{ textAlign: 'left' }} color={theme.colors.textNormal}>
686
- {t('DELIVERY_PREFERENCE', 'Delivery Preference')}
687
- </OText>
688
- <OText size={12} style={{ textAlign: 'left' }} color={theme.colors.textNormal}>
689
- {order?.delivery_option?.name ? t(order?.delivery_option?.name.toUpperCase().replace(/\s/g, '_')) : t('EITHER_WAY', 'Either way')}
690
- </OText>
691
- </View>
692
- )}
693
- {!!order?.comment && (
694
- <View style={{ marginTop: 15 }}>
695
- <OText size={16} style={{ textAlign: 'left' }} color={theme.colors.textNormal}>
696
- {t('COMMENT', 'Comment')}
697
- </OText>
698
- <OText size={12} style={{ textAlign: 'left' }} color={theme.colors.textNormal}>{order?.comment}</OText>
699
- </View>
700
- )}
701
+ {!hideCustomerAddress && (
702
+ <OText
703
+ size={12}
704
+ lineHeight={18}
705
+ color={theme.colors.textNormal}
706
+ mBottom={2}>
707
+ {order?.customer?.address}
708
+ </OText>
709
+ )}
710
+ {(!!order?.customer?.cellphone && !hideCustomerPhone) && (
711
+ <OText
712
+ size={12}
713
+ lineHeight={18}
714
+ color={theme.colors.textNormal}
715
+ mBottom={2}>
716
+ {`${!!order?.customer?.country_phone_code ? '+' + order?.customer?.country_phone_code : ''} ${order?.customer?.cellphone}`}
717
+ </OText>
718
+ )}
719
+ </InfoBlock>
720
+ </Customer>
721
+ {!isGiftCardOrder && order?.delivery_option !== undefined && order?.delivery_type === 1 && (
722
+ <View style={{ marginTop: 15 }}>
723
+ <OText size={16} style={{ textAlign: 'left' }} color={theme.colors.textNormal}>
724
+ {t('DELIVERY_PREFERENCE', 'Delivery Preference')}
725
+ </OText>
726
+ <OText size={12} style={{ textAlign: 'left' }} color={theme.colors.textNormal}>
727
+ {order?.delivery_option?.name ? t(order?.delivery_option?.name.toUpperCase().replace(/\s/g, '_')) : t('EITHER_WAY', 'Either way')}
728
+ </OText>
729
+ </View>
730
+ )}
731
+ {!!order?.comment && (
732
+ <View style={{ marginTop: 15 }}>
733
+ <OText size={16} style={{ textAlign: 'left' }} color={theme.colors.textNormal}>
734
+ {t('COMMENT', 'Comment')}
735
+ </OText>
736
+ <OText size={12} style={{ textAlign: 'left' }} color={theme.colors.textNormal}>{order?.comment}</OText>
737
+ </View>
738
+ )}
739
+ {order?.driver && (
740
+ <>
741
+ {order?.driver?.location && mapValidStatuses.includes(parseInt(order?.status)) && (
742
+ <Map>
743
+ <GoogleMap
744
+ location={typeof order?.driver?.location?.location === 'string'
745
+ ? {
746
+ lat: parseFloat(driverLocationString[0]),
747
+ lng: parseFloat(driverLocationString[1]),
748
+ } : driverLocation ?? order?.driver?.location
749
+ }
750
+ locations={parsedLocations}
751
+ readOnly
752
+ manualZoom
753
+ />
754
+ </Map>
755
+ )}
756
+ </>
757
+ )}
758
+ </OrderCustomer>
701
759
  {order?.driver && (
702
760
  <>
703
- {order?.driver?.location && mapValidStatuses.includes(parseInt(order?.status)) && (
704
- <Map>
705
- <GoogleMap
706
- location={typeof order?.driver?.location?.location === 'string'
707
- ? {
708
- lat: parseFloat(driverLocationString[0]),
709
- lng: parseFloat(driverLocationString[1]),
710
- } : driverLocation ?? order?.driver?.location
711
- }
712
- locations={parsedLocations}
713
- readOnly
714
- />
715
- </Map>
716
- )}
717
- </>
718
- )}
719
- </OrderCustomer>
720
- {order?.driver && (
721
- <>
722
- <View
723
- style={{
724
- height: 8,
725
- backgroundColor: theme.colors.backgroundGray100,
726
- marginTop: 18,
727
- marginHorizontal: -40,
728
- }}
729
- />
730
- <OrderDriver>
731
- <OText size={16} lineHeight={24} weight={'500'} style={{ marginBottom: 10 }}>{t('YOUR_DRIVER', 'Your Driver')}</OText>
732
- <Customer>
733
- <InfoBlock>
734
- <View
735
- style={{
736
- flexDirection: 'row',
737
- alignItems: 'center',
738
- justifyContent: 'space-between',
739
- }}>
740
- {!hideDriverName && (
741
- <OText size={12} lineHeight={18} color={theme.colors.textNormal} mBottom={2} style={{ flexGrow: 1, flexBasis: '80%' }}>
742
- {order?.driver?.name} {order?.driver?.lastname}
761
+ <View
762
+ style={{
763
+ height: 8,
764
+ backgroundColor: theme.colors.backgroundGray100,
765
+ marginTop: 18,
766
+ marginHorizontal: -40,
767
+ }}
768
+ />
769
+ <OrderDriver>
770
+ <OText size={16} lineHeight={24} weight={'500'} style={{ marginBottom: 10 }}>{t('YOUR_DRIVER', 'Your Driver')}</OText>
771
+ <Customer>
772
+ <InfoBlock>
773
+ <View
774
+ style={{
775
+ flexDirection: 'row',
776
+ alignItems: 'center',
777
+ justifyContent: 'space-between',
778
+ }}>
779
+ {!hideDriverName && (
780
+ <OText size={12} lineHeight={18} color={theme.colors.textNormal} mBottom={2} style={{ flexGrow: 1, flexBasis: '80%' }}>
781
+ {order?.driver?.name} {order?.driver?.lastname}
782
+ </OText>
783
+ )}
784
+ {!hideDriverMessages && (
785
+ <Icons>
786
+ <TouchableOpacity
787
+ onPress={() => handleGoToMessages('driver')}>
788
+ <OIcon
789
+ src={theme.images.general.chat}
790
+ width={16}
791
+ color={theme.colors.disabled}
792
+ />
793
+ </TouchableOpacity>
794
+ </Icons>
795
+ )}
796
+ </View>
797
+ {!hideDriverPhone && (
798
+ <OText size={12} lineHeight={18} color={theme.colors.textNormal} mBottom={2}>
799
+ {order?.driver?.cellphone}
743
800
  </OText>
744
801
  )}
745
- {!hideDriverMessages && (
746
- <Icons>
747
- <TouchableOpacity
748
- onPress={() => handleGoToMessages('driver')}>
749
- <OIcon
750
- src={theme.images.general.chat}
751
- width={16}
752
- color={theme.colors.disabled}
753
- />
754
- </TouchableOpacity>
755
- </Icons>
756
- )}
757
- </View>
758
- {!hideDriverPhone && (
759
- <OText size={12} lineHeight={18} color={theme.colors.textNormal} mBottom={2}>
760
- {order?.driver?.cellphone}
761
- </OText>
762
- )}
763
- </InfoBlock>
764
- </Customer>
765
- </OrderDriver>
766
- </>
767
- )}
768
- <View
769
- style={{
770
- height: 8,
771
- backgroundColor: theme.colors.backgroundGray100,
772
- marginTop: 18,
773
- marginHorizontal: -40,
774
- }}
775
- />
776
- <HeaderInfo>
777
- <OText
778
- size={24}
779
- color={theme.colors.textNormal}
780
- style={{ fontWeight: Platform.OS == 'ios' ? '600' : 'bold', marginBottom: 16 }}>
781
- {t(
782
- 'YOUR_ORDER_HAS_BEEN_RECEIVED',
783
- 'Your Order has been received',
784
- )}
785
- </OText>
786
- <OText color={theme.colors.textNormal} size={14} weight={'500'}>
787
- {t(
788
- 'ORDER_MESSAGE_HEADER_TEXT',
789
- 'Once business accepts your order, we will send you an email, thank you!',
790
- )}
791
- </OText>
792
- <OrderAction>
793
- <OButton
794
- text={t('YOUR_ORDERS', 'Your Orders')}
795
- textStyle={{ fontSize: 14, color: theme.colors.primary }}
796
- imgRightSrc={null}
797
- borderColor={theme.colors.primary}
798
- bgColor={theme.colors.clear}
799
- style={{ borderRadius: 7.6, borderWidth: 1, height: 44, shadowOpacity: 0 }}
800
- parentStyle={{ marginTop: 29, marginEnd: 15 }}
801
- onClick={() => navigation.navigate('BottomTab', { screen: 'MyOrders' })}
802
- />
803
- {(reorderStatus?.includes(parseInt(order?.status)) && order?.cart) && !isGiftCardOrder && (
802
+ </InfoBlock>
803
+ </Customer>
804
+ </OrderDriver>
805
+ </>
806
+ )}
807
+ <View
808
+ style={{
809
+ height: 8,
810
+ backgroundColor: theme.colors.backgroundGray100,
811
+ marginTop: 18,
812
+ marginHorizontal: -40,
813
+ }}
814
+ />
815
+ <HeaderInfo>
816
+ <OText
817
+ size={24}
818
+ color={theme.colors.textNormal}
819
+ style={{ fontWeight: Platform.OS == 'ios' ? '600' : 'bold', marginBottom: 16 }}>
820
+ {t(
821
+ 'YOUR_ORDER_HAS_BEEN_RECEIVED',
822
+ 'Your Order has been received',
823
+ )}
824
+ </OText>
825
+ <OText color={theme.colors.textNormal} size={14} weight={'500'}>
826
+ {t(
827
+ 'ORDER_MESSAGE_HEADER_TEXT',
828
+ 'Once business accepts your order, we will send you an email, thank you!',
829
+ )}
830
+ </OText>
831
+ <OrderAction>
804
832
  <OButton
805
- text={order.id === reorderState?.loading ? t('LOADING', 'Loading..') : t('REORDER', 'Reorder')}
833
+ text={t('YOUR_ORDERS', 'Your Orders')}
806
834
  textStyle={{ fontSize: 14, color: theme.colors.primary }}
807
835
  imgRightSrc={null}
808
- borderColor='transparent'
809
- bgColor={theme.colors.primary + 10}
810
- style={{ borderRadius: 7.6, borderWidth: 1, height: 44, shadowOpacity: 0, marginTop: 29 }}
811
- onClick={() => handleReorder && handleReorder(order.id)}
836
+ bgColor={theme.colors.clear}
837
+ style={{ borderRadius: 7.6, borderWidth: 1, height: 44, shadowOpacity: 0 }}
838
+ parentStyle={{ marginTop: 29, marginEnd: 15 }}
839
+ onClick={() => navigation.navigate('BottomTab', { screen: 'MyOrders' })}
812
840
  />
813
- )}
814
- </OrderAction>
815
- </HeaderInfo>
816
- <OrderProducts>
817
- {sortedProductList}
818
- </OrderProducts>
819
- <OrderBill>
820
- <View style={{ height: 1, backgroundColor: theme.colors.border, marginBottom: 17 }} />
821
- <Table>
822
- <OText size={12} lineHeight={18} weight={'400'} color={theme.colors.textNormal}>{t('SUBTOTAL', 'Subtotal')}</OText>
823
- <OText size={12} lineHeight={18} weight={'400'} color={theme.colors.textNormal}>
824
- {parsePrice(((order?.summary?.subtotal ?? order?.subtotal) + getIncludedTaxes()))}
825
- </OText>
826
- </Table>
827
- {(order?.summary?.discount > 0 ?? order?.discount > 0) && order?.offers?.length === 0 && (
828
- <Table>
829
- {order?.offer_type === 1 ? (
830
- <OText size={12} lineHeight={18} weight={'400'} color={theme.colors.textNormal}>
831
- {t('DISCOUNT', 'Discount')}
832
- <OText size={12} lineHeight={18} weight={'400'} color={theme.colors.textNormal}>{`(${verifyDecimals(
833
- order?.offer_rate,
834
- parsePrice,
835
- )}%)`}</OText>
836
- </OText>
837
- ) : (
838
- <OText size={12} lineHeight={18} weight={'400'} color={theme.colors.textNormal}>{t('DISCOUNT', 'Discount')}</OText>
841
+ {(reorderStatus?.includes(parseInt(order?.status)) && order?.cart) && !isGiftCardOrder && (
842
+ <OButton
843
+ text={order.id === reorderState?.loading ? t('LOADING', 'Loading..') : t('REORDER', 'Reorder')}
844
+ textStyle={{ fontSize: 14, color: theme.colors.primary }}
845
+ imgRightSrc={null}
846
+ borderColor='transparent'
847
+ bgColor={theme.colors.primary + 10}
848
+ style={{ borderRadius: 7.6, borderWidth: 1, height: 44, shadowOpacity: 0, marginTop: 29 }}
849
+ onClick={() => handleReorder && handleReorder(order.id)}
850
+ />
839
851
  )}
852
+ </OrderAction>
853
+ </HeaderInfo>
854
+ <OrderProducts>
855
+ {sortedProductList}
856
+ </OrderProducts>
857
+ <OrderBill>
858
+ <View style={{ height: 1, backgroundColor: theme.colors.border, marginBottom: 17 }} />
859
+ <Table>
860
+ <OText size={12} lineHeight={18} weight={'400'} color={theme.colors.textNormal}>{t('SUBTOTAL', 'Subtotal')}</OText>
840
861
  <OText size={12} lineHeight={18} weight={'400'} color={theme.colors.textNormal}>
841
- - {parsePrice(order?.summary?.discount || order?.discount)}
862
+ {parsePrice(((order?.summary?.subtotal ?? order?.subtotal) + getIncludedTaxes()))}
842
863
  </OText>
843
864
  </Table>
844
- )}
845
- {
846
- order?.offers?.length > 0 && order?.offers?.filter((offer: any) => offer?.target === 1)?.map((offer: any) => (
847
- <Table key={offer.id}>
848
- <OSRow>
849
- <OText size={12} lineHeight={18} weight={'400'} color={theme.colors.textNormal} numberOfLines={1}>
850
- {offer.name}
851
- {offer.rate_type === 1 && (
852
- <OText size={12} lineHeight={18} weight={'400'} color={theme.colors.textNormal}>{`(${verifyDecimals(offer?.rate, parsePrice)}%)`}</OText>
853
- )}
854
- </OText>
855
- <TouchableOpacity style={{ marginLeft: 5 }} onPress={() => setOpenTaxModal({ open: true, data: offer, type: 'offer_target_1' })}>
856
- <AntIcon name='infocirlceo' size={16} color={theme.colors.primary} />
857
- </TouchableOpacity>
858
- </OSRow>
859
- <OText size={12} lineHeight={18} weight={'400'} color={theme.colors.textNormal}>- {parsePrice(offer?.summary?.discount)}</OText>
860
- </Table>
861
- ))
862
- }
863
- {!isGiftCardOrder && (
864
- <Divider />
865
- )}
866
- {order?.summary?.subtotal_with_discount > 0 && order?.summary?.discount > 0 && order?.summary?.total >= 0 && (
867
- <Table>
868
- <OText size={12} lineHeight={18} weight={'400'} color={theme.colors.textNormal}>{t('SUBTOTAL_WITH_DISCOUNT', 'Subtotal with discount')}</OText>
869
- {order?.tax_type === 1 ? (
870
- <OText size={12} lineHeight={18} weight={'400'} color={theme.colors.textNormal}>{parsePrice((order?.summary?.subtotal_with_discount + getIncludedTaxesDiscounts() ?? 0))}</OText>
871
- ) : (
872
- <OText size={12} lineHeight={18} weight={'400'} color={theme.colors.textNormal}>{parsePrice(order?.summary?.subtotal_with_discount ?? 0)}</OText>
873
- )}
874
- </Table>
875
- )}
876
- {
877
- order?.taxes?.length === 0 && order?.tax_type === 2 && (
865
+ {(order?.summary?.discount > 0 ?? order?.discount > 0) && order?.offers?.length === 0 && (
878
866
  <Table>
867
+ {order?.offer_type === 1 ? (
868
+ <OText size={12} lineHeight={18} weight={'400'} color={theme.colors.textNormal}>
869
+ {t('DISCOUNT', 'Discount')}
870
+ <OText size={12} lineHeight={18} weight={'400'} color={theme.colors.textNormal}>{`(${verifyDecimals(
871
+ order?.offer_rate,
872
+ parsePrice,
873
+ )}%)`}</OText>
874
+ </OText>
875
+ ) : (
876
+ <OText size={12} lineHeight={18} weight={'400'} color={theme.colors.textNormal}>{t('DISCOUNT', 'Discount')}</OText>
877
+ )}
879
878
  <OText size={12} lineHeight={18} weight={'400'} color={theme.colors.textNormal}>
880
- {t('TAX', 'Tax')} {`(${verifyDecimals(order?.tax, parseNumber)}%)`}
879
+ - {parsePrice(order?.summary?.discount || order?.discount)}
881
880
  </OText>
882
- <OText size={12} lineHeight={18} weight={'400'} color={theme.colors.textNormal}>{parsePrice(order?.summary?.tax || 0)}</OText>
883
881
  </Table>
884
- )
885
- }
886
- {
887
- order?.fees?.length === 0 && (
882
+ )}
883
+ {
884
+ order?.offers?.length > 0 && order?.offers?.filter((offer: any) => offer?.target === 1)?.map((offer: any) => (
885
+ <Table key={offer.id}>
886
+ <OSRow>
887
+ <OText size={12} lineHeight={18} weight={'400'} color={theme.colors.textNormal} numberOfLines={1}>
888
+ {offer.name}
889
+ {offer.rate_type === 1 && (
890
+ <OText size={12} lineHeight={18} weight={'400'} color={theme.colors.textNormal}>{`(${verifyDecimals(offer?.rate, parsePrice)}%)`}</OText>
891
+ )}
892
+ </OText>
893
+ <TouchableOpacity style={{ marginLeft: 5 }} onPress={() => setOpenTaxModal({ open: true, data: offer, type: 'offer_target_1' })}>
894
+ <AntIcon name='infocirlceo' size={16} color={theme.colors.primary} />
895
+ </TouchableOpacity>
896
+ </OSRow>
897
+ <OText size={12} lineHeight={18} weight={'400'} color={theme.colors.textNormal}>- {parsePrice(offer?.summary?.discount)}</OText>
898
+ </Table>
899
+ ))
900
+ }
901
+ {!isGiftCardOrder && (
902
+ <Divider />
903
+ )}
904
+ {order?.summary?.subtotal_with_discount > 0 && order?.summary?.discount > 0 && order?.summary?.total >= 0 && (
888
905
  <Table>
889
- <OText size={12} lineHeight={18} weight={'400'} color={theme.colors.textNormal}>
890
- {t('SERVICE_FEE', 'Service fee')}
891
- {`(${verifyDecimals(order?.service_fee, parseNumber)}%)`}
892
- </OText>
893
- <OText size={12} lineHeight={18} weight={'400'} color={theme.colors.textNormal}>{parsePrice(order?.summary?.service_fee || 0)}</OText>
906
+ <OText size={12} lineHeight={18} weight={'400'} color={theme.colors.textNormal}>{t('SUBTOTAL_WITH_DISCOUNT', 'Subtotal with discount')}</OText>
907
+ {order?.tax_type === 1 ? (
908
+ <OText size={12} lineHeight={18} weight={'400'} color={theme.colors.textNormal}>{parsePrice((order?.summary?.subtotal_with_discount + getIncludedTaxesDiscounts() ?? 0))}</OText>
909
+ ) : (
910
+ <OText size={12} lineHeight={18} weight={'400'} color={theme.colors.textNormal}>{parsePrice(order?.summary?.subtotal_with_discount ?? 0)}</OText>
911
+ )}
894
912
  </Table>
895
- )
896
- }
897
- {
898
- order?.taxes?.length > 0 && order?.taxes?.filter((tax: any) => tax?.type === 2 && tax?.rate !== 0).map((tax: any) => (
899
- <Table key={tax.id}>
900
- <OSRow>
901
- <OText size={12} lineHeight={18} weight={'400'} color={theme.colors.textNormal} numberOfLines={1}>
902
- {tax.name || t('INHERIT_FROM_BUSINESS', 'Inherit from business')}
903
- {`(${verifyDecimals(tax?.rate, parseNumber)}%)`}{' '}
913
+ )}
914
+ {
915
+ order?.taxes?.length === 0 && order?.tax_type === 2 && (
916
+ <Table>
917
+ <OText size={12} lineHeight={18} weight={'400'} color={theme.colors.textNormal}>
918
+ {t('TAX', 'Tax')} {`(${verifyDecimals(order?.tax, parseNumber)}%)`}
904
919
  </OText>
905
- <TouchableOpacity onPress={() => setOpenTaxModal({ open: true, data: tax, type: 'tax' })}>
906
- <AntIcon name='infocirlceo' size={16} color={theme.colors.primary} />
907
- </TouchableOpacity>
908
- </OSRow>
909
- <OText size={12} lineHeight={18} weight={'400'} color={theme.colors.textNormal}>{parsePrice(tax?.summary?.tax_after_discount ?? tax?.summary?.tax ?? 0)}</OText>
910
- </Table>
911
- ))
912
- }
913
- {
914
- order?.fees?.length > 0 && order?.fees?.filter((fee: any) => !(fee.fixed === 0 && fee.percentage === 0))?.map((fee: any) => (
915
- <Table key={fee.id}>
916
- <OSRow>
917
- <OText size={12} lineHeight={18} weight={'400'} color={theme.colors.textNormal} numberOfLines={1}>
918
- {fee.name || t('INHERIT_FROM_BUSINESS', 'Inherit from business')}
919
- ({fee?.fixed > 0 && `${parsePrice(fee?.fixed)}${fee.percentage > 0 ? ' + ' : ''}`}{fee.percentage > 0 && `${fee.percentage}%`}){' '}
920
+ <OText size={12} lineHeight={18} weight={'400'} color={theme.colors.textNormal}>{parsePrice(order?.summary?.tax || 0)}</OText>
921
+ </Table>
922
+ )
923
+ }
924
+ {
925
+ order?.fees?.length === 0 && (
926
+ <Table>
927
+ <OText size={12} lineHeight={18} weight={'400'} color={theme.colors.textNormal}>
928
+ {t('SERVICE_FEE', 'Service fee')}
929
+ {`(${verifyDecimals(order?.service_fee, parseNumber)}%)`}
920
930
  </OText>
921
- <TouchableOpacity onPress={() => setOpenTaxModal({ open: true, data: fee, type: 'fee' })}>
922
- <AntIcon name='infocirlceo' size={16} color={theme.colors.primary} />
923
- </TouchableOpacity>
924
- </OSRow>
925
- <OText size={12} lineHeight={18} weight={'400'} color={theme.colors.textNormal}>{parsePrice(fee?.summary?.fixed + (fee?.summary?.percentage_after_discount ?? fee?.summary?.percentage) ?? 0)}</OText>
931
+ <OText size={12} lineHeight={18} weight={'400'} color={theme.colors.textNormal}>{parsePrice(order?.summary?.service_fee || 0)}</OText>
932
+ </Table>
933
+ )
934
+ }
935
+ {
936
+ order?.taxes?.length > 0 && order?.taxes?.filter((tax: any) => tax?.type === 2 && tax?.rate !== 0).map((tax: any) => (
937
+ <Table key={tax.id}>
938
+ <OSRow>
939
+ <OText size={12} lineHeight={18} weight={'400'} color={theme.colors.textNormal} numberOfLines={1}>
940
+ {tax.name || t('INHERIT_FROM_BUSINESS', 'Inherit from business')}
941
+ {`(${verifyDecimals(tax?.rate, parseNumber)}%)`}{' '}
942
+ </OText>
943
+ <TouchableOpacity onPress={() => setOpenTaxModal({ open: true, data: tax, type: 'tax' })}>
944
+ <AntIcon name='infocirlceo' size={16} color={theme.colors.primary} />
945
+ </TouchableOpacity>
946
+ </OSRow>
947
+ <OText size={12} lineHeight={18} weight={'400'} color={theme.colors.textNormal}>{parsePrice(tax?.summary?.tax_after_discount ?? tax?.summary?.tax ?? 0)}</OText>
948
+ </Table>
949
+ ))
950
+ }
951
+ {
952
+ order?.fees?.length > 0 && order?.fees?.filter((fee: any) => !(fee.fixed === 0 && fee.percentage === 0))?.map((fee: any) => (
953
+ <Table key={fee.id}>
954
+ <OSRow>
955
+ <OText size={12} lineHeight={18} weight={'400'} color={theme.colors.textNormal} numberOfLines={1}>
956
+ {fee.name || t('INHERIT_FROM_BUSINESS', 'Inherit from business')}
957
+ ({fee?.fixed > 0 && `${parsePrice(fee?.fixed)}${fee.percentage > 0 ? ' + ' : ''}`}{fee.percentage > 0 && `${fee.percentage}%`}){' '}
958
+ </OText>
959
+ <TouchableOpacity onPress={() => setOpenTaxModal({ open: true, data: fee, type: 'fee' })}>
960
+ <AntIcon name='infocirlceo' size={16} color={theme.colors.primary} />
961
+ </TouchableOpacity>
962
+ </OSRow>
963
+ <OText size={12} lineHeight={18} weight={'400'} color={theme.colors.textNormal}>{parsePrice(fee?.summary?.fixed + (fee?.summary?.percentage_after_discount ?? fee?.summary?.percentage) ?? 0)}</OText>
964
+ </Table>
965
+ ))
966
+ }
967
+ {
968
+ order?.offers?.length > 0 && order?.offers?.filter((offer: any) => offer?.target === 3)?.map((offer: any) => (
969
+ <Table key={offer.id}>
970
+ <OSRow>
971
+ <OText size={12} lineHeight={18} weight={'400'} color={theme.colors.textNormal} numberOfLines={1}>
972
+ {offer.name}
973
+ {offer.rate_type === 1 && (
974
+ <OText>{`(${verifyDecimals(offer?.rate, parsePrice)}%)`}</OText>
975
+ )}
976
+ </OText>
977
+ <TouchableOpacity style={{ marginLeft: 5 }} onPress={() => setOpenTaxModal({ open: true, data: offer, type: 'offer_target_3' })}>
978
+ <AntIcon name='infocirlceo' size={16} color={theme.colors.primary} />
979
+ </TouchableOpacity>
980
+ </OSRow>
981
+ <OText size={12} lineHeight={18} weight={'400'} color={theme.colors.textNormal}>- {parsePrice(offer?.summary?.discount)}</OText>
982
+ </Table>
983
+ ))
984
+ }
985
+ {typeof order?.summary?.delivery_price === 'number' && (
986
+ <Table>
987
+ <OText size={12} lineHeight={18} weight={'400'} color={theme.colors.textNormal}>{t('DELIVERY_FEE', 'Delivery Fee')}</OText>
988
+ <OText size={12} lineHeight={18} weight={'400'} color={theme.colors.textNormal}>{parsePrice(order?.summary?.delivery_price)}</OText>
926
989
  </Table>
927
- ))
928
- }
929
- {
930
- order?.offers?.length > 0 && order?.offers?.filter((offer: any) => offer?.target === 3)?.map((offer: any) => (
931
- <Table key={offer.id}>
932
- <OSRow>
933
- <OText size={12} lineHeight={18} weight={'400'} color={theme.colors.textNormal} numberOfLines={1}>
934
- {offer.name}
935
- {offer.rate_type === 1 && (
936
- <OText>{`(${verifyDecimals(offer?.rate, parsePrice)}%)`}</OText>
990
+ )}
991
+ {
992
+ order?.offers?.length > 0 && order?.offers?.filter((offer: any) => offer?.target === 2)?.map((offer: any) => (
993
+ <Table key={offer.id}>
994
+ <OSRow>
995
+ <OText size={12} lineHeight={18} weight={'400'} color={theme.colors.textNormal} numberOfLines={1}>
996
+ {offer.name}
997
+ {offer.rate_type === 1 && (
998
+ <OText size={12} lineHeight={18} weight={'400'} color={theme.colors.textNormal}>{`(${verifyDecimals(offer?.rate, parsePrice)}%)`}</OText>
999
+ )}
1000
+ </OText>
1001
+ <TouchableOpacity style={{ marginLeft: 5 }} onPress={() => setOpenTaxModal({ open: true, data: offer, type: 'offer_target_2' })}>
1002
+ <AntIcon name='infocirlceo' size={16} color={theme.colors.primary} />
1003
+ </TouchableOpacity>
1004
+ </OSRow>
1005
+ <OText size={12} lineHeight={18} weight={'400'} color={theme.colors.textNormal}>- {parsePrice(offer?.summary?.discount)}</OText>
1006
+ </Table>
1007
+ ))
1008
+ }
1009
+ {order?.summary?.driver_tip > 0 && (
1010
+ <Table>
1011
+ <OText size={12} lineHeight={18} weight={'400'} color={theme.colors.textNormal}>
1012
+ {t('DRIVER_TIP', 'Driver tip')}
1013
+ {order?.summary?.driver_tip > 0 &&
1014
+ parseInt(configs?.driver_tip_type?.value, 10) === 2 &&
1015
+ !parseInt(configs?.driver_tip_use_custom?.value, 10) &&
1016
+ (
1017
+ `(${verifyDecimals(order?.summary?.driver_tip, parseNumber)}%)`
937
1018
  )}
938
- </OText>
939
- <TouchableOpacity style={{ marginLeft: 5 }} onPress={() => setOpenTaxModal({ open: true, data: offer, type: 'offer_target_3' })}>
940
- <AntIcon name='infocirlceo' size={16} color={theme.colors.primary} />
941
- </TouchableOpacity>
942
- </OSRow>
943
- <OText size={12} lineHeight={18} weight={'400'} color={theme.colors.textNormal}>- {parsePrice(offer?.summary?.discount)}</OText>
1019
+ </OText>
1020
+ <OText size={12} lineHeight={18} weight={'400'} color={theme.colors.textNormal}>{parsePrice(order?.summary?.driver_tip ?? order?.totalDriverTip)}</OText>
944
1021
  </Table>
945
- ))
946
- }
947
- {typeof order?.summary?.delivery_price === 'number' && (
948
- <Table>
949
- <OText size={12} lineHeight={18} weight={'400'} color={theme.colors.textNormal}>{t('DELIVERY_FEE', 'Delivery Fee')}</OText>
950
- <OText size={12} lineHeight={18} weight={'400'} color={theme.colors.textNormal}>{parsePrice(order?.summary?.delivery_price)}</OText>
951
- </Table>
952
- )}
953
- {
954
- order?.offers?.length > 0 && order?.offers?.filter((offer: any) => offer?.target === 2)?.map((offer: any) => (
955
- <Table key={offer.id}>
956
- <OSRow>
957
- <OText size={12} lineHeight={18} weight={'400'} color={theme.colors.textNormal} numberOfLines={1}>
958
- {offer.name}
959
- {offer.rate_type === 1 && (
960
- <OText size={12} lineHeight={18} weight={'400'} color={theme.colors.textNormal}>{`(${verifyDecimals(offer?.rate, parsePrice)}%)`}</OText>
961
- )}
962
- </OText>
963
- <TouchableOpacity style={{ marginLeft: 5 }} onPress={() => setOpenTaxModal({ open: true, data: offer, type: 'offer_target_2' })}>
964
- <AntIcon name='infocirlceo' size={16} color={theme.colors.primary} />
965
- </TouchableOpacity>
966
- </OSRow>
967
- <OText size={12} lineHeight={18} weight={'400'} color={theme.colors.textNormal}>- {parsePrice(offer?.summary?.discount)}</OText>
1022
+ )}
1023
+ <Total>
1024
+ <Table>
1025
+ <OText size={14} style={{ fontWeight: 'bold' }} color={theme.colors.textNormal}>{t('TOTAL', 'Total')}</OText>
1026
+ <OText size={14} style={{ fontWeight: 'bold' }} color={theme.colors.textNormal}>
1027
+ {parsePrice(order?.summary?.total ?? order?.total)}
1028
+ </OText>
968
1029
  </Table>
969
- ))
970
- }
971
- {order?.summary?.driver_tip > 0 && (
972
- <Table>
973
- <OText size={12} lineHeight={18} weight={'400'} color={theme.colors.textNormal}>
974
- {t('DRIVER_TIP', 'Driver tip')}
975
- {order?.summary?.driver_tip > 0 &&
976
- parseInt(configs?.driver_tip_type?.value, 10) === 2 &&
977
- !parseInt(configs?.driver_tip_use_custom?.value, 10) &&
978
- (
979
- `(${verifyDecimals(order?.summary?.driver_tip, parseNumber)}%)`
980
- )}
981
- </OText>
982
- <OText size={12} lineHeight={18} weight={'400'} color={theme.colors.textNormal}>{parsePrice(order?.summary?.driver_tip ?? order?.totalDriverTip)}</OText>
983
- </Table>
984
- )}
985
- <Total>
986
- <Table>
987
- <OText size={14} style={{ fontWeight: 'bold' }} color={theme.colors.textNormal}>{t('TOTAL', 'Total')}</OText>
988
- <OText size={14} style={{ fontWeight: 'bold' }} color={theme.colors.textNormal}>
989
- {parsePrice(order?.summary?.total ?? order?.total)}
990
- </OText>
991
- </Table>
992
- </Total>
993
- {order?.payment_events?.length > 0 && (
994
- <View style={{ marginTop: 10 }}>
995
- <OText size={20} weight='bold' color={theme.colors.textNormal}>{t('PAYMENTS', 'Payments')}</OText>
996
- <View
997
- style={{
998
- width: '100%',
999
- marginTop: 10
1000
- }}
1001
- >
1002
- {order?.payment_events?.map((event: any) => event.amount > 0 && (
1003
- <View
1004
- key={event.id}
1005
- style={{
1006
- display: 'flex',
1007
- flexDirection: 'row',
1008
- justifyContent: 'space-between',
1009
- alignItems: 'center',
1010
- marginBottom: 10
1011
- }}
1012
- >
1030
+ </Total>
1031
+ {order?.payment_events?.length > 0 && (
1032
+ <View style={{ marginTop: 10 }}>
1033
+ <OText size={20} weight='bold' color={theme.colors.textNormal}>{t('PAYMENTS', 'Payments')}</OText>
1034
+ <View
1035
+ style={{
1036
+ width: '100%',
1037
+ marginTop: 10
1038
+ }}
1039
+ >
1040
+ {order?.payment_events?.map((event: any) => event.amount > 0 && (
1013
1041
  <View
1042
+ key={event.id}
1014
1043
  style={{
1015
1044
  display: 'flex',
1016
- flexDirection: 'column',
1045
+ flexDirection: 'row',
1046
+ justifyContent: 'space-between',
1047
+ alignItems: 'center',
1048
+ marginBottom: 10
1017
1049
  }}
1018
1050
  >
1019
- <OText>
1020
- {event?.wallet_event
1021
- ? walletName[event?.wallet_event?.wallet?.type]?.name
1022
- : t(event?.paymethod?.name.toUpperCase()?.replace(/ /g, '_'), event?.paymethod?.name)}
1023
- </OText>
1024
- {/* {event?.data?.charge_id && (
1051
+ <View
1052
+ style={{
1053
+ display: 'flex',
1054
+ flexDirection: 'column',
1055
+ }}
1056
+ >
1057
+ <OText>
1058
+ {event?.wallet_event
1059
+ ? walletName[event?.wallet_event?.wallet?.type]?.name
1060
+ : t(event?.paymethod?.name.toUpperCase()?.replace(/ /g, '_'), event?.paymethod?.name)}
1061
+ </OText>
1062
+ {/* {event?.data?.charge_id && (
1025
1063
  <OText>
1026
1064
  {`${t('CODE', 'Code')}: ${event?.data?.charge_id}`}
1027
1065
  </OText>
1028
1066
  )} */}
1067
+ </View>
1068
+ <OText>
1069
+ -{parsePrice(event.amount, { isTruncable: true })}
1070
+ </OText>
1029
1071
  </View>
1030
- <OText>
1031
- -{parsePrice(event.amount, { isTruncable: true })}
1032
- </OText>
1033
- </View>
1034
- ))}
1072
+ ))}
1073
+ </View>
1035
1074
  </View>
1036
- </View>
1075
+ )}
1076
+ </OrderBill>
1077
+ {isGiftCardOrder && order?.products[0]?.gift_card?.status === 'pending' && !isGiftCardSent && (
1078
+ <>
1079
+ <View
1080
+ style={{
1081
+ height: 8,
1082
+ backgroundColor: theme.colors.backgroundGray100,
1083
+ marginTop: 10,
1084
+ marginHorizontal: -40,
1085
+ marginBottom: 20
1086
+ }}
1087
+ />
1088
+ <SendGiftCard
1089
+ giftCardId={order?.products[0]?.gift_card?.id}
1090
+ setIsGiftCardSent={setIsGiftCardSent}
1091
+ />
1092
+ </>
1037
1093
  )}
1038
- </OrderBill>
1039
- {isGiftCardOrder && order?.products[0]?.gift_card?.status === 'pending' && !isGiftCardSent && (
1040
- <>
1041
- <View
1042
- style={{
1043
- height: 8,
1044
- backgroundColor: theme.colors.backgroundGray100,
1045
- marginTop: 10,
1046
- marginHorizontal: -40,
1047
- marginBottom: 20
1048
- }}
1049
- />
1050
- <SendGiftCard
1051
- giftCardId={order?.products[0]?.gift_card?.id}
1052
- setIsGiftCardSent={setIsGiftCardSent}
1053
- />
1054
- </>
1055
- )}
1056
- </OrderContent>
1057
- </>
1058
- )}
1059
- <OModal
1060
- open={openTaxModal.open}
1061
- onClose={() => setOpenTaxModal({ open: false, data: null, type: '' })}
1062
- entireModal
1063
- >
1064
- <TaxInformation
1065
- type={openTaxModal.type}
1066
- data={openTaxModal.data}
1067
- products={order?.products}
1068
- />
1069
- </OModal>
1070
- <OModal
1071
- open={isOrderHistory}
1072
- onClose={() => setIsOrderHistory(false)}
1073
- entireModal
1074
- >
1075
- <OrderHistory
1076
- order={order}
1077
- hideViaText={props.hideViaText}
1078
- messages={messages}
1079
- enableReview={(
1080
- parseInt(order?.status) === 1 ||
1081
- parseInt(order?.status) === 11 ||
1082
- parseInt(order?.status) === 15
1083
- ) && !order.review && !isReviewed}
1094
+ </OrderContent>
1095
+ </>
1096
+ )}
1097
+ <OModal
1098
+ open={openTaxModal.open}
1099
+ onClose={() => setOpenTaxModal({ open: false, data: null, type: '' })}
1100
+ entireModal
1101
+ >
1102
+ <TaxInformation
1103
+ type={openTaxModal.type}
1104
+ data={openTaxModal.data}
1105
+ products={order?.products}
1106
+ />
1107
+ </OModal>
1108
+ <OModal
1109
+ open={isOrderHistory}
1084
1110
  onClose={() => setIsOrderHistory(false)}
1085
- handleTriggerReview={handleTriggerReview}
1086
- />
1087
- </OModal>
1088
- </OrderDetailsContainer>
1111
+ entireModal
1112
+ >
1113
+ <OrderHistory
1114
+ order={order}
1115
+ hideViaText={props.hideViaText}
1116
+ messages={messages}
1117
+ enableReview={(
1118
+ parseInt(order?.status) === 1 ||
1119
+ parseInt(order?.status) === 11 ||
1120
+ parseInt(order?.status) === 15
1121
+ ) && !order.review && !isReviewed}
1122
+ onClose={() => setIsOrderHistory(false)}
1123
+ handleTriggerReview={handleTriggerReview}
1124
+ />
1125
+ </OModal>
1126
+ </OrderDetailsContainer>
1127
+ </>
1089
1128
  );
1090
1129
  };
1091
1130