ordering-ui-react-native 0.21.45 → 0.21.46-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 (208) hide show
  1. package/package.json +8 -7
  2. package/src/DeliveryApp.tsx +43 -1
  3. package/src/components/BusinessesListing/index.tsx +1 -1
  4. package/src/components/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 +6 -0
  10. package/themes/business/src/components/AcceptOrRejectOrder/index.tsx +7 -3
  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/DriverMap/index.tsx +36 -23
  18. package/themes/business/src/components/GoogleMap/index.tsx +15 -8
  19. package/themes/business/src/components/Home/index.tsx +5 -1
  20. package/themes/business/src/components/LanguageSelector/index.tsx +1 -2
  21. package/themes/business/src/components/LanguageSelector/lang_country.json +515 -70
  22. package/themes/business/src/components/LogoutButton/index.tsx +1 -1
  23. package/themes/business/src/components/MapView/index.tsx +30 -15
  24. package/themes/business/src/components/MessagesOption/index.tsx +2 -1
  25. package/themes/business/src/components/NewOrderNotification/index.tsx +66 -26
  26. package/themes/business/src/components/OrderDetails/Business.tsx +52 -2
  27. package/themes/business/src/components/OrderDetails/Delivery.tsx +30 -11
  28. package/themes/business/src/components/OrderDetails/OrderContentComponent.tsx +68 -61
  29. package/themes/business/src/components/OrderDetails/OrderHeaderComponent.tsx +40 -20
  30. package/themes/business/src/components/OrderDetails/usePrinterCommands.tsx +220 -0
  31. package/themes/business/src/components/OrderSummary/index.tsx +240 -76
  32. package/themes/business/src/components/OrdersListManager/index.tsx +7 -2
  33. package/themes/business/src/components/OrdersListManager/utils.tsx +1 -1
  34. package/themes/business/src/components/OrdersOption/index.tsx +125 -46
  35. package/themes/business/src/components/PhoneInputNumber/index.tsx +8 -5
  36. package/themes/business/src/components/PreviousOrders/OrderItem.tsx +37 -40
  37. package/themes/business/src/components/PreviousOrders/OrderList.tsx +1 -1
  38. package/themes/business/src/components/PreviousOrders/index.tsx +5 -3
  39. package/themes/business/src/components/PreviousOrders/styles.tsx +10 -0
  40. package/themes/business/src/components/PrinterEdition/index.tsx +363 -0
  41. package/themes/business/src/components/PrinterEdition/styles.tsx +61 -0
  42. package/themes/business/src/components/PrinterSettings/index.tsx +267 -0
  43. package/themes/business/src/components/PrinterSettings/styles.tsx +30 -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 +106 -54
  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/components/shared/OTextarea.tsx +8 -9
  56. package/themes/business/src/hooks/useLocation.tsx +5 -4
  57. package/themes/business/src/types/index.tsx +16 -2
  58. package/themes/business/src/utils/index.tsx +5 -0
  59. package/themes/doordash/src/components/BusinessesListing/index.tsx +1 -1
  60. package/themes/doordash/src/components/LoginForm/index.tsx +1 -2
  61. package/themes/instacart/src/components/BusinessesListing/index.tsx +1 -1
  62. package/themes/kiosk/src/components/Checkout/index.tsx +6 -0
  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 +12 -4
  68. package/themes/original/src/components/AddressDetails/index.tsx +20 -10
  69. package/themes/original/src/components/AddressForm/index.tsx +41 -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 +4 -3
  87. package/themes/original/src/components/BusinessProductsCategories/index.tsx +1 -1
  88. package/themes/original/src/components/BusinessProductsList/index.tsx +1 -1
  89. package/themes/original/src/components/BusinessProductsList/styles.tsx +0 -3
  90. package/themes/original/src/components/BusinessProductsListing/index.tsx +34 -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 +1 -1
  96. package/themes/original/src/components/BusinessesListing/Layout/Original/FlatListBusinessListHeader.tsx +7 -7
  97. package/themes/original/src/components/BusinessesListing/Layout/Original/index.tsx +2 -2
  98. package/themes/original/src/components/BusinessesListing/Layout/Original/styles.tsx +1 -1
  99. package/themes/original/src/components/BusinessesListing/index.tsx +0 -1
  100. package/themes/original/src/components/Cart/index.tsx +32 -9
  101. package/themes/original/src/components/CartContent/index.tsx +96 -58
  102. package/themes/original/src/components/CartStoresListing/styles.tsx +2 -2
  103. package/themes/original/src/components/Checkout/index.tsx +144 -62
  104. package/themes/original/src/components/Checkout/styles.tsx +17 -0
  105. package/themes/original/src/components/CitiesControl/styles.tsx +1 -1
  106. package/themes/original/src/components/DatePicker/index.tsx +33 -0
  107. package/themes/original/src/components/DatePicker/styles.tsx +20 -0
  108. package/themes/original/src/components/Favorite/index.tsx +9 -9
  109. package/themes/original/src/components/Favorite/styles.tsx +0 -2
  110. package/themes/original/src/components/FloatingButton/styles.tsx +1 -1
  111. package/themes/original/src/components/ForgotPasswordForm/index.tsx +5 -0
  112. package/themes/original/src/components/GPSButton/index.tsx +1 -1
  113. package/themes/original/src/components/GiftCard/GiftCardOrdersList/index.tsx +64 -0
  114. package/themes/original/src/components/GiftCard/GiftCardOrdersList/styles.tsx +8 -0
  115. package/themes/original/src/components/GiftCard/PurchaseGiftCard/styles.tsx +1 -1
  116. package/themes/original/src/components/GiftCard/RedeemGiftCard/styles.tsx +1 -1
  117. package/themes/original/src/components/GiftCard/SendGiftCard/index.tsx +2 -2
  118. package/themes/original/src/components/GiftCard/SendGiftCard/styles.tsx +1 -1
  119. package/themes/original/src/components/GiftCard/SingleGiftCard/index.tsx +101 -0
  120. package/themes/original/src/components/GiftCard/SingleGiftCard/styles.tsx +4 -0
  121. package/themes/original/src/components/GiftCard/VerticalGiftCardOrdersLayout/index.tsx +83 -0
  122. package/themes/original/src/components/GiftCard/VerticalGiftCardOrdersLayout/styles.tsx +9 -0
  123. package/themes/original/src/components/GoogleMap/index.tsx +39 -18
  124. package/themes/original/src/components/Help/index.tsx +7 -0
  125. package/themes/original/src/components/HelpAccountAndPayment/index.tsx +5 -0
  126. package/themes/original/src/components/HelpGuide/index.tsx +5 -0
  127. package/themes/original/src/components/HelpOrder/index.tsx +5 -0
  128. package/themes/original/src/components/HighestRatedBusinesses/index.tsx +2 -2
  129. package/themes/original/src/components/HighestRatedBusinesses/styles.tsx +1 -1
  130. package/themes/original/src/components/Home/index.tsx +3 -8
  131. package/themes/original/src/components/LoginForm/Otp/index.tsx +4 -16
  132. package/themes/original/src/components/LoginForm/index.tsx +9 -3
  133. package/themes/original/src/components/MessageListing/index.tsx +6 -0
  134. package/themes/original/src/components/Messages/index.tsx +8 -7
  135. package/themes/original/src/components/Messages/styles.tsx +1 -1
  136. package/themes/original/src/components/MomentOption/index.tsx +19 -4
  137. package/themes/original/src/components/MultiCart/index.tsx +1 -1
  138. package/themes/original/src/components/MultiCartsPaymethodsAndWallets/index.tsx +7 -3
  139. package/themes/original/src/components/MultiCheckout/index.tsx +126 -61
  140. package/themes/original/src/components/MultiCheckout/styles.tsx +17 -0
  141. package/themes/original/src/components/MultiOrdersDetails/index.tsx +20 -15
  142. package/themes/original/src/components/MyOrders/index.tsx +28 -28
  143. package/themes/original/src/components/NavBar/index.tsx +5 -0
  144. package/themes/original/src/components/NetworkError/index.tsx +2 -3
  145. package/themes/original/src/components/NetworkError/styles.tsx +2 -2
  146. package/themes/original/src/components/Notifications/index.tsx +9 -8
  147. package/themes/original/src/components/Notifications/styles.tsx +0 -1
  148. package/themes/original/src/components/OrderDetails/OrderHistory.tsx +1 -1
  149. package/themes/original/src/components/OrderDetails/index.tsx +708 -663
  150. package/themes/original/src/components/OrderDetails/styles.tsx +24 -8
  151. package/themes/original/src/components/OrderProgress/index.tsx +22 -3
  152. package/themes/original/src/components/OrderProgress/styles.tsx +1 -1
  153. package/themes/original/src/components/OrderSummary/index.tsx +3 -1
  154. package/themes/original/src/components/OrderTypeSelector/index.tsx +10 -6
  155. package/themes/original/src/components/OrdersOption/PreviousBusinessOrdered/styles.tsx +1 -1
  156. package/themes/original/src/components/OrdersOption/PreviousProductsOrdered/styles.tsx +1 -1
  157. package/themes/original/src/components/OrdersOption/index.tsx +3 -5
  158. package/themes/original/src/components/OrdersOption/styles.tsx +1 -1
  159. package/themes/original/src/components/PaymentOptionCard/index.tsx +4 -2
  160. package/themes/original/src/components/PaymentOptionWallet/index.tsx +56 -56
  161. package/themes/original/src/components/PaymentOptions/index.tsx +47 -4
  162. package/themes/original/src/components/PreviousOrders/index.tsx +2 -0
  163. package/themes/original/src/components/ProductForm/ActionButton.tsx +122 -0
  164. package/themes/original/src/components/ProductForm/ExtraOptions.tsx +56 -0
  165. package/themes/original/src/components/ProductForm/index.tsx +170 -252
  166. package/themes/original/src/components/ProductItemAccordion/index.tsx +55 -44
  167. package/themes/original/src/components/ProductItemAccordion/styles.tsx +3 -4
  168. package/themes/original/src/components/ProductOptionSubOption/index.tsx +112 -91
  169. package/themes/original/src/components/ProfessionalProfile/styles.tsx +3 -3
  170. package/themes/original/src/components/Promotions/index.tsx +13 -11
  171. package/themes/original/src/components/Promotions/styles.tsx +0 -2
  172. package/themes/original/src/components/ReviewDriver/index.tsx +5 -0
  173. package/themes/original/src/components/ReviewDriver/styles.tsx +1 -1
  174. package/themes/original/src/components/ReviewOrder/index.tsx +5 -0
  175. package/themes/original/src/components/ReviewOrder/styles.tsx +1 -1
  176. package/themes/original/src/components/ReviewProducts/index.tsx +5 -0
  177. package/themes/original/src/components/ReviewProducts/styles.tsx +1 -1
  178. package/themes/original/src/components/ServiceForm/index.tsx +1 -1
  179. package/themes/original/src/components/ServiceForm/styles.tsx +4 -4
  180. package/themes/original/src/components/Sessions/index.tsx +5 -0
  181. package/themes/original/src/components/SignupForm/index.tsx +67 -59
  182. package/themes/original/src/components/SingleOrderCard/index.tsx +3 -2
  183. package/themes/original/src/components/SingleProductCard/index.tsx +4 -3
  184. package/themes/original/src/components/SingleProductCard/styles.tsx +0 -3
  185. package/themes/original/src/components/StripeCardsList/index.tsx +12 -35
  186. package/themes/original/src/components/StripeElementsForm/index.tsx +79 -59
  187. package/themes/original/src/components/StripeElementsForm/naked.tsx +47 -0
  188. package/themes/original/src/components/UpsellingProducts/UpsellingContent.tsx +170 -0
  189. package/themes/original/src/components/UpsellingProducts/UpsellingLayout.tsx +91 -0
  190. package/themes/original/src/components/UpsellingProducts/index.tsx +15 -199
  191. package/themes/original/src/components/UpsellingProducts/styles.tsx +19 -0
  192. package/themes/original/src/components/UserFormDetails/index.tsx +123 -75
  193. package/themes/original/src/components/UserFormDetails/styles.tsx +7 -0
  194. package/themes/original/src/components/UserProfile/index.tsx +3 -2
  195. package/themes/original/src/components/UserProfileForm/index.tsx +5 -0
  196. package/themes/original/src/components/WalletTransactions/styles.tsx +1 -0
  197. package/themes/original/src/components/Wallets/index.tsx +7 -4
  198. package/themes/original/src/components/Wallets/styles.tsx +2 -1
  199. package/themes/original/src/components/WebsocketStatus/index.tsx +172 -0
  200. package/themes/original/src/components/WebsocketStatus/styles.tsx +28 -0
  201. package/themes/original/src/components/shared/HeaderTitle.tsx +1 -1
  202. package/themes/original/src/components/shared/OButton.tsx +5 -5
  203. package/themes/original/src/components/shared/OInput.tsx +1 -4
  204. package/themes/original/src/components/shared/OModal.tsx +12 -14
  205. package/themes/original/src/layouts/Container.tsx +5 -3
  206. package/themes/original/src/types/index.tsx +4 -1
  207. package/themes/original/src/utils/index.tsx +12 -1
  208. 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,449 +443,688 @@ 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
