ordering-ui-react-native 0.17.63 → 0.17.64-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 (206) 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/OrderCreating/index.tsx +1 -21
  5. package/src/components/PaymentOptionsWebView/index.tsx +29 -8
  6. package/src/components/PhoneInputNumber/index.tsx +6 -2
  7. package/src/components/StripeMethodForm/index.tsx +136 -102
  8. package/src/components/VerifyPhone/styles.tsx +1 -2
  9. package/src/components/shared/OToast.tsx +2 -2
  10. package/src/types/index.tsx +5 -0
  11. package/src/utils/index.tsx +5 -0
  12. package/themes/business/index.tsx +2 -0
  13. package/themes/business/src/components/AcceptOrRejectOrder/index.tsx +270 -245
  14. package/themes/business/src/components/AcceptOrRejectOrder/styles.tsx +6 -4
  15. package/themes/business/src/components/BusinessController/index.tsx +0 -1
  16. package/themes/business/src/components/Chat/index.tsx +123 -111
  17. package/themes/business/src/components/DriverMap/index.tsx +17 -6
  18. package/themes/business/src/components/DriverSchedule/index.tsx +42 -5
  19. package/themes/business/src/components/GoogleMap/index.tsx +58 -57
  20. package/themes/business/src/components/LoginForm/Otp/index.tsx +31 -3
  21. package/themes/business/src/components/LoginForm/index.tsx +15 -22
  22. package/themes/business/src/components/MapView/index.tsx +10 -10
  23. package/themes/business/src/components/NewOrderNotification/index.tsx +35 -21
  24. package/themes/business/src/components/NotFoundSource/index.tsx +2 -2
  25. package/themes/business/src/components/OrderDetails/Business.tsx +1 -1
  26. package/themes/business/src/components/OrderDetails/Delivery.tsx +191 -6
  27. package/themes/business/src/components/OrderDetails/OrderContentComponent.tsx +133 -65
  28. package/themes/business/src/components/OrderDetails/OrderHeaderComponent.tsx +64 -63
  29. package/themes/business/src/components/OrderDetailsLogistic/index.tsx +195 -0
  30. package/themes/business/src/components/OrderDetailsLogistic/styles.tsx +5 -0
  31. package/themes/business/src/components/OrderMessage/index.tsx +19 -18
  32. package/themes/business/src/components/OrderSummary/index.tsx +114 -123
  33. package/themes/business/src/components/OrdersOption/index.tsx +32 -75
  34. package/themes/business/src/components/PreviousOrders/OrderItem.tsx +249 -0
  35. package/themes/business/src/components/PreviousOrders/OrdersGroupedItem.tsx +115 -0
  36. package/themes/business/src/components/PreviousOrders/index.tsx +444 -242
  37. package/themes/business/src/components/PreviousOrders/styles.tsx +31 -3
  38. package/themes/business/src/components/ProductItemAccordion/index.tsx +27 -3
  39. package/themes/business/src/components/ReviewCustomer/index.tsx +30 -15
  40. package/themes/business/src/components/StoresList/index.tsx +3 -4
  41. package/themes/business/src/components/UserProfileForm/index.tsx +11 -13
  42. package/themes/business/src/components/shared/OLink.tsx +33 -13
  43. package/themes/business/src/components/shared/OModal.tsx +16 -9
  44. package/themes/business/src/components/shared/OText.tsx +8 -2
  45. package/themes/business/src/types/index.tsx +28 -12
  46. package/themes/business/src/utils/index.tsx +29 -2
  47. package/themes/doordash/src/components/BusinessesListing/index.tsx +1 -1
  48. package/themes/doordash/src/components/LoginForm/index.tsx +1 -2
  49. package/themes/instacart/src/components/BusinessesListing/index.tsx +1 -1
  50. package/themes/kiosk/src/components/Checkout/index.tsx +6 -0
  51. package/themes/kiosk/src/components/Intro/index.tsx +16 -1
  52. package/themes/kiosk/src/components/LoginForm/index.tsx +7 -9
  53. package/themes/kiosk/src/components/NavBar/index.tsx +14 -14
  54. package/themes/kiosk/src/components/OptionCard/index.tsx +1 -1
  55. package/themes/kiosk/src/components/OrderTypeCardSelector/index.tsx +8 -10
  56. package/themes/kiosk/src/components/PhoneInputNumber/index.tsx +2 -2
  57. package/themes/kiosk/src/components/shared/OButton.tsx +5 -18
  58. package/themes/original/index.tsx +4 -0
  59. package/themes/original/src/components/AddressDetails/index.tsx +19 -3
  60. package/themes/original/src/components/AddressForm/index.tsx +61 -39
  61. package/themes/original/src/components/AddressList/index.tsx +27 -22
  62. package/themes/original/src/components/AddressList/styles.tsx +4 -2
  63. package/themes/original/src/components/AnalyticsSegment/index.tsx +193 -10
  64. package/themes/original/src/components/AppleLogin/index.tsx +4 -4
  65. package/themes/original/src/components/AppleLogin/styles.tsx +3 -1
  66. package/themes/original/src/components/BusinessBasicInformation/index.tsx +153 -96
  67. package/themes/original/src/components/BusinessBasicInformation/styles.tsx +10 -12
  68. package/themes/original/src/components/BusinessController/index.tsx +94 -66
  69. package/themes/original/src/components/BusinessController/styles.tsx +22 -3
  70. package/themes/original/src/components/BusinessFeaturedController/index.tsx +21 -54
  71. package/themes/original/src/components/BusinessFeaturedController/styles.tsx +8 -0
  72. package/themes/original/src/components/BusinessInformation/index.tsx +142 -109
  73. package/themes/original/src/components/BusinessItemAccordion/index.tsx +15 -20
  74. package/themes/original/src/components/BusinessListingSearch/index.tsx +349 -339
  75. package/themes/original/src/components/BusinessListingSearch/styles.tsx +0 -18
  76. package/themes/original/src/components/BusinessPreorder/index.tsx +103 -19
  77. package/themes/original/src/components/BusinessProductsCategories/index.tsx +1 -2
  78. package/themes/original/src/components/BusinessProductsList/index.tsx +15 -7
  79. package/themes/original/src/components/BusinessProductsList/styles.tsx +8 -3
  80. package/themes/original/src/components/BusinessProductsListing/UpsellingRedirect.tsx +1 -1
  81. package/themes/original/src/components/BusinessProductsListing/index.tsx +684 -555
  82. package/themes/original/src/components/BusinessProductsListing/styles.tsx +2 -2
  83. package/themes/original/src/components/BusinessReviews/index.tsx +3 -1
  84. package/themes/original/src/components/BusinessesListing/Layout/Appointment/index.tsx +1 -1
  85. package/themes/original/src/components/BusinessesListing/Layout/Original/index.tsx +88 -49
  86. package/themes/original/src/components/BusinessesListing/Layout/Original/styles.tsx +0 -1
  87. package/themes/original/src/components/BusinessesListing/index.tsx +0 -1
  88. package/themes/original/src/components/Cart/index.tsx +77 -50
  89. package/themes/original/src/components/CartContent/index.tsx +117 -20
  90. package/themes/original/src/components/CartContent/styles.tsx +17 -7
  91. package/themes/original/src/components/Checkout/index.tsx +356 -124
  92. package/themes/original/src/components/CitiesControl/index.tsx +1 -1
  93. package/themes/original/src/components/CouponControl/index.tsx +10 -3
  94. package/themes/original/src/components/DriverTips/index.tsx +52 -34
  95. package/themes/original/src/components/FacebookLogin/styles.tsx +3 -1
  96. package/themes/original/src/components/Favorite/index.tsx +8 -9
  97. package/themes/original/src/components/Favorite/styles.tsx +1 -1
  98. package/themes/original/src/components/FavoriteList/index.tsx +1 -35
  99. package/themes/original/src/components/FloatingButton/index.tsx +1 -2
  100. package/themes/original/src/components/FloatingButton/styles.tsx +1 -1
  101. package/themes/original/src/components/GPSButton/index.tsx +6 -4
  102. package/themes/original/src/components/GiftCard/GiftCardUI/index.tsx +96 -0
  103. package/themes/original/src/components/GiftCard/GiftCardUI/styles.tsx +5 -0
  104. package/themes/original/src/components/GiftCard/PurchaseGiftCard/index.tsx +100 -0
  105. package/themes/original/src/components/GiftCard/PurchaseGiftCard/styles.tsx +8 -0
  106. package/themes/original/src/components/GiftCard/RedeemGiftCard/index.tsx +191 -0
  107. package/themes/original/src/components/GiftCard/RedeemGiftCard/styles.tsx +8 -0
  108. package/themes/original/src/components/GiftCard/SendGiftCard/index.tsx +165 -0
  109. package/themes/original/src/components/GiftCard/SendGiftCard/styles.tsx +9 -0
  110. package/themes/original/src/components/GoogleLogin/styles.tsx +1 -1
  111. package/themes/original/src/components/GoogleMap/index.tsx +60 -5
  112. package/themes/original/src/components/Help/index.tsx +8 -8
  113. package/themes/original/src/components/HelpAccountAndPayment/index.tsx +10 -31
  114. package/themes/original/src/components/HelpAccountAndPayment/styles.tsx +5 -3
  115. package/themes/original/src/components/HelpGuide/index.tsx +6 -6
  116. package/themes/original/src/components/HelpGuide/styles.tsx +6 -0
  117. package/themes/original/src/components/HelpOrder/index.tsx +6 -15
  118. package/themes/original/src/components/HelpOrder/styles.tsx +8 -1
  119. package/themes/original/src/components/Home/index.tsx +13 -4
  120. package/themes/original/src/components/LastOrder/index.tsx +1 -34
  121. package/themes/original/src/components/LoginForm/Otp/index.tsx +55 -13
  122. package/themes/original/src/components/LoginForm/Otp/styles.tsx +0 -1
  123. package/themes/original/src/components/LoginForm/index.tsx +59 -34
  124. package/themes/original/src/components/LottieAnimation/index.tsx +89 -55
  125. package/themes/original/src/components/MessageListing/index.tsx +16 -42
  126. package/themes/original/src/components/Messages/index.tsx +29 -7
  127. package/themes/original/src/components/MomentOption/index.tsx +195 -90
  128. package/themes/original/src/components/MomentSelector/index.tsx +1 -1
  129. package/themes/original/src/components/MultiCart/index.tsx +50 -0
  130. package/themes/original/src/components/MultiCartsPaymethodsAndWallets/index.tsx +162 -51
  131. package/themes/original/src/components/MultiCheckout/index.tsx +308 -88
  132. package/themes/original/src/components/MultiCheckout/styles.tsx +3 -1
  133. package/themes/original/src/components/MultiOrdersDetails/SingleOrderCard.tsx +37 -224
  134. package/themes/original/src/components/MultiOrdersDetails/index.tsx +68 -21
  135. package/themes/original/src/components/MultiOrdersDetails/styles.tsx +1 -1
  136. package/themes/original/src/components/MyOrders/index.tsx +40 -29
  137. package/themes/original/src/components/NavBar/index.tsx +20 -17
  138. package/themes/original/src/components/NotFoundSource/index.tsx +14 -10
  139. package/themes/original/src/components/Notifications/index.tsx +46 -50
  140. package/themes/original/src/components/Notifications/styles.tsx +6 -3
  141. package/themes/original/src/components/OrderDetails/OrderEta.tsx +76 -0
  142. package/themes/original/src/components/OrderDetails/OrderHistory.tsx +15 -3
  143. package/themes/original/src/components/OrderDetails/index.tsx +190 -363
  144. package/themes/original/src/components/OrderDetails/styles.tsx +0 -1
  145. package/themes/original/src/components/OrderItAgain/index.tsx +3 -1
  146. package/themes/original/src/components/OrderProgress/index.tsx +33 -56
  147. package/themes/original/src/components/OrderSummary/index.tsx +88 -59
  148. package/themes/original/src/components/OrderTypeSelector/index.tsx +2 -1
  149. package/themes/original/src/components/OrdersOption/PreviousBusinessOrdered/index.tsx +24 -19
  150. package/themes/original/src/components/OrdersOption/PreviousProductsOrdered/index.tsx +14 -14
  151. package/themes/original/src/components/OrdersOption/index.tsx +78 -67
  152. package/themes/original/src/components/OrdersOption/styles.tsx +1 -1
  153. package/themes/original/src/components/PageBanner/index.tsx +106 -31
  154. package/themes/original/src/components/PageBanner/styles.tsx +4 -4
  155. package/themes/original/src/components/PaymentOptionCard/index.tsx +180 -0
  156. package/themes/original/src/components/PaymentOptionStripe/styles.tsx +1 -1
  157. package/themes/original/src/components/PaymentOptionWallet/index.tsx +56 -56
  158. package/themes/original/src/components/PaymentOptions/index.tsx +78 -35
  159. package/themes/original/src/components/PhoneInputNumber/index.tsx +3 -3
  160. package/themes/original/src/components/ProductForm/index.tsx +105 -30
  161. package/themes/original/src/components/ProductForm/styles.tsx +5 -5
  162. package/themes/original/src/components/ProductItemAccordion/index.tsx +14 -11
  163. package/themes/original/src/components/ProductOptionSubOption/index.tsx +20 -18
  164. package/themes/original/src/components/ProductOptionSubOption/styles.tsx +5 -9
  165. package/themes/original/src/components/ProfessionalFilter/SingleProfessionalCard/index.tsx +108 -0
  166. package/themes/original/src/components/ProfessionalFilter/index.tsx +20 -50
  167. package/themes/original/src/components/ProfessionalProfile/index.tsx +36 -7
  168. package/themes/original/src/components/Promotions/index.tsx +5 -4
  169. package/themes/original/src/components/Promotions/styles.tsx +3 -1
  170. package/themes/original/src/components/ReviewOrder/index.tsx +26 -9
  171. package/themes/original/src/components/ReviewOrder/styles.tsx +7 -0
  172. package/themes/original/src/components/ReviewProducts/index.tsx +16 -7
  173. package/themes/original/src/components/ReviewTrigger/index.tsx +27 -9
  174. package/themes/original/src/components/ReviewTrigger/styles.tsx +8 -1
  175. package/themes/original/src/components/ScheduleAccordion/index.tsx +68 -0
  176. package/themes/original/src/components/ScheduleAccordion/styles.tsx +14 -0
  177. package/themes/original/src/components/ServiceForm/index.tsx +66 -17
  178. package/themes/original/src/components/Sessions/index.tsx +11 -8
  179. package/themes/original/src/components/Sessions/styles.tsx +5 -0
  180. package/themes/original/src/components/SignupForm/index.tsx +43 -27
  181. package/themes/original/src/components/SingleOrderCard/index.tsx +130 -56
  182. package/themes/original/src/components/SingleOrderCard/styles.tsx +11 -2
  183. package/themes/original/src/components/SingleProductCard/index.tsx +72 -31
  184. package/themes/original/src/components/SingleProductCard/styles.tsx +20 -4
  185. package/themes/original/src/components/SingleProductReview/styles.tsx +1 -1
  186. package/themes/original/src/components/StripeCardsList/index.tsx +49 -5
  187. package/themes/original/src/components/StripeElementsForm/index.tsx +48 -34
  188. package/themes/original/src/components/StripeElementsForm/naked.tsx +12 -1
  189. package/themes/original/src/components/UpsellingProducts/index.tsx +238 -224
  190. package/themes/original/src/components/UpsellingProducts/styles.tsx +12 -1
  191. package/themes/original/src/components/UserDetails/index.tsx +3 -1
  192. package/themes/original/src/components/UserFormDetails/index.tsx +76 -7
  193. package/themes/original/src/components/UserFormDetails/styles.tsx +1 -1
  194. package/themes/original/src/components/UserProfile/index.tsx +88 -79
  195. package/themes/original/src/components/UserProfileForm/index.tsx +27 -29
  196. package/themes/original/src/components/UserProfileForm/styles.tsx +7 -0
  197. package/themes/original/src/components/WalletTransactionItem/index.tsx +2 -2
  198. package/themes/original/src/components/WalletTransactions/index.tsx +3 -3
  199. package/themes/original/src/components/Wallets/index.tsx +66 -30
  200. package/themes/original/src/components/Wallets/styles.tsx +3 -4
  201. package/themes/original/src/components/shared/OButton.tsx +6 -2
  202. package/themes/original/src/components/shared/OInput.tsx +6 -1
  203. package/themes/original/src/components/shared/OModal.tsx +3 -3
  204. package/themes/original/src/types/index.tsx +36 -10
  205. package/themes/original/src/utils/index.tsx +273 -1
  206. package/themes/uber-eats/src/components/BusinessesListing/index.tsx +1 -1
