ordering-ui-react-native 0.19.2-testing → 0.19.3-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.
- package/package.json +6 -5
- package/src/DeliveryApp.tsx +43 -1
- package/src/components/BusinessInformation/index.tsx +10 -9
- package/src/components/BusinessesListing/index.tsx +1 -1
- package/src/components/VerifyPhone/styles.tsx +1 -2
- package/src/components/shared/OToast.tsx +3 -2
- package/src/utils/index.tsx +2 -2
- package/themes/business/index.tsx +2 -0
- package/themes/business/src/components/AcceptOrRejectOrder/index.tsx +9 -2
- package/themes/business/src/components/BusinessController/index.tsx +19 -17
- package/themes/business/src/components/BusinessProductList/AccordionDropdown.tsx +63 -0
- package/themes/business/src/components/BusinessProductList/IterateCategories.tsx +108 -0
- package/themes/business/src/components/BusinessProductList/ProductList.tsx +196 -0
- package/themes/business/src/components/BusinessProductList/index.tsx +196 -0
- package/themes/business/src/components/BusinessProductList/styles.tsx +10 -0
- package/themes/business/src/components/Chat/index.tsx +41 -13
- package/themes/business/src/components/DriverMap/index.tsx +4 -2
- package/themes/business/src/components/DriverSchedule/index.tsx +5 -5
- package/themes/business/src/components/FloatingButton/index.tsx +34 -31
- package/themes/business/src/components/MapView/index.tsx +11 -7
- package/themes/business/src/components/MessagesOption/index.tsx +22 -94
- package/themes/business/src/components/NewOrderNotification/index.tsx +121 -103
- package/themes/business/src/components/OrderDetails/Delivery.tsx +19 -10
- package/themes/business/src/components/OrderDetails/OrderContentComponent.tsx +88 -51
- package/themes/business/src/components/OrderDetails/OrderHeaderComponent.tsx +26 -6
- package/themes/business/src/components/OrderDetailsLogistic/index.tsx +6 -1
- package/themes/business/src/components/OrderSummary/index.tsx +27 -13
- package/themes/business/src/components/OrdersListManager/index.tsx +7 -2
- package/themes/business/src/components/OrdersListManager/utils.tsx +1 -1
- package/themes/business/src/components/OrdersOption/index.tsx +83 -37
- package/themes/business/src/components/PreviousMessages/FooterMessageComponent.tsx +103 -0
- package/themes/business/src/components/PreviousMessages/index.tsx +97 -55
- package/themes/business/src/components/PreviousOrders/OrderItem.tsx +24 -31
- package/themes/business/src/components/PreviousOrders/OrderList.tsx +93 -0
- package/themes/business/src/components/PreviousOrders/OrdersGroupedItem.tsx +1 -1
- package/themes/business/src/components/PreviousOrders/index.tsx +192 -220
- package/themes/business/src/components/PreviousOrders/styles.tsx +10 -0
- package/themes/business/src/components/ReviewCustomer/index.tsx +2 -0
- package/themes/business/src/components/SearchBar/index.tsx +2 -1
- package/themes/business/src/components/StoresList/index.tsx +5 -3
- package/themes/business/src/components/UserProfileForm/index.tsx +27 -10
- package/themes/business/src/components/WebsocketStatus/index.tsx +171 -0
- package/themes/business/src/components/WebsocketStatus/styles.tsx +28 -0
- package/themes/business/src/types/index.tsx +10 -0
- package/themes/doordash/src/components/BusinessesListing/index.tsx +1 -1
- package/themes/doordash/src/components/LoginForm/index.tsx +1 -2
- package/themes/instacart/src/components/BusinessesListing/index.tsx +1 -1
- package/themes/kiosk/src/components/Checkout/index.tsx +6 -0
- package/themes/kiosk/src/components/LoginForm/index.tsx +124 -96
- package/themes/kiosk/src/components/NavBar/index.tsx +14 -14
- package/themes/kiosk/src/components/OptionCard/index.tsx +1 -1
- package/themes/kiosk/src/components/OrderTypeCardSelector/index.tsx +8 -10
- package/themes/kiosk/src/components/shared/OButton.tsx +5 -18
- package/themes/original/index.tsx +7 -3
- package/themes/original/src/components/AddressForm/index.tsx +2 -2
- package/themes/original/src/components/AddressForm/styles.tsx +1 -1
- package/themes/original/src/components/AddressList/index.tsx +4 -7
- package/themes/original/src/components/AddressList/styles.tsx +4 -4
- package/themes/original/src/components/AppleLogin/index.tsx +4 -4
- package/themes/original/src/components/BusinessBasicInformation/index.tsx +3 -3
- package/themes/original/src/components/BusinessBasicInformation/styles.tsx +1 -1
- package/themes/original/src/components/BusinessController/index.tsx +9 -6
- package/themes/original/src/components/BusinessController/styles.tsx +8 -7
- package/themes/original/src/components/BusinessInformation/index.tsx +35 -3
- package/themes/original/src/components/BusinessInformation/styles.tsx +2 -2
- package/themes/original/src/components/BusinessItemAccordion/index.tsx +11 -7
- package/themes/original/src/components/BusinessListingSearch/BusinessSearchFooter.tsx +317 -0
- package/themes/original/src/components/BusinessListingSearch/BusinessSearchHeader.tsx +96 -0
- package/themes/original/src/components/BusinessListingSearch/MaxSectionItem/index.tsx +1 -1
- package/themes/original/src/components/BusinessListingSearch/index.tsx +56 -361
- package/themes/original/src/components/BusinessListingSearch/styles.tsx +1 -1
- package/themes/original/src/components/BusinessPreorder/index.tsx +3 -4
- package/themes/original/src/components/BusinessProductsCategories/index.tsx +1 -1
- package/themes/original/src/components/BusinessProductsList/index.tsx +2 -2
- package/themes/original/src/components/BusinessProductsList/styles.tsx +0 -3
- package/themes/original/src/components/BusinessProductsListing/index.tsx +43 -19
- package/themes/original/src/components/BusinessProductsListing/styles.tsx +3 -4
- package/themes/original/src/components/BusinessReviews/index.tsx +1 -1
- package/themes/original/src/components/BusinessesListing/Layout/Appointment/index.tsx +1 -1
- package/themes/original/src/components/BusinessesListing/Layout/Appointment/styles.tsx +5 -5
- package/themes/original/src/components/BusinessesListing/Layout/Original/FlatListBusinessListFooter.tsx +69 -0
- package/themes/original/src/components/BusinessesListing/Layout/Original/FlatListBusinessListHeader.tsx +406 -0
- package/themes/original/src/components/BusinessesListing/Layout/Original/FlatListBusinessListing.tsx +76 -0
- package/themes/original/src/components/BusinessesListing/Layout/Original/index.tsx +29 -402
- package/themes/original/src/components/BusinessesListing/Layout/Original/styles.tsx +1 -1
- package/themes/original/src/components/BusinessesListing/index.tsx +0 -1
- package/themes/original/src/components/Cart/index.tsx +27 -8
- package/themes/original/src/components/CartContent/index.tsx +61 -39
- package/themes/original/src/components/CartStoresListing/styles.tsx +2 -2
- package/themes/original/src/components/Checkout/index.tsx +199 -55
- package/themes/original/src/components/Checkout/styles.tsx +17 -0
- package/themes/original/src/components/CitiesControl/styles.tsx +1 -1
- package/themes/original/src/components/DatePicker/index.tsx +17 -0
- package/themes/original/src/components/DatePicker/styles.tsx +20 -0
- package/themes/original/src/components/Favorite/index.tsx +4 -9
- package/themes/original/src/components/Favorite/styles.tsx +0 -2
- package/themes/original/src/components/FloatingButton/styles.tsx +1 -1
- package/themes/original/src/components/GPSButton/index.tsx +1 -1
- package/themes/original/src/components/GiftCard/GiftCardUI/index.tsx +8 -3
- package/themes/original/src/components/GiftCard/PurchaseGiftCard/index.tsx +36 -3
- package/themes/original/src/components/GiftCard/PurchaseGiftCard/styles.tsx +1 -1
- package/themes/original/src/components/GiftCard/RedeemGiftCard/index.tsx +67 -4
- package/themes/original/src/components/GiftCard/RedeemGiftCard/styles.tsx +1 -1
- package/themes/original/src/components/GiftCard/SendGiftCard/index.tsx +2 -2
- package/themes/original/src/components/GiftCard/SendGiftCard/styles.tsx +1 -1
- package/themes/original/src/components/GoogleMap/index.tsx +50 -5
- package/themes/original/src/components/HighestRatedBusinesses/index.tsx +2 -2
- package/themes/original/src/components/HighestRatedBusinesses/styles.tsx +1 -1
- package/themes/original/src/components/Home/index.tsx +1 -1
- package/themes/original/src/components/LastOrder/index.tsx +2 -1
- package/themes/original/src/components/LastOrders/index.tsx +2 -1
- package/themes/original/src/components/LoginForm/Otp/index.tsx +53 -47
- package/themes/original/src/components/LoginForm/index.tsx +6 -1
- package/themes/original/src/components/Messages/index.tsx +9 -4
- package/themes/original/src/components/Messages/styles.tsx +1 -1
- package/themes/original/src/components/MomentOption/index.tsx +4 -4
- package/themes/original/src/components/MomentSelector/index.tsx +1 -1
- package/themes/original/src/components/MultiCart/index.tsx +1 -1
- package/themes/original/src/components/MultiCartsPaymethodsAndWallets/index.tsx +13 -4
- package/themes/original/src/components/MultiCheckout/index.tsx +184 -51
- package/themes/original/src/components/MultiOrdersDetails/index.tsx +1 -1
- package/themes/original/src/components/MyOrders/index.tsx +5 -5
- package/themes/original/src/components/NavBar/index.tsx +3 -1
- package/themes/original/src/components/NetworkError/index.tsx +2 -3
- package/themes/original/src/components/NetworkError/styles.tsx +2 -2
- package/themes/original/src/components/Notifications/index.tsx +4 -8
- package/themes/original/src/components/Notifications/styles.tsx +0 -1
- package/themes/original/src/components/OrderDetails/OrderHistory.tsx +7 -3
- package/themes/original/src/components/OrderDetails/index.tsx +716 -667
- package/themes/original/src/components/OrderDetails/styles.tsx +24 -8
- package/themes/original/src/components/OrderProgress/index.tsx +7 -7
- package/themes/original/src/components/OrderProgress/styles.tsx +1 -1
- package/themes/original/src/components/OrderSummary/index.tsx +5 -3
- package/themes/original/src/components/OrderTypeSelector/index.tsx +5 -6
- package/themes/original/src/components/OrdersOption/PreviousBusinessOrdered/styles.tsx +1 -1
- package/themes/original/src/components/OrdersOption/PreviousProductsOrdered/styles.tsx +1 -1
- package/themes/original/src/components/OrdersOption/index.tsx +4 -3
- package/themes/original/src/components/OrdersOption/styles.tsx +1 -1
- package/themes/original/src/components/PageBanner/index.tsx +3 -0
- package/themes/original/src/components/PaymentOptionStripe/styles.tsx +3 -0
- package/themes/original/src/components/PaymentOptionWallet/index.tsx +56 -56
- package/themes/original/src/components/PaymentOptions/index.tsx +41 -32
- package/themes/original/src/components/PhoneInputNumber/index.tsx +15 -1
- package/themes/original/src/components/ProductForm/ActionButton.tsx +120 -0
- package/themes/original/src/components/ProductForm/ExtraOptions.tsx +56 -0
- package/themes/original/src/components/ProductForm/index.tsx +81 -167
- package/themes/original/src/components/ProductForm/styles.tsx +1 -1
- package/themes/original/src/components/ProductItemAccordion/index.tsx +5 -0
- package/themes/original/src/components/ProductOptionSubOption/index.tsx +120 -79
- package/themes/original/src/components/ProductOptionSubOption/styles.tsx +10 -9
- package/themes/original/src/components/ProfessionalProfile/styles.tsx +3 -3
- package/themes/original/src/components/Promotions/index.tsx +4 -4
- package/themes/original/src/components/Promotions/styles.tsx +0 -2
- package/themes/original/src/components/ReviewDriver/styles.tsx +1 -1
- package/themes/original/src/components/ReviewOrder/styles.tsx +1 -1
- package/themes/original/src/components/ReviewProducts/styles.tsx +1 -1
- package/themes/original/src/components/ServiceForm/index.tsx +2 -2
- package/themes/original/src/components/ServiceForm/styles.tsx +4 -4
- package/themes/original/src/components/SingleOrderCard/index.tsx +4 -3
- package/themes/original/src/components/SingleProductCard/styles.tsx +0 -3
- package/themes/original/src/components/StripeCardsList/index.tsx +53 -7
- package/themes/original/src/components/StripeElementsForm/index.tsx +1 -1
- package/themes/original/src/components/StripeElementsForm/naked.tsx +12 -1
- package/themes/original/src/components/UpsellingProducts/UpsellingContent.tsx +170 -0
- package/themes/original/src/components/UpsellingProducts/UpsellingLayout.tsx +86 -0
- package/themes/original/src/components/UpsellingProducts/index.tsx +15 -199
- package/themes/original/src/components/UpsellingProducts/styles.tsx +19 -0
- package/themes/original/src/components/UserFormDetails/index.tsx +53 -7
- package/themes/original/src/components/UserProfile/index.tsx +1 -1
- package/themes/original/src/components/UserProfileForm/index.tsx +30 -36
- package/themes/original/src/components/UserVerification/index.tsx +55 -50
- package/themes/original/src/components/WalletTransactions/styles.tsx +1 -0
- package/themes/original/src/components/Wallets/index.tsx +8 -9
- package/themes/original/src/components/Wallets/styles.tsx +1 -1
- package/themes/original/src/components/shared/HeaderTitle.tsx +1 -1
- package/themes/original/src/components/shared/OInput.tsx +1 -4
- package/themes/original/src/components/shared/OModal.tsx +12 -14
- package/themes/original/src/layouts/Container.tsx +5 -3
- package/themes/original/src/types/index.tsx +10 -2
- package/themes/original/src/utils/index.tsx +124 -0
- package/themes/uber-eats/src/components/BusinessesListing/index.tsx +1 -1
- package/src/navigators/BottomNavigator.tsx +0 -117
- package/src/navigators/CheckoutNavigator.tsx +0 -66
- package/src/navigators/HomeNavigator.tsx +0 -202
- package/src/navigators/NavigationRef.tsx +0 -7
- package/src/navigators/RootNavigator.tsx +0 -269
- package/src/pages/Account.tsx +0 -34
- package/src/pages/AddressForm.tsx +0 -62
- package/src/pages/AddressList.tsx +0 -24
- package/src/pages/BusinessProductsList.tsx +0 -81
- package/src/pages/BusinessesListing.tsx +0 -43
- package/src/pages/CartList.tsx +0 -49
- package/src/pages/Checkout.tsx +0 -101
- package/src/pages/ForgotPassword.tsx +0 -24
- package/src/pages/Help.tsx +0 -23
- package/src/pages/HelpAccountAndPayment.tsx +0 -23
- package/src/pages/HelpGuide.tsx +0 -23
- package/src/pages/HelpOrder.tsx +0 -23
- package/src/pages/Home.tsx +0 -36
- package/src/pages/IntroductoryTutorial.tsx +0 -170
- package/src/pages/Login.tsx +0 -47
- package/src/pages/MomentOption.tsx +0 -30
- package/src/pages/MultiCheckout.tsx +0 -31
- package/src/pages/MultiOrdersDetails.tsx +0 -27
- package/src/pages/MyOrders.tsx +0 -40
- package/src/pages/NetworkError.tsx +0 -24
- package/src/pages/NotFound.tsx +0 -22
- package/src/pages/OrderDetails.tsx +0 -25
- package/src/pages/ProductDetails.tsx +0 -55
- package/src/pages/Profile.tsx +0 -36
- package/src/pages/ReviewDriver.tsx +0 -30
- package/src/pages/ReviewOrder.tsx +0 -32
- package/src/pages/ReviewProducts.tsx +0 -30
- package/src/pages/Sessions.tsx +0 -22
- package/src/pages/Signup.tsx +0 -53
- package/src/pages/SpinnerLoader.tsx +0 -10
- package/src/pages/Splash.tsx +0 -21
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import React from 'react'
|
|
2
|
+
import { View } from 'react-native'
|
|
3
|
+
import { useTheme } from 'styled-components/native'
|
|
4
|
+
import { OButton } from '../shared';
|
|
5
|
+
import { useLanguage, useConfig } from 'ordering-components/native'
|
|
6
|
+
import { OrderItem } from './OrderItem';
|
|
7
|
+
import { AcceptOrRejectOrder as AcceptOrRejectOrderStyle } from './styles';
|
|
8
|
+
|
|
9
|
+
function OrderListPropsAreEqual(prevProps: any, nextProps: any) {
|
|
10
|
+
return JSON.stringify(prevProps.order) === JSON.stringify(nextProps.order) &&
|
|
11
|
+
JSON.stringify(prevProps._order) === JSON.stringify(nextProps._order) &&
|
|
12
|
+
JSON.stringify(prevProps.currentOrdenSelected) === JSON.stringify(nextProps.currentOrdenSelected) &&
|
|
13
|
+
prevProps.currentTabSelected === nextProps.currentTabSelected
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export const OrdersList = React.memo((props: any) => {
|
|
17
|
+
const {
|
|
18
|
+
order,
|
|
19
|
+
_order,
|
|
20
|
+
hideBtns,
|
|
21
|
+
currentOrdenSelected,
|
|
22
|
+
isLogisticOrder,
|
|
23
|
+
handlePressOrder,
|
|
24
|
+
currentTabSelected,
|
|
25
|
+
getOrderStatus,
|
|
26
|
+
handleClickLogisticOrder
|
|
27
|
+
} = props
|
|
28
|
+
|
|
29
|
+
const theme = useTheme()
|
|
30
|
+
const [, t] = useLanguage()
|
|
31
|
+
const [{ configs }] = useConfig();
|
|
32
|
+
|
|
33
|
+
const isHideRejectButtons = configs?.reject_orders_enabled && configs?.reject_orders_enabled?.value !== '1'
|
|
34
|
+
|
|
35
|
+
return (
|
|
36
|
+
<View
|
|
37
|
+
style={{
|
|
38
|
+
backgroundColor: currentOrdenSelected === order?.id ? theme.colors.gray100 : order?.locked && isLogisticOrder ? '#ccc' : '#fff',
|
|
39
|
+
marginBottom: isLogisticOrder ? 10 : 0
|
|
40
|
+
}}
|
|
41
|
+
>
|
|
42
|
+
<OrderItem
|
|
43
|
+
order={order}
|
|
44
|
+
_order={_order}
|
|
45
|
+
isLogisticOrder={isLogisticOrder}
|
|
46
|
+
handlePressOrder={handlePressOrder}
|
|
47
|
+
currentTabSelected={currentTabSelected}
|
|
48
|
+
getOrderStatus={getOrderStatus}
|
|
49
|
+
/>
|
|
50
|
+
{isLogisticOrder && !hideBtns && (
|
|
51
|
+
<AcceptOrRejectOrderStyle>
|
|
52
|
+
{!!order?.order_group_id && !!order?.order_group ? (
|
|
53
|
+
<OButton
|
|
54
|
+
text={t('VIEW_ORDER', 'View order')}
|
|
55
|
+
onClick={() => handlePressOrder({ ...order, logistic_order_id: _order?.id })}
|
|
56
|
+
bgColor={theme.colors.blueLight}
|
|
57
|
+
borderColor={theme.colors.blueLight}
|
|
58
|
+
imgRightSrc={null}
|
|
59
|
+
style={{ borderRadius: 7, height: 40 }}
|
|
60
|
+
parentStyle={{ width: '100%' }}
|
|
61
|
+
textStyle={{ color: theme?.colors?.white }}
|
|
62
|
+
/>
|
|
63
|
+
) : (
|
|
64
|
+
<>
|
|
65
|
+
{!isHideRejectButtons && (
|
|
66
|
+
<OButton
|
|
67
|
+
text={t('REJECT', 'Reject')}
|
|
68
|
+
onClick={() => handleClickLogisticOrder(2, _order?.id)}
|
|
69
|
+
bgColor={theme.colors.red}
|
|
70
|
+
borderColor={theme.colors.red}
|
|
71
|
+
imgRightSrc={null}
|
|
72
|
+
style={{ borderRadius: 7, height: 40 }}
|
|
73
|
+
parentStyle={{ width: '45%' }}
|
|
74
|
+
textStyle={{ color: theme.colors.white }}
|
|
75
|
+
/>
|
|
76
|
+
)}
|
|
77
|
+
<OButton
|
|
78
|
+
text={t('ACCEPT', 'Accept')}
|
|
79
|
+
onClick={() => handleClickLogisticOrder(1, _order?.id)}
|
|
80
|
+
bgColor={theme.colors.green}
|
|
81
|
+
borderColor={theme.colors.green}
|
|
82
|
+
imgRightSrc={null}
|
|
83
|
+
style={{ borderRadius: 7, height: 40 }}
|
|
84
|
+
parentStyle={{ width: isHideRejectButtons ? '100%' : '45%' }}
|
|
85
|
+
textStyle={{ color: theme.colors.white }}
|
|
86
|
+
/>
|
|
87
|
+
</>
|
|
88
|
+
)}
|
|
89
|
+
</AcceptOrRejectOrderStyle>
|
|
90
|
+
)}
|
|
91
|
+
</View>
|
|
92
|
+
)
|
|
93
|
+
}, OrderListPropsAreEqual)
|
|
@@ -88,7 +88,7 @@ export const OrdersGroupedItem = (props: any) => {
|
|
|
88
88
|
adjustsFontSizeToFit
|
|
89
89
|
>
|
|
90
90
|
{orders[0]?.delivery_datetime_utc
|
|
91
|
-
? parseDate(orders[0]?.delivery_datetime_utc
|
|
91
|
+
? parseDate(orders[0]?.delivery_datetime_utc)
|
|
92
92
|
: parseDate(orders[0]?.delivery_datetime, { utc: false })}
|
|
93
93
|
</OText>
|
|
94
94
|
</View>
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import React, { useState, useEffect } from 'react';
|
|
2
2
|
import { View } from 'react-native';
|
|
3
3
|
import { useTheme } from 'styled-components/native';
|
|
4
|
-
import { useLanguage } from 'ordering-components/native';
|
|
4
|
+
import { useLanguage, useConfig } from 'ordering-components/native';
|
|
5
5
|
|
|
6
|
-
import {AcceptOrRejectOrder as AcceptOrRejectOrderStyle } from './styles';
|
|
6
|
+
import { AcceptOrRejectOrder as AcceptOrRejectOrderStyle } from './styles';
|
|
7
7
|
|
|
8
8
|
import { OButton, OModal } from '../shared';
|
|
9
|
-
import { OrderItem } from './OrderItem'
|
|
10
9
|
import { OrdersGroupedItem } from './OrdersGroupedItem'
|
|
10
|
+
import { OrdersList } from './OrderList';
|
|
11
11
|
import { AcceptOrRejectOrder } from '../AcceptOrRejectOrder';
|
|
12
12
|
import { ReviewCustomer } from '../ReviewCustomer';
|
|
13
13
|
import { GoogleMap } from '../GoogleMap';
|
|
@@ -24,14 +24,17 @@ export const PreviousOrders = (props: any) => {
|
|
|
24
24
|
currentTabSelected,
|
|
25
25
|
currentOrdenSelected,
|
|
26
26
|
handleChangeOrderStatus,
|
|
27
|
-
handleSendCustomerReview
|
|
27
|
+
handleSendCustomerReview,
|
|
28
|
+
isBusinessApp
|
|
28
29
|
} = props;
|
|
29
30
|
|
|
30
31
|
let hash: any = {};
|
|
31
32
|
const [, t] = useLanguage();
|
|
32
33
|
const theme = useTheme();
|
|
34
|
+
const [{ configs }] = useConfig();
|
|
33
35
|
|
|
34
|
-
|
|
36
|
+
|
|
37
|
+
// const [, setCurrentTime] = useState()
|
|
35
38
|
const [openModal, setOpenModal] = useState(false)
|
|
36
39
|
const [openReviewModal, setOpenReviewModal] = useState({ order: null, ids: [], customerId: null })
|
|
37
40
|
const [openMapViewModal, setOpenMapViewModal] = useState<any>({ open: false, customerLocation: null, locations: [] })
|
|
@@ -41,6 +44,7 @@ export const PreviousOrders = (props: any) => {
|
|
|
41
44
|
const viewMapStatus = [9, 18, 19, 23]
|
|
42
45
|
const deliveryPickupBtn = props.appTitle?.text?.includes('Delivery') && [3, 8, 18]
|
|
43
46
|
const deliveryStatusCompleteBtn = props.appTitle?.text?.includes('Delivery') && [9, 19, 23]
|
|
47
|
+
const isHideRejectButtons = configs?.reject_orders_enabled && configs?.reject_orders_enabled?.value !== '1' && !isBusinessApp
|
|
44
48
|
|
|
45
49
|
const handlePressOrder = (order: any) => {
|
|
46
50
|
if (order?.locked && isLogisticOrder) return
|
|
@@ -48,9 +52,9 @@ export const PreviousOrders = (props: any) => {
|
|
|
48
52
|
if (props.handleClickEvent) {
|
|
49
53
|
props.handleClickEvent({ ...order, isLogistic: isLogisticOrder })
|
|
50
54
|
} else {
|
|
51
|
-
if (isLogisticOrder){
|
|
55
|
+
if (isLogisticOrder) {
|
|
52
56
|
onNavigationRedirect &&
|
|
53
|
-
|
|
57
|
+
onNavigationRedirect('OrderDetailsLogistic', { order: { ...order, isLogistic: isLogisticOrder }, handleClickLogisticOrder });
|
|
54
58
|
} else {
|
|
55
59
|
onNavigationRedirect &&
|
|
56
60
|
onNavigationRedirect('OrderDetails', { order });
|
|
@@ -58,73 +62,13 @@ export const PreviousOrders = (props: any) => {
|
|
|
58
62
|
}
|
|
59
63
|
};
|
|
60
64
|
|
|
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
|
-
}
|
|
120
|
-
|
|
121
65
|
const ordersGroupAction = (param1 = '', param2 = '', { order, action, body, ids }: any = {}) => {
|
|
122
66
|
setOrderUpdateStatus({ ...orderUpdateStatus, action, ids, body, order })
|
|
123
67
|
if (!param1) setOpenModal(true)
|
|
124
68
|
if (param1) {
|
|
125
69
|
setOpenModal(false)
|
|
126
70
|
handleChangeOrderStatus &&
|
|
127
|
-
|
|
71
|
+
handleChangeOrderStatus(param1, orderUpdateStatus.ids, param2)
|
|
128
72
|
}
|
|
129
73
|
}
|
|
130
74
|
|
|
@@ -159,7 +103,7 @@ export const PreviousOrders = (props: any) => {
|
|
|
159
103
|
if (_order?.customer?.location) {
|
|
160
104
|
locations.push({
|
|
161
105
|
..._order?.customer?.location,
|
|
162
|
-
title: _order?.customer?.name ??
|
|
106
|
+
title: _order?.customer?.name ?? t('CUSTOMER', 'Customer'),
|
|
163
107
|
address: {
|
|
164
108
|
addressName: _order?.customer?.address,
|
|
165
109
|
zipcode: _order?.customer?.zipcode
|
|
@@ -180,14 +124,14 @@ export const PreviousOrders = (props: any) => {
|
|
|
180
124
|
})
|
|
181
125
|
}
|
|
182
126
|
|
|
183
|
-
useEffect(() => {
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
127
|
+
// useEffect(() => {
|
|
128
|
+
// const interval = setInterval(() => {
|
|
129
|
+
// const date: any = Date.now()
|
|
130
|
+
// setCurrentTime(date)
|
|
131
|
+
// }, slaSettingTime ?? 6000)
|
|
188
132
|
|
|
189
|
-
|
|
190
|
-
}, [])
|
|
133
|
+
// return () => clearInterval(interval)
|
|
134
|
+
// }, [])
|
|
191
135
|
|
|
192
136
|
|
|
193
137
|
return (
|
|
@@ -210,35 +154,48 @@ export const PreviousOrders = (props: any) => {
|
|
|
210
154
|
?.map((_order: any) => {
|
|
211
155
|
const order_ = _order?.isLogistic && !_order?.order_group && isLogisticOrder ? _order?.order : _order
|
|
212
156
|
return (
|
|
213
|
-
<OrdersList
|
|
157
|
+
<OrdersList
|
|
158
|
+
key={order_.id}
|
|
159
|
+
order={order_}
|
|
160
|
+
_order={_order}
|
|
161
|
+
hideBtns
|
|
162
|
+
currentOrdenSelected={currentOrdenSelected}
|
|
163
|
+
isLogisticOrder={isLogisticOrder}
|
|
164
|
+
handlePressOrder={handlePressOrder}
|
|
165
|
+
currentTabSelected={currentTabSelected}
|
|
166
|
+
getOrderStatus={getOrderStatus}
|
|
167
|
+
handleClickLogisticOrder={handleClickLogisticOrder}
|
|
168
|
+
/>
|
|
214
169
|
)
|
|
215
170
|
}
|
|
216
|
-
|
|
171
|
+
)
|
|
217
172
|
}
|
|
218
173
|
{_ordersGrouped[k][0]?.status === 0 && (
|
|
219
174
|
<AcceptOrRejectOrderStyle>
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
175
|
+
{!isHideRejectButtons && (
|
|
176
|
+
<OButton
|
|
177
|
+
text={t('REJECT_ALL', 'Reject all')}
|
|
178
|
+
bgColor={theme.colors.danger100}
|
|
179
|
+
borderColor={theme.colors.danger100}
|
|
180
|
+
imgRightSrc={null}
|
|
181
|
+
style={{ borderRadius: 7, height: 40 }}
|
|
182
|
+
parentStyle={{ width: '45%' }}
|
|
183
|
+
textStyle={{ color: theme.colors.danger500, fontSize: 12 }}
|
|
184
|
+
onClick={() => onNavigationRedirect('AcceptOrRejectOrder', {
|
|
185
|
+
action: 'reject',
|
|
186
|
+
order: _ordersGrouped[k][0],
|
|
187
|
+
ids: _ordersGrouped[k].map((o: any) => o.id),
|
|
188
|
+
handleChangeOrderStatus
|
|
189
|
+
})}
|
|
190
|
+
/>
|
|
191
|
+
)}
|
|
235
192
|
<OButton
|
|
236
193
|
text={t('ACCEPT_ALL', 'Accept all')}
|
|
237
194
|
bgColor={theme.colors.success100}
|
|
238
195
|
borderColor={theme.colors.success100}
|
|
239
196
|
imgRightSrc={null}
|
|
240
197
|
style={{ borderRadius: 7, height: 40 }}
|
|
241
|
-
parentStyle={{ width: '45%' }}
|
|
198
|
+
parentStyle={{ width: isHideRejectButtons ? '100%' : '45%' }}
|
|
242
199
|
textStyle={{ color: theme.colors.success500, fontSize: 12 }}
|
|
243
200
|
onClick={() => onNavigationRedirect('AcceptOrRejectOrder', {
|
|
244
201
|
action: 'accept',
|
|
@@ -268,133 +225,137 @@ export const PreviousOrders = (props: any) => {
|
|
|
268
225
|
)}
|
|
269
226
|
{(_ordersGrouped[k][0]?.status === 8 || _ordersGrouped[k][0]?.status === 18) &&
|
|
270
227
|
_ordersGrouped[k][0]?.delivery_type === 1 &&
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
{_ordersGrouped[k][0]?.status === 3 && _ordersGrouped[k][0]?.delivery_type === 1 &&
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
228
|
+
(
|
|
229
|
+
<AcceptOrRejectOrderStyle>
|
|
230
|
+
<OButton
|
|
231
|
+
text={t('ARRIVED_TO_BUSINESS', 'Arrived to bussiness')}
|
|
232
|
+
bgColor={theme.colors.btnBGWhite}
|
|
233
|
+
borderColor={theme.colors.btnBGWhite}
|
|
234
|
+
imgRightSrc={null}
|
|
235
|
+
style={{ borderRadius: 7, height: 40 }}
|
|
236
|
+
parentStyle={{ width: '100%' }}
|
|
237
|
+
textStyle={{ color: theme.colors.primary, fontSize: 12 }}
|
|
238
|
+
onClick={() => handleChangeOrderStatus(
|
|
239
|
+
3,
|
|
240
|
+
_ordersGrouped[k].map((o: any) => o.id),
|
|
241
|
+
)}
|
|
242
|
+
/>
|
|
243
|
+
</AcceptOrRejectOrderStyle>
|
|
244
|
+
)}
|
|
245
|
+
{_ordersGrouped[k][0]?.status === 3 && _ordersGrouped[k][0]?.delivery_type === 1 && !isHideRejectButtons &&
|
|
246
|
+
(
|
|
247
|
+
<AcceptOrRejectOrderStyle>
|
|
248
|
+
<OButton
|
|
249
|
+
text={t('ORDER_NOT_READY', 'Order not ready')}
|
|
250
|
+
bgColor={theme.colors.red}
|
|
251
|
+
borderColor={theme.colors.red}
|
|
252
|
+
imgRightSrc={null}
|
|
253
|
+
style={{ borderRadius: 7, height: 40 }}
|
|
254
|
+
parentStyle={{ width: '100%' }}
|
|
255
|
+
textStyle={{ color: theme.colors.white, fontSize: 12 }}
|
|
256
|
+
onClick={() => onNavigationRedirect('AcceptOrRejectOrder', {
|
|
257
|
+
action: 'notReady',
|
|
258
|
+
order: _ordersGrouped[k][0],
|
|
259
|
+
ids: _ordersGrouped[k].map((o: any) => o.id),
|
|
260
|
+
handleChangeOrderStatus
|
|
261
|
+
})}
|
|
262
|
+
/>
|
|
263
|
+
</AcceptOrRejectOrderStyle>
|
|
264
|
+
)}
|
|
308
265
|
{viewMapStatus.includes(_ordersGrouped[k][0]?.status) &&
|
|
309
266
|
props.appTitle?.text?.includes('Business') &&
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
267
|
+
(
|
|
268
|
+
<View>
|
|
269
|
+
<OButton
|
|
270
|
+
text={t('TRACK_REAL_TIME_POSITION', 'Track real time position')}
|
|
271
|
+
bgColor={theme.colors.primaryLight}
|
|
272
|
+
borderColor={theme.colors.primaryLight}
|
|
273
|
+
imgRightSrc={null}
|
|
274
|
+
style={{ borderRadius: 7, height: 40 }}
|
|
275
|
+
parentStyle={{ width: '100%' }}
|
|
276
|
+
textStyle={{ color: theme.colors.primary, fontSize: 12 }}
|
|
277
|
+
onClick={() => handleOpenMapView({ orders: _ordersGrouped[k] })}
|
|
278
|
+
/>
|
|
279
|
+
</View>
|
|
280
|
+
)}
|
|
324
281
|
{_ordersGrouped[k][0]?.status === 4 &&
|
|
325
282
|
![1].includes(_ordersGrouped[k][0]?.delivery_type) &&
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
283
|
+
(
|
|
284
|
+
<AcceptOrRejectOrderStyle>
|
|
285
|
+
{!isHideRejectButtons && (
|
|
286
|
+
<OButton
|
|
287
|
+
text={t('ORDER_NOT_PICKEDUP_BY_CUSTOMER', 'Order not picked up by customer')}
|
|
288
|
+
bgColor={theme.colors.danger100}
|
|
289
|
+
borderColor={theme.colors.danger100}
|
|
290
|
+
imgRightSrc={null}
|
|
291
|
+
style={{ borderRadius: 7, height: 40, paddingLeft: 10, paddingRight: 10 }}
|
|
292
|
+
parentStyle={{ width: '45%' }}
|
|
293
|
+
textStyle={{ color: theme.colors.danger500, fontSize: 12, textAlign: 'center' }}
|
|
294
|
+
onClick={() => handleChangeOrderStatus(
|
|
295
|
+
17,
|
|
296
|
+
_ordersGrouped[k].map((o: any) => o.id),
|
|
297
|
+
)}
|
|
298
|
+
/>
|
|
339
299
|
)}
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
)}
|
|
300
|
+
<OButton
|
|
301
|
+
text={t('PICKUP_COMPLETED_BY_CUSTOMER', 'Pickup completed by customer')}
|
|
302
|
+
bgColor={theme.colors.success100}
|
|
303
|
+
borderColor={theme.colors.success100}
|
|
304
|
+
imgRightSrc={null}
|
|
305
|
+
style={{ borderRadius: 7, height: 40, paddingLeft: 10, paddingRight: 10 }}
|
|
306
|
+
parentStyle={{ width: isHideRejectButtons ? '100%' : '45%' }}
|
|
307
|
+
textStyle={{ color: theme.colors.success500, fontSize: 12, textAlign: 'center' }}
|
|
308
|
+
onClick={() => handleChangeOrderStatus(
|
|
309
|
+
15,
|
|
310
|
+
_ordersGrouped[k].map((o: any) => o.id),
|
|
311
|
+
)}
|
|
312
|
+
/>
|
|
313
|
+
</AcceptOrRejectOrderStyle>
|
|
314
|
+
)}
|
|
356
315
|
{!_ordersGrouped[k][0]?.user_review &&
|
|
357
316
|
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>
|
|
317
|
+
(
|
|
376
318
|
<OButton
|
|
377
|
-
text={t('
|
|
378
|
-
bgColor={theme.colors.
|
|
379
|
-
borderColor={theme.colors.
|
|
319
|
+
text={t('REVIEW_CUSTOMER', 'Review customer')}
|
|
320
|
+
bgColor={theme.colors.primary}
|
|
321
|
+
borderColor={theme.colors.primary}
|
|
380
322
|
imgRightSrc={null}
|
|
381
|
-
style={{ borderRadius:
|
|
382
|
-
parentStyle={{ width: '
|
|
383
|
-
textStyle={{ color: theme.colors.
|
|
384
|
-
onClick={() =>
|
|
385
|
-
action: 'pickupFailed',
|
|
323
|
+
style={{ borderRadius: 8, height: 40 }}
|
|
324
|
+
parentStyle={{ width: '100%' }}
|
|
325
|
+
textStyle={{ color: theme.colors.white }}
|
|
326
|
+
onClick={() => setOpenReviewModal({
|
|
386
327
|
order: _ordersGrouped[k][0],
|
|
387
|
-
|
|
388
|
-
|
|
328
|
+
customerId: _ordersGrouped[k][0]?.customer_id,
|
|
329
|
+
ids: _ordersGrouped[k].map((o: any) => o.id)
|
|
389
330
|
})}
|
|
390
331
|
/>
|
|
332
|
+
)}
|
|
333
|
+
{!!deliveryPickupBtn && deliveryPickupBtn?.includes(_ordersGrouped[k][0]?.status) && (
|
|
334
|
+
<AcceptOrRejectOrderStyle>
|
|
335
|
+
{!isHideRejectButtons && (
|
|
336
|
+
<OButton
|
|
337
|
+
text={t('PICKUP_FAILED', 'Pickup failed')}
|
|
338
|
+
bgColor={theme.colors.danger100}
|
|
339
|
+
borderColor={theme.colors.danger100}
|
|
340
|
+
imgRightSrc={null}
|
|
341
|
+
style={{ borderRadius: 7, height: 40, paddingLeft: 10, paddingRight: 10 }}
|
|
342
|
+
parentStyle={{ width: '45%' }}
|
|
343
|
+
textStyle={{ color: theme.colors.danger500, fontSize: 12, textAlign: 'center' }}
|
|
344
|
+
onClick={() => onNavigationRedirect('AcceptOrRejectOrder', {
|
|
345
|
+
action: 'pickupFailed',
|
|
346
|
+
order: _ordersGrouped[k][0],
|
|
347
|
+
ids: _ordersGrouped[k].map((o: any) => o.id),
|
|
348
|
+
handleChangeOrderStatus
|
|
349
|
+
})}
|
|
350
|
+
/>
|
|
351
|
+
)}
|
|
391
352
|
<OButton
|
|
392
353
|
text={t('PICKUP_COMPLETE', 'Pickup complete')}
|
|
393
354
|
bgColor={theme.colors.success100}
|
|
394
355
|
borderColor={theme.colors.success100}
|
|
395
356
|
imgRightSrc={null}
|
|
396
357
|
style={{ borderRadius: 7, height: 40, paddingLeft: 10, paddingRight: 10 }}
|
|
397
|
-
parentStyle={{ width: '45%' }}
|
|
358
|
+
parentStyle={{ width: isHideRejectButtons ? '100%' : '45%' }}
|
|
398
359
|
textStyle={{ color: theme.colors.success500, fontSize: 12, textAlign: 'center' }}
|
|
399
360
|
onClick={() => handleChangeOrderStatus(
|
|
400
361
|
9,
|
|
@@ -405,28 +366,30 @@ export const PreviousOrders = (props: any) => {
|
|
|
405
366
|
)}
|
|
406
367
|
{!!deliveryStatusCompleteBtn && deliveryStatusCompleteBtn.includes(_ordersGrouped[k][0]?.status) && (
|
|
407
368
|
<AcceptOrRejectOrderStyle>
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
369
|
+
{!isHideRejectButtons && (
|
|
370
|
+
<OButton
|
|
371
|
+
text={t('DELIVERY_FAILED', 'Delivery Failed')}
|
|
372
|
+
bgColor={theme.colors.danger100}
|
|
373
|
+
borderColor={theme.colors.danger100}
|
|
374
|
+
imgRightSrc={null}
|
|
375
|
+
style={{ borderRadius: 7, height: 40, paddingLeft: 10, paddingRight: 10 }}
|
|
376
|
+
parentStyle={{ width: '45%' }}
|
|
377
|
+
textStyle={{ color: theme.colors.danger500, fontSize: 12, textAlign: 'center' }}
|
|
378
|
+
onClick={() => onNavigationRedirect('AcceptOrRejectOrder', {
|
|
379
|
+
action: 'deliveryFailed',
|
|
380
|
+
order: _ordersGrouped[k][0],
|
|
381
|
+
ids: _ordersGrouped[k].map((o: any) => o.id),
|
|
382
|
+
handleChangeOrderStatus
|
|
383
|
+
})}
|
|
384
|
+
/>
|
|
385
|
+
)}
|
|
423
386
|
<OButton
|
|
424
387
|
text={t('DELIVERY_COMPLETE', 'Delivery complete')}
|
|
425
388
|
bgColor={theme.colors.success100}
|
|
426
389
|
borderColor={theme.colors.success100}
|
|
427
390
|
imgRightSrc={null}
|
|
428
391
|
style={{ borderRadius: 7, height: 40, paddingLeft: 10, paddingRight: 10 }}
|
|
429
|
-
parentStyle={{ width: '45%' }}
|
|
392
|
+
parentStyle={{ width: isHideRejectButtons ? '100%' : '45%' }}
|
|
430
393
|
textStyle={{ color: theme.colors.success500, fontSize: 12, textAlign: 'center' }}
|
|
431
394
|
onClick={() => handleChangeOrderStatus(
|
|
432
395
|
11,
|
|
@@ -440,7 +403,16 @@ export const PreviousOrders = (props: any) => {
|
|
|
440
403
|
</View>
|
|
441
404
|
) : (
|
|
442
405
|
<View key={order.id}>
|
|
443
|
-
<OrdersList
|
|
406
|
+
<OrdersList
|
|
407
|
+
order={order}
|
|
408
|
+
_order={_order}
|
|
409
|
+
currentOrdenSelected={currentOrdenSelected}
|
|
410
|
+
isLogisticOrder={isLogisticOrder}
|
|
411
|
+
handlePressOrder={handlePressOrder}
|
|
412
|
+
currentTabSelected={currentTabSelected}
|
|
413
|
+
getOrderStatus={getOrderStatus}
|
|
414
|
+
handleClickLogisticOrder={handleClickLogisticOrder}
|
|
415
|
+
/>
|
|
444
416
|
</View>
|
|
445
417
|
)
|
|
446
418
|
)
|