+ 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
+ />
665
660
  )}
666
- {(!!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>
667
694
  <OText
668
695
  size={12}
669
696
  lineHeight={18}
670
697
  color={theme.colors.textNormal}
671
698
  mBottom={2}>
672
- {`${!!order?.customer?.country_phone_code ? '+' + order?.customer?.country_phone_code : ''} ${order?.customer?.cellphone}`}
699
+ {order?.customer?.name} {order?.customer?.lastname}
673
700
  </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
- )}
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>
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
+ 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' })}
806
840
  />
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>
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
+ />
833
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>
834
861
  <OText size={12} lineHeight={18} weight={'400'} color={theme.colors.textNormal}>
835
- - {parsePrice(order?.summary?.discount || order?.discount)}
862
+ {parsePrice(((order?.summary?.subtotal ?? order?.subtotal) + getIncludedTaxes()))}
836
863
  </OText>
837
864
  </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 && (
865
+ {(order?.summary?.discount > 0 ?? order?.discount > 0) && order?.offers?.length === 0 && (
872
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
+ )}
873
878
  <OText size={12} lineHeight={18} weight={'400'} color={theme.colors.textNormal}>
874
- {t('TAX', 'Tax')} {`(${verifyDecimals(order?.tax, parseNumber)}%)`}
879
+ - {parsePrice(order?.summary?.discount || order?.discount)}
875
880
  </OText>
876
- <OText size={12} lineHeight={18} weight={'400'} color={theme.colors.textNormal}>{parsePrice(order?.summary?.tax || 0)}</OText>
877
881
  </Table>
878
- )
879
- }
880
- {
881
- 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 && (
882
905
  <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>
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
+ )}
888
912
  </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)}%)`}{' '}
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)}%)`}
898
919
  </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}%`}){' '}
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)}%)`}
914
930
  </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>
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>
920
989
  </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>
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)}%)`
931
1018
  )}
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>
1019
+ </OText>
1020
+ <OText size={12} lineHeight={18} weight={'400'} color={theme.colors.textNormal}>{parsePrice(order?.summary?.driver_tip ?? order?.totalDriverTip)}</OText>
938
1021
  </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>
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>
962
1029
  </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
- >
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 && (
1007
1041
  <View
1042
+ key={event.id}
1008
1043
  style={{
1009
1044
  display: 'flex',
1010
- flexDirection: 'column',
1045
+ flexDirection: 'row',
1046
+ justifyContent: 'space-between',
1047
+ alignItems: 'center',
1048
+ marginBottom: 10
1011
1049
  }}
1012
1050
  >
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 && (
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 && (
1019
1063
  <OText>
1020
1064
  {`${t('CODE', 'Code')}: ${event?.data?.charge_id}`}
1021
1065
  </OText>
1022
1066
  )} */}
1067
+ </View>
1068
+ <OText>
1069
+ -{parsePrice(event.amount, { isTruncable: true })}
1070
+ </OText>
1023
1071
  </View>
1024
- <OText>
1025
- -{parsePrice(event.amount, { isTruncable: true })}
1026
- </OText>
1027
- </View>
1028
- ))}
1072
+ ))}
1073
+ </View>
1029
1074
  </View>
1030
- </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
+ </>
1031
1093
  )}
1032
- </OrderBill>
1033
- {isGiftCardOrder && order?.products[0]?.gift_card?.status === 'pending' && !isGiftCardSent && (
1034
- <>
1035
- <View
1036
- style={{
1037
- height: 8,
1038
- backgroundColor: theme.colors.backgroundGray100,
1039
- marginTop: 10,
1040
- marginHorizontal: -40,
1041
- marginBottom: 20
1042
- }}
1043
- />
1044
- <SendGiftCard
1045
- giftCardId={order?.products[0]?.gift_card?.id}
1046
- setIsGiftCardSent={setIsGiftCardSent}
1047
- />
1048
- </>
1049
- )}
1050
- </OrderContent>
1051
- </>
1052
- )}
1053
- <OModal
1054
- open={openTaxModal.open}
1055
- onClose={() => setOpenTaxModal({ open: false, data: null, type: '' })}
1056
- entireModal
1057
- >
1058
- <TaxInformation
1059
- type={openTaxModal.type}
1060
- data={openTaxModal.data}
1061
- products={order?.products}
1062
- />
1063
- </OModal>
1064
- <OModal
1065
- open={isOrderHistory}
1066
- onClose={() => setIsOrderHistory(false)}
1067
- entireModal
1068
- >
1069
- <OrderHistory
1070
- order={order}
1071
- hideViaText={props.hideViaText}
1072
- messages={messages}
1073
- enableReview={(
1074
- parseInt(order?.status) === 1 ||
1075
- parseInt(order?.status) === 11 ||
1076
- parseInt(order?.status) === 15
1077
- ) && !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}
1078
1110
  onClose={() => setIsOrderHistory(false)}
1079
- handleTriggerReview={handleTriggerReview}
1080
- />
1081
- </OModal>
1082
- </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
+ </>
1083
1128
  );
1084
1129
  };
1085
1130