@@ -1,17 +1,16 @@
1
1
  import React, { useState, useEffect } from 'react';
2
- import { StyleSheet, TouchableOpacity, View, Platform, PlatformIOSStatic } from 'react-native';
2
+ import { View } from 'react-native';
3
3
  import { useTheme } from 'styled-components/native';
4
- import moment from 'moment'
5
- import { useLanguage, useUtils, useConfig } from 'ordering-components/native';
6
- import { OButton, OIcon, OText } from '../shared';
7
- import {
8
- Card, Logo, Information, MyOrderOptions, NotificationIcon, AcceptOrRejectOrder, Timestatus
9
- } from './styles';
10
- import EntypoIcon from 'react-native-vector-icons/Entypo'
11
- import { DeviceOrientationMethods } from '../../../../../src/hooks/DeviceOrientation'
12
- import DeviceInfo from 'react-native-device-info';
4
+ import { useLanguage } from 'ordering-components/native';
13
5
 
14
- const { useDeviceOrientation, PORTRAIT } = DeviceOrientationMethods
6
+ import {AcceptOrRejectOrder as AcceptOrRejectOrderStyle } from './styles';
7
+
8
+ import { OButton, OModal } from '../shared';
9
+ import { OrderItem } from './OrderItem'
10
+ import { OrdersGroupedItem } from './OrdersGroupedItem'
11
+ import { AcceptOrRejectOrder } from '../AcceptOrRejectOrder';
12
+ import { ReviewCustomer } from '../ReviewCustomer';
13
+ import { GoogleMap } from '../GoogleMap';
15
14
 
