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