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