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