16
15
  export const PreviousOrders = (props: any) => {
17
16
  const {
@@ -23,25 +22,25 @@ export const PreviousOrders = (props: any) => {
23
22
  handleClickLogisticOrder,
24
23
  slaSettingTime,
25
24
  currentTabSelected,
26
- currentOrdenSelected
25
+ currentOrdenSelected,
26
+ handleChangeOrderStatus,
27
+ handleSendCustomerReview
27
28
  } = props;
29
+
30
+ let hash: any = {};
28
31
  const [, t] = useLanguage();
29
- const [{ parseDate, optimizeImage }] = useUtils();
30
- const [configState] = useConfig()
31
32
  const theme = useTheme();
32
- const [, setCurrentTime] = useState()
33
- const [allowColumns, setAllowColumns] = useState({
34
- timer: configState?.configs?.order_deadlines_enabled?.value === '1',
35
- slaBar: configState?.configs?.order_deadlines_enabled?.value === '1',
36
- })
37
33
 
38
- const [orientationState] = useDeviceOrientation();
39
-
40
- const IS_PORTRAIT = orientationState.orientation === PORTRAIT
34
+ const [, setCurrentTime] = useState()
35
+ const [openModal, setOpenModal] = useState(false)
36
+ const [openReviewModal, setOpenReviewModal] = useState({ order: null, ids: [], customerId: null })
37
+ const [openMapViewModal, setOpenMapViewModal] = useState<any>({ open: false, customerLocation: null, locations: [] })
38
+ const [orderUpdateStatus, setOrderUpdateStatus] = useState<any>({ action: '', ids: [], body: {}, order: {} })
41
39
 
42
- const platformIOS = Platform as PlatformIOSStatic
43
- const isIpad = platformIOS.isPad
44
- const isTablet = DeviceInfo.isTablet();
40
+ const pastOrderStatuses = [1, 2, 5, 6, 10, 11, 12, 16, 17]
41
+ const viewMapStatus = [9, 18, 19, 23]
42
+ const deliveryPickupBtn = props.appTitle?.text?.includes('Delivery') && [3, 8, 18]
43
+ const deliveryStatusCompleteBtn = props.appTitle?.text?.includes('Delivery') && [9, 19, 23]
45
44
 
46
45
  const handlePressOrder = (order: any) => {
47
46
  if (order?.locked && isLogisticOrder) return
@@ -49,90 +48,136 @@ export const PreviousOrders = (props: any) => {
49
48
  if (props.handleClickEvent) {
50
49
  props.handleClickEvent({ ...order, isLogistic: isLogisticOrder })
51
50
  } else {
52
- onNavigationRedirect &&
53
- onNavigationRedirect('OrderDetails', { order: { ...order, isLogistic: isLogisticOrder }, handleClickLogisticOrder });
51
+ if (isLogisticOrder){
52
+ onNavigationRedirect &&
53
+ onNavigationRedirect('OrderDetailsLogistic', { order: { ...order, isLogistic: isLogisticOrder }, handleClickLogisticOrder });
54
+ } else {
55
+ onNavigationRedirect &&
56
+ onNavigationRedirect('OrderDetails', { order });
57
+ }
54
58
  }
55
59
  };
56
60
 
57
- const styles = StyleSheet.create({
58
- cardButton: {
59
- flex: 1,
60
- paddingVertical: (isIpad || isTablet) ? 20 : 0,
61
- marginBottom: IS_PORTRAIT ? 25 : 0,
62
- marginLeft: 3,
63
- },
64
- icon: {
65
- borderRadius: 7.6,
66
- width: 60,
67
- height: 60
68
- },
69
- logo: {
70
- borderRadius: 10,
71
- shadowColor: "#0000006e",
72
- shadowRadius: 10,
73
- elevation: 15,
74
- justifyContent: 'center',
75
- alignItems: 'center',
76
- marginLeft: 3,
77
- },
78
- title: {
79
- marginBottom: 6,
80
- fontFamily: 'Poppins',
81
- fontStyle: 'normal',
82
- fontWeight: '600',
83
- fontSize: 16,
84
- color: theme.colors.textGray,
85
- },
86
- date: {
87
- marginBottom: 6,
88
- fontFamily: 'Poppins',
89
- fontStyle: 'normal',
90
- fontWeight: 'normal',
91
- fontSize: 12,
92
- },
93
- orderType: {
94
- fontSize: 12,
95
- fontFamily: 'Poppins',
96
- fontStyle: 'normal',
97
- fontWeight: 'normal',
98
- color: theme.colors.orderTypeColor,
99
- },
100
- });
61
+ const OrdersList = (props: any) => {
62
+ const { order, _order, hideBtns } = props
63
+ return (
64
+ <View
65
+ style={{
66
+ backgroundColor: currentOrdenSelected === order?.id ? theme.colors.gray100 : order?.locked && isLogisticOrder ? '#ccc' : '#fff',
67
+ marginBottom: isLogisticOrder ? 10 : 0
68
+ }}
69
+ >
70
+ <OrderItem
71
+ order={order}
72
+ _order={_order}
73
+ isLogisticOrder={isLogisticOrder}
74
+ handlePressOrder={handlePressOrder}
75
+ currentTabSelected={currentTabSelected}
76
+ getOrderStatus={getOrderStatus}
77
+ />
78
+ {isLogisticOrder && !hideBtns && (
79
+ <AcceptOrRejectOrderStyle>
80
+ {!!order?.order_group_id && !!order?.order_group ? (
81
+ <OButton
82
+ text={t('VIEW_ORDER', 'View order')}
83
+ onClick={() => handlePressOrder({ ...order, logistic_order_id: _order?.id })}
84
+ bgColor={theme.colors.blueLight}
85
+ borderColor={theme.colors.blueLight}
86
+ imgRightSrc={null}
87
+ style={{ borderRadius: 7, height: 40 }}
88
+ parentStyle={{ width: '100%' }}
89
+ textStyle={{ color: theme?.colors?.white }}
90
+ />
91
+ ) : (
92
+ <>
93
+ <OButton
94
+ text={t('REJECT', 'Reject')}
95
+ onClick={() => handleClickLogisticOrder(2, _order?.id)}
96
+ bgColor={theme.colors.red}
97
+ borderColor={theme.colors.red}
98
+ imgRightSrc={null}
99
+ style={{ borderRadius: 7, height: 40 }}
100
+ parentStyle={{ width: '45%' }}
101
+ textStyle={{ color: theme.colors.white }}
102
+ />
103
+ <OButton
104
+ text={t('ACCEPT', 'Accept')}
105
+ onClick={() => handleClickLogisticOrder(1, _order?.id)}
106
+ bgColor={theme.colors.green}
107
+ borderColor={theme.colors.green}
108
+ imgRightSrc={null}
109
+ style={{ borderRadius: 7, height: 40 }}
110
+ parentStyle={{ width: '45%' }}
111
+ textStyle={{ color: theme.colors.white }}
112
+ />
113
+ </>
114
+ )}
115
+ </AcceptOrRejectOrderStyle>
116
+ )}
117
+ </View>
118
+ )
119
+ }
101
120
 
102
- const getDelayMinutes = (order: any) => {
103
- // targetMin = delivery_datetime + eta_time - now()
104
- const offset = 300
105
- const cdtToutc = moment(order?.delivery_datetime).add(offset, 'minutes').format('YYYY-MM-DD HH:mm:ss')
106
- const _delivery = order?.delivery_datetime_utc
107
- ? parseDate(order?.delivery_datetime_utc, { outputFormat: 'YYYY-MM-DD hh:mm A' })
108
- : parseDate(cdtToutc, { outputFormat: 'YYYY-MM-DD hh:mm A' })
109
- const _eta = order?.eta_time
110
- const diffTimeAsSeconds = moment(_delivery, 'YYYY-MM-DD hh:mm A').add(_eta, 'minutes').diff(moment().utc(), 'seconds')
111
- return Math.ceil(diffTimeAsSeconds / 60)
121
+ const ordersGroupAction = (param1 = '', param2 = '', { order, action, body, ids }: any = {}) => {
122
+ setOrderUpdateStatus({ ...orderUpdateStatus, action, ids, body, order })
123
+ if (!param1) setOpenModal(true)
124
+ if (param1) {
125
+ setOpenModal(false)
126
+ handleChangeOrderStatus &&
127
+ handleChangeOrderStatus(param1, orderUpdateStatus.ids, param2)
128
+ }
112
129
  }
113
130
 
114
- const displayDelayedTime = (order: any) => {
115
- let tagetedMin = getDelayMinutes(order)
116
- // get day, hour and minutes
117
- const sign = tagetedMin >= 0 ? '' : '- '
118
- tagetedMin = Math.abs(tagetedMin)
119
- let day: string | number = Math.floor(tagetedMin / 1440)
120
- const restMinOfTargetedMin = tagetedMin - 1440 * day
121
- let restHours: string | number = Math.floor(restMinOfTargetedMin / 60)
122
- let restMins: string | number = restMinOfTargetedMin - 60 * restHours
123
- // make standard time format
124
- day = day === 0 ? '' : day + 'day '
125
- restHours = restHours < 10 ? '0' + restHours : restHours
126
- restMins = restMins < 10 ? '0' + restMins : restMins
131
+ const handleOpenMapView = ({ orders }: any) => {
132
+ const locations: any = []
127
133
 
128
- const finalTaget = sign + day + restHours + ':' + restMins
129
- return finalTaget
130
- }
134
+ orders.map((_order: any) => {
135
+ if (_order?.driver?.location) {
136
+ locations.push({
137
+ ..._order?.driver?.location,
138
+ title: _order?.driver?.name ?? t('DRIVER', 'Driver'),
139
+ icon:
140
+ _order?.driver?.photo ||
141
+ 'https://res.cloudinary.com/demo/image/fetch/c_thumb,g_face,r_max/https://www.freeiconspng.com/thumbs/driver-icon/driver-icon-14.png',
142
+ level: 4,
143
+ })
144
+ }
145
+ if (_order?.business?.location) {
146
+ locations.push({
147
+ ..._order?.business?.location,
148
+ title: _order?.business?.name,
149
+ address: {
150
+ addressName: _order?.business?.address,
151
+ zipcode: _order?.business?.zipcode
152
+ },
153
+ icon:
154
+ _order?.business?.logo ||
155
+ 'https://res.cloudinary.com/demo/image/fetch/c_thumb,g_face,r_max/https://res.cloudinary.com/ordering2/image/upload/v1654619525/hzegwosnplvrbtjkpfi6.png',
156
+ level: 2,
157
+ })
158
+ }
159
+ if (_order?.customer?.location) {
160
+ locations.push({
161
+ ..._order?.customer?.location,
162
+ title: _order?.customer?.name ?? t('CUSTOMER', 'Customer'),
163
+ address: {
164
+ addressName: _order?.customer?.address,
165
+ zipcode: _order?.customer?.zipcode
166
+ },
167
+ icon:
168
+ _order?.customer?.photo ||
169
+ 'https://res.cloudinary.com/demo/image/upload/c_thumb,g_face,r_max/d_avatar.png/non_existing_id.png',
170
+ level: 3,
171
+ })
172
+ }
173
+ })
131
174
 
132
- const getStatusClassName = (minutes: number) => {
133
- if (isNaN(Number(minutes))) return 'in_time'
134
- const delayTime = configState?.configs?.order_deadlines_delayed_time?.value
135
- return minutes > 0 ? 'in_time' : Math.abs(minutes) <= delayTime ? 'at_risk' : 'delayed'
175
+ setOpenMapViewModal({
176
+ ...openMapViewModal,
177
+ open: true,
178
+ locations,
179
+ customerLocation: orders[0]?.customer?.location
180
+ })
136
181
  }
137
182
 
138
183
  useEffect(() => {
@@ -144,159 +189,316 @@ export const PreviousOrders = (props: any) => {
144
189
  return () => clearInterval(interval)
145
190
  }, [])
146
191
 
147
- useEffect(() => {
148
- const slaSettings = configState?.configs?.order_deadlines_enabled?.value === '1'
149
- setAllowColumns({
150
- ...allowColumns,
151
- timer: slaSettings,
152
- slaBar: slaSettings
153
- })
154
- }, [configState.loading])
155
-
156
- let hash: any = {};
157
192
 
158
193
  return (
159
194
  <>
160
- {orders && orders?.length > 0 &&
161
- orders
162
- ?.filter((order: any) => hash[order?.id] ? false : (hash[order?.id] = true))
163
- ?.map((_order: any) => {
164
- const order = _order?.isLogistic && !_order?.order_group && isLogisticOrder ? _order?.order : _order
165
- return (
166
- <View
167
- style={{
168
- backgroundColor: currentOrdenSelected === order?.id ? theme.colors.gray100 : order?.locked && isLogisticOrder ? '#ccc' : '#fff',
169
- marginBottom: isLogisticOrder ? 10 : 0,
170
- // justifyContent: 'center'
171
- }}
172
- key={order.id}
173
- >
174
- <TouchableOpacity
175
- onPress={() => handlePressOrder({ ...order, logistic_order_id: _order?.id })}
176
- style={styles.cardButton}
177
- disabled={order?.locked && isLogisticOrder}
178
- activeOpacity={1}
195
+ {orders && orders?.length > 0 && orders.map((_order: any) => {
196
+ const order = !Array.isArray(_order) && (_order?.isLogistic && !_order?.order_group && isLogisticOrder ? _order?.order : _order)
197
+ const _ordersGrouped = Array.isArray(_order) && Object.fromEntries(_order)
198
+ return (
199
+ _ordersGrouped ? (
200
+ <View key={_order[0]} style={{ marginBottom: 10 }}>
201
+ {Object.keys(_ordersGrouped).map((k, idx) => (
202
+ <OrdersGroupedItem
203
+ key={`${k}_${idx}`}
204
+ groupId={k}
205
+ orders={_ordersGrouped[k]}
179
206
  >
180
- <Card key={order.id}>
181
- {allowColumns?.slaBar && (
182
- <Timestatus style={{ backgroundColor: getStatusClassName(getDelayMinutes(order)) === 'in_time' ? '#00D27A' : getStatusClassName(getDelayMinutes(order)) === 'at_risk' ? '#FFC700' : getStatusClassName(getDelayMinutes(order)) === 'delayed' ? '#E63757' : '' }} />
183
- )}
184
- <Logo style={styles.logo}>
185
- <OIcon
186
- url={optimizeImage(
187
- order.business?.logo,
188
- 'h_300,c_limit',
207
+ {_ordersGrouped[k]?.length > 0 &&
208
+ _ordersGrouped[k]
209
+ ?.filter((order: any) => hash[order?.id] ? false : (hash[order?.id] = true))
210
+ ?.map((_order: any) => {
211
+ const order_ = _order?.isLogistic && !_order?.order_group && isLogisticOrder ? _order?.order : _order
212
+ return (
213
+ <OrdersList key={order_.id} order={order_} _order={_order} hideBtns />
214
+ )
215
+ }
216
+ )
217
+ }
218
+ {_ordersGrouped[k][0]?.status === 0 && (
219
+ <AcceptOrRejectOrderStyle>
220
+ <OButton
221
+ text={t('REJECT_ALL', 'Reject all')}
222
+ bgColor={theme.colors.danger100}
223
+ borderColor={theme.colors.danger100}
224
+ imgRightSrc={null}
225
+ style={{ borderRadius: 7, height: 40 }}
226
+ parentStyle={{ width: '45%' }}
227
+ textStyle={{ color: theme.colors.danger500, fontSize: 12 }}
228
+ onClick={() => onNavigationRedirect('AcceptOrRejectOrder', {
229
+ action: 'reject',
230
+ order: _ordersGrouped[k][0],
231
+ ids: _ordersGrouped[k].map((o: any) => o.id),
232
+ handleChangeOrderStatus
233
+ })}
234
+ />
235
+ <OButton
236
+ text={t('ACCEPT_ALL', 'Accept all')}
237
+ bgColor={theme.colors.success100}
238
+ borderColor={theme.colors.success100}
239
+ imgRightSrc={null}
240
+ style={{ borderRadius: 7, height: 40 }}
241
+ parentStyle={{ width: '45%' }}
242
+ textStyle={{ color: theme.colors.success500, fontSize: 12 }}
243
+ onClick={() => onNavigationRedirect('AcceptOrRejectOrder', {
244
+ action: 'accept',
245
+ order: _ordersGrouped[k][0],
246
+ ids: _ordersGrouped[k].map((o: any) => o.id),
247
+ handleChangeOrderStatus
248
+ })}
249
+ />
250
+ </AcceptOrRejectOrderStyle>
251
+ )}
252
+ {_ordersGrouped[k][0]?.status === 7 && (
253
+ <View>
254
+ <OButton
255
+ text={t('READY_FOR_PICKUP', 'Ready for pickup')}
256
+ bgColor={theme.colors.primaryLight}
257
+ borderColor={theme.colors.primaryLight}
258
+ imgRightSrc={null}
259
+ style={{ borderRadius: 7, height: 40 }}
260
+ parentStyle={{ width: '100%' }}
261
+ textStyle={{ color: theme.colors.primary, fontSize: 12 }}
262
+ onClick={() => handleChangeOrderStatus(
263
+ 4,
264
+ _ordersGrouped[k].map((o: any) => o.id),
189
265
  )}
190
- src={!order?.business?.logo && theme?.images?.dummies?.businessLogo}
191
- style={styles.icon}
192
266
  />
193
- </Logo>
194
- <Information>
195
- {!!order?.order_group_id && (
196
- <OText>
197
- <OText>{(t('INVOICE_GROUP_NO', 'Group No.') + order?.order_group_id)}</OText>
198
- </OText>
199
- )}
200
- {!!order.business?.name && (
201
- <OText numberOfLines={1} style={styles.title}>
202
- {order.business?.name}
203
- </OText>
204
- )}
205
- {!!order?.showNotification && (
206
- <NotificationIcon>
207
- <EntypoIcon
208
- name="dot-single"
209
- size={32}
210
- color={theme.colors.primary}
211
- />
212
- </NotificationIcon>
213
- )}
214
- <View style={{ flexDirection: 'row', flexWrap: 'wrap' }}>
215
- <OText
216
- style={styles.date}
217
- color={theme.colors.unselectText}
218
- numberOfLines={1}
219
- adjustsFontSizeToFit
220
- >
221
- {(order?.order_group_id && order?.order_group && isLogisticOrder ? `${order?.order_group?.orders?.length} ${t('ORDERS', 'Orders')}` : (t('NO', 'Order No.') + order.id)) + ' · '}
222
- {order?.delivery_datetime_utc
223
- ? parseDate(order?.delivery_datetime_utc, { outputFormat: 'MM/DD/YY · HH:mm a' })
224
- : parseDate(order?.delivery_datetime, { utc: false })}
225
- </OText>
226
- {((currentTabSelected === 'pending' || currentTabSelected === 'inProgress') && allowColumns?.timer) && (
227
- <>
228
- <OText> · </OText>
229
- <OText style={styles.date} color={getStatusClassName(getDelayMinutes(order)) === 'in_time' ? '#00D27A' : getStatusClassName(getDelayMinutes(order)) === 'at_risk' ? '#FFC700' : getStatusClassName(getDelayMinutes(order)) === 'delayed' ? '#E63757' : ''} >{displayDelayedTime(order)}</OText>
230
- </>
267
+ </View>
268
+ )}
269
+ {(_ordersGrouped[k][0]?.status === 8 || _ordersGrouped[k][0]?.status === 18) &&
270
+ _ordersGrouped[k][0]?.delivery_type === 1 &&
271
+ (
272
+ <AcceptOrRejectOrderStyle>
273
+ <OButton
274
+ text={t('ARRIVED_TO_BUSINESS', 'Arrived to bussiness')}
275
+ bgColor={theme.colors.btnBGWhite}
276
+ borderColor={theme.colors.btnBGWhite}
277
+ imgRightSrc={null}
278
+ style={{ borderRadius: 7, height: 40 }}
279
+ parentStyle={{ width: '100%' }}
280
+ textStyle={{ color: theme.colors.primary, fontSize: 12 }}
281
+ onClick={() => handleChangeOrderStatus(
282
+ 3,
283
+ _ordersGrouped[k].map((o: any) => o.id),
231
284
  )}
232
- </View>
233
- {!isLogisticOrder && (
234
- <MyOrderOptions>
235
- <OText
236
- style={styles.orderType}
237
- mRight={5}
238
- numberOfLines={1}
239
- adjustsFontSizeToFit
240
- >
241
- {order.delivery_type === 1
242
- ? t('DELIVERY', 'Delivery')
243
- : order.delivery_type === 2
244
- ? t('PICKUP', 'Pickup')
245
- : order.delivery_type === 3
246
- ? t('EAT_IN', 'Eat in')
247
- : order.delivery_type === 4
248
- ? t('CURBSIDE', 'Curbside')
249
- : t('DRIVER_THRU', 'Driver thru')}
250
- {` · ${getOrderStatus(order.status)}`}
251
- </OText>
252
- </MyOrderOptions>
253
- )}
254
- </Information>
255
- </Card>
256
- </TouchableOpacity>
257
- {isLogisticOrder && (
258
- <AcceptOrRejectOrder>
259
- {!!order?.order_group_id && !!order?.order_group ? (
285
+ />
286
+ </AcceptOrRejectOrderStyle>
287
+ )}
288
+ {_ordersGrouped[k][0]?.status === 3 && _ordersGrouped[k][0]?.delivery_type === 1 &&
289
+ (
290
+ <AcceptOrRejectOrderStyle>
291
+ <OButton
292
+ text={t('ORDER_NOT_READY', 'Order not ready')}
293
+ bgColor={theme.colors.red}
294
+ borderColor={theme.colors.red}
295
+ imgRightSrc={null}
296
+ style={{ borderRadius: 7, height: 40 }}
297
+ parentStyle={{ width: '100%' }}
298
+ textStyle={{ color: theme.colors.white, fontSize: 12 }}
299
+ onClick={() => onNavigationRedirect('AcceptOrRejectOrder', {
300
+ action: 'notReady',
301
+ order: _ordersGrouped[k][0],
302
+ ids: _ordersGrouped[k].map((o: any) => o.id),
303
+ handleChangeOrderStatus
304
+ })}
305
+ />
306
+ </AcceptOrRejectOrderStyle>
307
+ )}
308
+ {viewMapStatus.includes(_ordersGrouped[k][0]?.status) &&
309
+ props.appTitle?.text?.includes('Business') &&
310
+ (
311
+ <View>
260
312
  <OButton
261
- text={t('VIEW_ORDER', 'View order')}
262
- onClick={() => handlePressOrder({ ...order, logistic_order_id: _order?.id })}
263
- bgColor={theme.colors.blueLight}
264
- borderColor={theme.colors.blueLight}
313
+ text={t('TRACK_REAL_TIME_POSITION', 'Track real time position')}
314
+ bgColor={theme.colors.primaryLight}
315
+ borderColor={theme.colors.primaryLight}
265
316
  imgRightSrc={null}
266
317
  style={{ borderRadius: 7, height: 40 }}
267
318
  parentStyle={{ width: '100%' }}
268
- textStyle={{ color: theme.colors.primary }}
319
+ textStyle={{ color: theme.colors.primary, fontSize: 12 }}
320
+ onClick={() => handleOpenMapView({ orders: _ordersGrouped[k] })}
321
+ />
322
+ </View>
323
+ )}
324
+ {_ordersGrouped[k][0]?.status === 4 &&
325
+ ![1].includes(_ordersGrouped[k][0]?.delivery_type) &&
326
+ (
327
+ <AcceptOrRejectOrderStyle>
328
+ <OButton
329
+ text={t('ORDER_NOT_PICKEDUP_BY_CUSTOMER', 'Order not picked up by customer')}
330
+ bgColor={theme.colors.danger100}
331
+ borderColor={theme.colors.danger100}
332
+ imgRightSrc={null}
333
+ style={{ borderRadius: 7, height: 40, paddingLeft: 10, paddingRight: 10 }}
334
+ parentStyle={{ width: '45%' }}
335
+ textStyle={{ color: theme.colors.danger500, fontSize: 12, textAlign: 'center' }}
336
+ onClick={() => handleChangeOrderStatus(
337
+ 17,
338
+ _ordersGrouped[k].map((o: any) => o.id),
339
+ )}
340
+ />
341
+ <OButton
342
+ text={t('PICKUP_COMPLETED_BY_CUSTOMER', 'Pickup completed by customer')}
343
+ bgColor={theme.colors.success100}
344
+ borderColor={theme.colors.success100}
345
+ imgRightSrc={null}
346
+ style={{ borderRadius: 7, height: 40, paddingLeft: 10, paddingRight: 10 }}
347
+ parentStyle={{ width: '45%' }}
348
+ textStyle={{ color: theme.colors.success500, fontSize: 12, textAlign: 'center' }}
349
+ onClick={() => handleChangeOrderStatus(
350
+ 15,
351
+ _ordersGrouped[k].map((o: any) => o.id),
352
+ )}
269
353
  />
270
- ) : (
271
- <>
272
- <OButton
273
- text={t('REJECT', 'Reject')}
274
- onClick={() => handleClickLogisticOrder(2, _order?.id)}
275
- bgColor={theme.colors.danger}
276
- borderColor={theme.colors.danger}
277
- imgRightSrc={null}
278
- style={{ borderRadius: 7, height: 40 }}
279
- parentStyle={{ width: '45%' }}
280
- textStyle={{ color: theme.colors.dangerText }}
281
- />
282
- <OButton
283
- text={t('ACCEPT', 'Accept')}
284
- onClick={() => handleClickLogisticOrder(1, _order?.id)}
285
- bgColor={theme.colors.successOrder}
286
- borderColor={theme.colors.successOrder}
287
- imgRightSrc={null}
288
- style={{ borderRadius: 7, height: 40 }}
289
- parentStyle={{ width: '45%' }}
290
- textStyle={{ color: theme.colors.successText }}
291
- />
292
- </>
293
- )}
294
- </AcceptOrRejectOrder>
295
- )}
296
- </View>
297
- )
298
- }
299
- )}
354
+ </AcceptOrRejectOrderStyle>
355
+ )}
356
+ {!_ordersGrouped[k][0]?.user_review &&
357
+ pastOrderStatuses.includes(_ordersGrouped[k][0]?.status) &&
358
+ (
359
+ <OButton
360
+ text={t('REVIEW_CUSTOMER', 'Review customer')}
361
+ bgColor={theme.colors.primary}
362
+ borderColor={theme.colors.primary}
363
+ imgRightSrc={null}
364
+ style={{ borderRadius: 8, height: 40 }}
365
+ parentStyle={{ width: '100%' }}
366
+ textStyle={{ color: theme.colors.white }}
367
+ onClick={() => setOpenReviewModal({
368
+ order: _ordersGrouped[k][0],
369
+ customerId: _ordersGrouped[k][0]?.customer_id,
370
+ ids: _ordersGrouped[k].map((o: any) => o.id)
371
+ })}
372
+ />
373
+ )}
374
+ {!!deliveryPickupBtn && deliveryPickupBtn?.includes(_ordersGrouped[k][0]?.status) && (
375
+ <AcceptOrRejectOrderStyle>
376
+ <OButton
377
+ text={t('PICKUP_FAILED', 'Pickup failed')}
378
+ bgColor={theme.colors.danger100}
379
+ borderColor={theme.colors.danger100}
380
+ imgRightSrc={null}
381
+ style={{ borderRadius: 7, height: 40, paddingLeft: 10, paddingRight: 10 }}
382
+ parentStyle={{ width: '45%' }}
383
+ textStyle={{ color: theme.colors.danger500, fontSize: 12, textAlign: 'center' }}
384
+ onClick={() => onNavigationRedirect('AcceptOrRejectOrder', {
385
+ action: 'pickupFailed',
386
+ order: _ordersGrouped[k][0],
387
+ ids: _ordersGrouped[k].map((o: any) => o.id),
388
+ handleChangeOrderStatus
389
+ })}
390
+ />
391
+ <OButton
392
+ text={t('PICKUP_COMPLETE', 'Pickup complete')}
393
+ bgColor={theme.colors.success100}
394
+ borderColor={theme.colors.success100}
395
+ imgRightSrc={null}
396
+ style={{ borderRadius: 7, height: 40, paddingLeft: 10, paddingRight: 10 }}
397
+ parentStyle={{ width: '45%' }}
398
+ textStyle={{ color: theme.colors.success500, fontSize: 12, textAlign: 'center' }}
399
+ onClick={() => handleChangeOrderStatus(
400
+ 9,
401
+ _ordersGrouped[k].map((o: any) => o.id),
402
+ )}
403
+ />
404
+ </AcceptOrRejectOrderStyle>
405
+ )}
406
+ {!!deliveryStatusCompleteBtn && deliveryStatusCompleteBtn.includes(_ordersGrouped[k][0]?.status) && (
407
+ <AcceptOrRejectOrderStyle>
408
+ <OButton
409
+ text={t('DELIVERY_FAILED', 'Delivery Failed')}
410
+ bgColor={theme.colors.danger100}
411
+ borderColor={theme.colors.danger100}
412
+ imgRightSrc={null}
413
+ style={{ borderRadius: 7, height: 40, paddingLeft: 10, paddingRight: 10 }}
414
+ parentStyle={{ width: '45%' }}
415
+ textStyle={{ color: theme.colors.danger500, fontSize: 12, textAlign: 'center' }}
416
+ onClick={() => onNavigationRedirect('AcceptOrRejectOrder', {
417
+ action: 'deliveryFailed',
418
+ order: _ordersGrouped[k][0],
419
+ ids: _ordersGrouped[k].map((o: any) => o.id),
420
+ handleChangeOrderStatus
421
+ })}
422
+ />
423
+ <OButton
424
+ text={t('DELIVERY_COMPLETE', 'Delivery complete')}
425
+ bgColor={theme.colors.success100}
426
+ borderColor={theme.colors.success100}
427
+ imgRightSrc={null}
428
+ style={{ borderRadius: 7, height: 40, paddingLeft: 10, paddingRight: 10 }}
429
+ parentStyle={{ width: '45%' }}
430
+ textStyle={{ color: theme.colors.success500, fontSize: 12, textAlign: 'center' }}
431
+ onClick={() => handleChangeOrderStatus(
432
+ 11,
433
+ _ordersGrouped[k].map((o: any) => o.id),
434
+ )}
435
+ />
436
+ </AcceptOrRejectOrderStyle>
437
+ )}
438
+ </OrdersGroupedItem>
439
+ ))}
440
+ </View>
441
+ ) : (
442
+ <View key={order.id}>
443
+ <OrdersList order={order} _order={_order} />
444
+ </View>
445
+ )
446
+ )
447
+ })}
448
+
449
+ <OModal
450
+ open={openModal}
451
+ onClose={() => setOpenModal(false)}
452
+ entireModal
453
+ customClose
454
+ >
455
+ <AcceptOrRejectOrder
456
+ notShowCustomerPhone={false}
457
+ appTitle={props.appTitle}
458
+ customerCellphone={orderUpdateStatus.order?.customer?.cellphone}
459
+ action={orderUpdateStatus.action}
460
+ orderId={orderUpdateStatus.ids?.[0]}
461
+ actions={props.actions}
462
+ orderTitle={props.orderTitle}
463
+ handleUpdateOrder={ordersGroupAction}
464
+ closeModal={() => setOpenModal(false)}
465
+ />
466
+ </OModal>
467
+ <OModal
468
+ open={!!openReviewModal?.order}
469
+ onClose={() => setOpenReviewModal({ order: null, ids: [], customerId: null })}
470
+ entireModal
471
+ customClose
472
+ >
473
+ <ReviewCustomer
474
+ order={openReviewModal?.order}
475
+ closeModal={() => setOpenReviewModal({ order: null, ids: [], customerId: null })}
476
+ onClose={() => setOpenReviewModal({ order: null, ids: [], customerId: null })}
477
+ handleCustomCustomerReview={(body: any) => handleSendCustomerReview({
478
+ onClose: setOpenReviewModal({ order: null, ids: [], customerId: null }),
479
+ customerId: openReviewModal?.customerId,
480
+ orderIds: openReviewModal?.ids,
481
+ body
482
+ })}
483
+ />
484
+ </OModal>
485
+ <OModal
486
+ open={openMapViewModal.open}
487
+ onClose={() => setOpenMapViewModal({ ...openMapViewModal, open: false })}
488
+ entireModal
489
+ customClose
490
+ >
491
+ <GoogleMap
492
+ readOnly
493
+ navigation={props.navigation}
494
+ location={openMapViewModal.customerLocation}
495
+ locations={openMapViewModal.locations}
496
+ handleOpenMapView={() => setOpenMapViewModal({
497
+ ...openMapViewModal,
498
+ open: !openMapViewModal
499
+ })}
500
+ />
501
+ </OModal>
300
502
  </>
301
503
  );
302
504
  };