ordering-ui-react-native 0.21.90 → 0.21.91-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 -7
- package/src/DeliveryApp.tsx +43 -1
- package/src/components/BusinessesListing/index.tsx +1 -1
- package/src/components/StripeMethodForm/index.tsx +6 -4
- package/src/components/VerifyPhone/styles.tsx +1 -2
- package/src/context/OfflineActions/index.tsx +236 -0
- package/src/types/index.tsx +3 -1
- package/themes/business/index.tsx +2 -0
- package/themes/business/src/components/AcceptOrRejectOrder/index.tsx +9 -6
- package/themes/business/src/components/AcceptOrRejectOrder/styles.tsx +1 -0
- package/themes/business/src/components/BusinessController/index.tsx +8 -3
- package/themes/business/src/components/BusinessProductList/index.tsx +2 -1
- package/themes/business/src/components/Chat/index.tsx +14 -3
- package/themes/business/src/components/DriverMap/index.tsx +49 -27
- package/themes/business/src/components/GoogleMap/index.tsx +15 -8
- package/themes/business/src/components/Home/index.tsx +5 -1
- package/themes/business/src/components/LanguageSelector/index.tsx +2 -3
- package/themes/business/src/components/LanguageSelector/lang_country.json +515 -70
- package/themes/business/src/components/LogoutButton/index.tsx +1 -1
- package/themes/business/src/components/MapView/index.tsx +36 -17
- package/themes/business/src/components/NewOrderNotification/index.tsx +69 -33
- package/themes/business/src/components/OrderDetails/Business.tsx +74 -9
- package/themes/business/src/components/OrderDetails/Delivery.tsx +131 -51
- package/themes/business/src/components/OrderDetails/OrderContentComponent.tsx +125 -43
- package/themes/business/src/components/OrderDetails/OrderHeaderComponent.tsx +62 -24
- package/themes/business/src/components/OrderDetails/styles.tsx +39 -3
- package/themes/business/src/components/OrderDetails/usePrinterCommands.tsx +221 -0
- package/themes/business/src/components/OrderDetailsLogistic/index.tsx +3 -2
- package/themes/business/src/components/OrderSummary/index.tsx +223 -73
- package/themes/business/src/components/OrdersListManager/index.tsx +13 -1
- package/themes/business/src/components/OrdersOption/index.tsx +251 -159
- package/themes/business/src/components/PhoneInputNumber/index.tsx +8 -5
- package/themes/business/src/components/PreviousMessages/index.tsx +26 -3
- package/themes/business/src/components/PreviousOrders/OrderItem.tsx +42 -20
- package/themes/business/src/components/PreviousOrders/index.tsx +76 -66
- package/themes/business/src/components/PrinterEdition/MessageAlert.tsx +33 -0
- package/themes/business/src/components/PrinterEdition/index.tsx +431 -0
- package/themes/business/src/components/PrinterEdition/printerList.tsx +23 -0
- package/themes/business/src/components/PrinterEdition/styles.tsx +61 -0
- package/themes/business/src/components/PrinterSettings/index.tsx +267 -0
- package/themes/business/src/components/PrinterSettings/styles.tsx +30 -0
- package/themes/business/src/components/ReviewCustomer/index.tsx +2 -0
- package/themes/business/src/components/Sessions/index.tsx +1 -1
- package/themes/business/src/components/StoresList/index.tsx +2 -2
- package/themes/business/src/components/UserFormDetails/index.tsx +111 -107
- package/themes/business/src/components/UserProfileForm/index.tsx +43 -25
- package/themes/business/src/components/WebsocketStatus/index.tsx +2 -2
- package/themes/business/src/components/shared/OInput.tsx +2 -0
- package/themes/business/src/components/shared/OTextarea.tsx +8 -9
- package/themes/business/src/hooks/useLocation.tsx +5 -4
- package/themes/business/src/layouts/SafeAreaContainer.tsx +35 -19
- package/themes/business/src/types/index.tsx +14 -4
- package/themes/business/src/utils/index.tsx +25 -1
- 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/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 +11 -0
- package/themes/original/src/components/AddressForm/index.tsx +32 -17
- package/themes/original/src/components/AddressList/index.tsx +8 -7
- package/themes/original/src/components/AnalyticsSegment/index.tsx +6 -6
- package/themes/original/src/components/AppleLogin/index.tsx +4 -4
- package/themes/original/src/components/BusinessBasicInformation/index.tsx +5 -8
- package/themes/original/src/components/BusinessController/index.tsx +12 -7
- package/themes/original/src/components/BusinessItemAccordion/index.tsx +13 -5
- package/themes/original/src/components/BusinessListingSearch/BusinessSearchFooter.tsx +2 -3
- package/themes/original/src/components/BusinessListingSearch/BusinessSearchHeader.tsx +1 -3
- package/themes/original/src/components/BusinessListingSearch/index.tsx +1 -2
- package/themes/original/src/components/BusinessPreorder/index.tsx +20 -15
- package/themes/original/src/components/BusinessProductsList/SubcategoriesComponent/index.tsx +73 -70
- package/themes/original/src/components/BusinessProductsList/index.tsx +6 -7
- package/themes/original/src/components/BusinessProductsList/styles.tsx +0 -3
- package/themes/original/src/components/BusinessProductsListing/index.tsx +18 -6
- package/themes/original/src/components/BusinessTypeFilter/index.tsx +9 -8
- package/themes/original/src/components/BusinessesListing/Layout/Appointment/index.tsx +2 -1
- package/themes/original/src/components/BusinessesListing/Layout/Original/index.tsx +1 -1
- 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 +43 -15
- package/themes/original/src/components/CartContent/index.tsx +2 -4
- package/themes/original/src/components/Checkout/index.tsx +104 -58
- package/themes/original/src/components/CitiesControl/index.tsx +0 -3
- package/themes/original/src/components/CouponControl/index.tsx +1 -3
- package/themes/original/src/components/DriverTips/index.tsx +1 -3
- package/themes/original/src/components/Favorite/index.tsx +1 -5
- package/themes/original/src/components/FavoriteList/index.tsx +0 -1
- package/themes/original/src/components/ForgotPasswordForm/index.tsx +5 -7
- package/themes/original/src/components/GiftCard/GiftCardUI/index.tsx +15 -17
- package/themes/original/src/components/GiftCard/PurchaseGiftCard/index.tsx +3 -7
- package/themes/original/src/components/GiftCard/RedeemGiftCard/index.tsx +24 -32
- package/themes/original/src/components/GiftCard/SendGiftCard/index.tsx +7 -9
- package/themes/original/src/components/GiftCard/VerticalGiftCardOrdersLayout/index.tsx +11 -12
- package/themes/original/src/components/GoogleMap/index.tsx +39 -18
- package/themes/original/src/components/Help/index.tsx +2 -0
- package/themes/original/src/components/HighestRatedBusinesses/index.tsx +1 -1
- package/themes/original/src/components/Home/index.tsx +2 -10
- package/themes/original/src/components/LoginForm/Otp/index.tsx +0 -3
- package/themes/original/src/components/LoginForm/index.tsx +4 -7
- package/themes/original/src/components/MessageListing/index.tsx +2 -1
- package/themes/original/src/components/Messages/index.tsx +29 -17
- package/themes/original/src/components/MomentOption/index.tsx +13 -2
- package/themes/original/src/components/MultiCartsPaymethodsAndWallets/index.tsx +7 -3
- package/themes/original/src/components/MultiCheckout/index.tsx +129 -85
- package/themes/original/src/components/MultiOrdersDetails/index.tsx +2 -1
- package/themes/original/src/components/MyOrders/index.tsx +10 -23
- package/themes/original/src/components/NavBar/index.tsx +7 -4
- package/themes/original/src/components/NetworkError/index.tsx +0 -5
- package/themes/original/src/components/NotFoundSource/index.tsx +0 -3
- package/themes/original/src/components/OrderDetails/OrderEta.tsx +4 -3
- package/themes/original/src/components/OrderDetails/OrderHistory.tsx +13 -10
- package/themes/original/src/components/OrderDetails/index.tsx +42 -19
- package/themes/original/src/components/OrderDetails/styles.tsx +0 -1
- package/themes/original/src/components/OrderProgress/index.tsx +16 -6
- package/themes/original/src/components/OrderSummary/index.tsx +28 -9
- package/themes/original/src/components/OrderTypeSelector/index.tsx +7 -6
- package/themes/original/src/components/OrdersOption/index.tsx +3 -6
- package/themes/original/src/components/PaymentOptionStripe/index.tsx +0 -5
- package/themes/original/src/components/PaymentOptionWallet/index.tsx +56 -56
- package/themes/original/src/components/PaymentOptions/index.tsx +17 -9
- package/themes/original/src/components/PlaceSpot/index.tsx +1 -3
- package/themes/original/src/components/PreviousOrders/index.tsx +1 -2
- package/themes/original/src/components/ProductForm/ActionButton.tsx +17 -20
- package/themes/original/src/components/ProductForm/index.tsx +107 -102
- package/themes/original/src/components/ProductItemAccordion/index.tsx +55 -49
- package/themes/original/src/components/ProductItemAccordion/styles.tsx +3 -4
- package/themes/original/src/components/ProductOptionSubOption/index.tsx +16 -8
- package/themes/original/src/components/ProfessionalProfile/index.tsx +4 -5
- package/themes/original/src/components/Promotions/index.tsx +6 -9
- package/themes/original/src/components/ReviewDriver/index.tsx +1 -1
- package/themes/original/src/components/ReviewOrder/index.tsx +2 -2
- package/themes/original/src/components/ReviewProducts/index.tsx +1 -1
- package/themes/original/src/components/ReviewTrigger/index.tsx +2 -2
- package/themes/original/src/components/ServiceForm/index.tsx +52 -54
- package/themes/original/src/components/Sessions/index.tsx +3 -3
- package/themes/original/src/components/SignupForm/index.tsx +86 -78
- package/themes/original/src/components/SingleOrderCard/index.tsx +6 -4
- package/themes/original/src/components/SingleProductCard/index.tsx +3 -4
- package/themes/original/src/components/SingleProductCard/styles.tsx +0 -3
- package/themes/original/src/components/StripeCardForm/index.tsx +0 -3
- package/themes/original/src/components/StripeCardsList/index.tsx +10 -3
- package/themes/original/src/components/StripeElementsForm/index.tsx +77 -60
- package/themes/original/src/components/StripeElementsForm/naked.tsx +48 -1
- package/themes/original/src/components/StripeRedirectForm/index.tsx +0 -3
- package/themes/original/src/components/TaxInformation/index.tsx +3 -2
- package/themes/original/src/components/UpsellingProducts/UpsellingContent.tsx +10 -7
- package/themes/original/src/components/UpsellingProducts/UpsellingLayout.tsx +8 -3
- package/themes/original/src/components/UserDetails/index.tsx +3 -2
- package/themes/original/src/components/UserFormDetails/index.tsx +154 -130
- package/themes/original/src/components/UserProfile/index.tsx +9 -1
- package/themes/original/src/components/Wallets/index.tsx +6 -3
- package/themes/original/src/components/WebsocketStatus/index.tsx +1 -4
- package/themes/original/src/components/shared/OAlert.tsx +2 -1
- package/themes/original/src/components/shared/OButton.tsx +5 -4
- package/themes/original/src/components/shared/OInput.tsx +4 -8
- package/themes/original/src/components/shared/OModal.tsx +7 -2
- package/themes/original/src/types/index.tsx +5 -1
- package/themes/original/src/utils/index.tsx +30 -1
- package/themes/uber-eats/src/components/BusinessesListing/index.tsx +1 -1
|
@@ -1,12 +1,10 @@
|
|
|
1
|
-
//React & React Native
|
|
2
1
|
import React, { useState, useEffect } from 'react';
|
|
3
2
|
import { StyleSheet, View } from 'react-native';
|
|
4
3
|
|
|
5
|
-
// Thirds
|
|
6
4
|
import { Placeholder, PlaceholderLine, Fade } from 'rn-placeholder';
|
|
7
5
|
import Clipboard from '@react-native-clipboard/clipboard';
|
|
6
|
+
import MCIcon from 'react-native-vector-icons/MaterialCommunityIcons';
|
|
8
7
|
|
|
9
|
-
//OrderingComponent
|
|
10
8
|
import {
|
|
11
9
|
useLanguage,
|
|
12
10
|
OrderDetails as OrderDetailsConTableoller,
|
|
@@ -17,13 +15,12 @@ import {
|
|
|
17
15
|
useConfig
|
|
18
16
|
} from 'ordering-components/native';
|
|
19
17
|
|
|
20
|
-
//Components
|
|
21
18
|
import Alert from '../../providers/AlertProvider';
|
|
22
19
|
import { AcceptOrRejectOrder } from '../AcceptOrRejectOrder';
|
|
23
20
|
import { Chat } from '../Chat';
|
|
24
21
|
import { FloatingButton } from '../FloatingButton';
|
|
25
22
|
import { DriverMap } from '../DriverMap';
|
|
26
|
-
import { OButton } from '../shared';
|
|
23
|
+
import { OButton, OText } from '../shared';
|
|
27
24
|
import { OModal } from '../shared';
|
|
28
25
|
import { OrderDetailsParams } from '../../types';
|
|
29
26
|
import { USER_TYPE } from '../../config/constants';
|
|
@@ -32,8 +29,8 @@ import { NotFoundSource } from '../NotFoundSource';
|
|
|
32
29
|
import { verifyDecimals, getProductPrice, getOrderStatus } from '../../utils';
|
|
33
30
|
import { OrderHeaderComponent } from './OrderHeaderComponent';
|
|
34
31
|
import { OrderContentComponent } from './OrderContentComponent';
|
|
35
|
-
//Styles
|
|
36
32
|
import { OrderDetailsContainer, Pickup } from './styles';
|
|
33
|
+
import { useOfflineActions } from '../../../../../src/context/OfflineActions';
|
|
37
34
|
|
|
38
35
|
export const OrderDetailsUI = (props: OrderDetailsParams) => {
|
|
39
36
|
const {
|
|
@@ -42,7 +39,6 @@ export const OrderDetailsUI = (props: OrderDetailsParams) => {
|
|
|
42
39
|
setMessages,
|
|
43
40
|
readMessages,
|
|
44
41
|
messagesReadList,
|
|
45
|
-
handleChangeOrderStatus,
|
|
46
42
|
permissions,
|
|
47
43
|
askLocationPermission,
|
|
48
44
|
driverLocation,
|
|
@@ -56,19 +52,25 @@ export const OrderDetailsUI = (props: OrderDetailsParams) => {
|
|
|
56
52
|
forceUpdate,
|
|
57
53
|
getPermissions,
|
|
58
54
|
orderAssingId,
|
|
59
|
-
isGrantedPermissions
|
|
55
|
+
isGrantedPermissions
|
|
60
56
|
} = props;
|
|
57
|
+
|
|
61
58
|
const [, { showToast }] = useToast();
|
|
62
59
|
const [{ parsePrice, parseNumber }] = useUtils();
|
|
63
60
|
const [{ configs }] = useConfig();
|
|
64
61
|
|
|
65
62
|
const { order } = props.order
|
|
66
63
|
|
|
64
|
+
const hideTimer = configs?.hidden_driver_eta_time?.value === '1'
|
|
67
65
|
const isAllowedDriverRejectOrder = configs?.allow_driver_reject_order?.value === '1'
|
|
68
66
|
const isHideRejectButtons = configs?.reject_orders_enabled && configs?.reject_orders_enabled?.value !== '1'
|
|
67
|
+
const isEnabledOrderNotReady = configs?.order_not_ready_enabled?.value === '1'
|
|
68
|
+
const isEnabledFailedPickupDriver = configs?.failed_pickup_by_driver_enabled?.value === '1'
|
|
69
69
|
const theme = useTheme();
|
|
70
70
|
const [, t] = useLanguage();
|
|
71
71
|
const [session] = useSession();
|
|
72
|
+
const [{ isNetConnected, canSaveChangesOffline }, { applyOffAction, registerOffOrder }] = useOfflineActions()
|
|
73
|
+
|
|
72
74
|
const [actionOrder, setActionOrder] = useState('');
|
|
73
75
|
const [unreadAlert, setUnreadAlert] = useState({
|
|
74
76
|
business: false,
|
|
@@ -83,12 +85,16 @@ export const OrderDetailsUI = (props: OrderDetailsParams) => {
|
|
|
83
85
|
key?: string | null;
|
|
84
86
|
}>({ open: false, content: [], key: null });
|
|
85
87
|
|
|
86
|
-
const
|
|
88
|
+
const disabledActionsByInternet = isNetConnected !== null && !isNetConnected && canSaveChangesOffline === false
|
|
89
|
+
|
|
90
|
+
const validStatusComplete = [9, 19, 23, 26]
|
|
87
91
|
|
|
88
92
|
const pendingOrderStatus = [1, 4, 7, 13]
|
|
89
93
|
|
|
90
94
|
const logisticOrderStatus = [4, 6, 7]
|
|
91
95
|
|
|
96
|
+
const deliveryTypes = [1, 7]
|
|
97
|
+
|
|
92
98
|
const showFloatButtonsPickUp: any = {
|
|
93
99
|
8: !isHideRejectButtons,
|
|
94
100
|
3: true,
|
|
@@ -102,13 +108,23 @@ export const OrderDetailsUI = (props: OrderDetailsParams) => {
|
|
|
102
108
|
14: true
|
|
103
109
|
};
|
|
104
110
|
|
|
105
|
-
const
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
111
|
+
const handleChangeOrderStatus = async (status: number) => {
|
|
112
|
+
if (!isNetConnected && canSaveChangesOffline !== false) {
|
|
113
|
+
const result = applyOffAction({
|
|
114
|
+
event: 'evt_off_change_order_status',
|
|
115
|
+
data: { orderId: order?.id, body: { status } }
|
|
116
|
+
})
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
const dataToSave: any = !isNetConnected && canSaveChangesOffline !== false
|
|
120
|
+
? { dataToSave: { status, unsync: true } }
|
|
121
|
+
: null
|
|
122
|
+
const orderUpdated = await props.handleChangeOrderStatus(status, {}, dataToSave)
|
|
123
|
+
|
|
124
|
+
if (!isNetConnected && canSaveChangesOffline !== false) {
|
|
125
|
+
await registerOffOrder(orderUpdated)
|
|
126
|
+
}
|
|
127
|
+
}
|
|
112
128
|
|
|
113
129
|
const handleOpenMessagesForBusiness = () => {
|
|
114
130
|
setOpenModalForBusiness(true);
|
|
@@ -219,7 +235,13 @@ export const OrderDetailsUI = (props: OrderDetailsParams) => {
|
|
|
219
235
|
? t('EAT_IN', 'Eat in')
|
|
220
236
|
: order.delivery_type === 4
|
|
221
237
|
? t('CURBSIDE', 'Curbside')
|
|
222
|
-
:
|
|
238
|
+
: order.delivery_type === 5
|
|
239
|
+
? t('DRIVER_THRU', 'Driver thru')
|
|
240
|
+
: order.delivery_type === 7
|
|
241
|
+
? t('CATERING_DELIVERY', 'Catering delivery')
|
|
242
|
+
: order.delivery_type === 8
|
|
243
|
+
? t('CATERING_PICKUP', 'Catering pickup')
|
|
244
|
+
: t('DELIVERY', 'Delivery')
|
|
223
245
|
}\n`
|
|
224
246
|
: '';
|
|
225
247
|
|
|
@@ -425,6 +447,16 @@ export const OrderDetailsUI = (props: OrderDetailsParams) => {
|
|
|
425
447
|
forceUpdate && handleViewActionOrder && handleViewActionOrder(forceUpdate === 9 ? 'forcePickUp' : 'forceDelivery')
|
|
426
448
|
}, [forceUpdate])
|
|
427
449
|
|
|
450
|
+
useEffect(() => {
|
|
451
|
+
if (!!props.order?.error || props.order?.error?.length > 0) {
|
|
452
|
+
showToast(ToastType.Error,
|
|
453
|
+
props.order?.error?.[0] ||
|
|
454
|
+
props.order?.error ||
|
|
455
|
+
t('NETWORK_ERROR', 'Network Error'),
|
|
456
|
+
5000)
|
|
457
|
+
}
|
|
458
|
+
}, [props.order?.error])
|
|
459
|
+
|
|
428
460
|
const styles = StyleSheet.create({
|
|
429
461
|
btnPickUp: {
|
|
430
462
|
borderWidth: 0,
|
|
@@ -436,8 +468,9 @@ export const OrderDetailsUI = (props: OrderDetailsParams) => {
|
|
|
436
468
|
let locationMarker: any;
|
|
437
469
|
let isToFollow = false;
|
|
438
470
|
let isBusinessMarker = false;
|
|
439
|
-
|
|
440
|
-
|
|
471
|
+
const customerStatusses = [3, 9, 19, 23, 26]
|
|
472
|
+
const businessStatusses = [7, 8, 18]
|
|
473
|
+
if (businessStatusses?.includes(order?.status)) {
|
|
441
474
|
const markerBusiness = 'Business';
|
|
442
475
|
isBusinessMarker = true;
|
|
443
476
|
locationMarker = locations.find(
|
|
@@ -447,7 +480,7 @@ export const OrderDetailsUI = (props: OrderDetailsParams) => {
|
|
|
447
480
|
if (order?.status === 8 || order?.status === 18) {
|
|
448
481
|
isToFollow = true;
|
|
449
482
|
}
|
|
450
|
-
} else if (
|
|
483
|
+
} else if (customerStatusses?.includes(order?.status)) {
|
|
451
484
|
const markerCustomer = 'Customer';
|
|
452
485
|
isToFollow = true;
|
|
453
486
|
isBusinessMarker = false;
|
|
@@ -475,20 +508,36 @@ export const OrderDetailsUI = (props: OrderDetailsParams) => {
|
|
|
475
508
|
isOrderGroup={isOrderGroup}
|
|
476
509
|
lastOrder={lastOrder}
|
|
477
510
|
/>
|
|
478
|
-
{(order?.status === 8 || order?.status === 18) && order?.delivery_type
|
|
511
|
+
{(order?.status === 8 || order?.status === 18) && deliveryTypes?.includes(order?.delivery_type) && !props.order?.loading && (
|
|
479
512
|
<Pickup>
|
|
480
513
|
<OButton
|
|
481
514
|
style={styles.btnPickUp}
|
|
482
515
|
textStyle={{ color: theme.colors.primary }}
|
|
483
516
|
text={t('ARRIVED_TO_BUSINESS', 'Arrived to bussiness')}
|
|
517
|
+
isDisabled={disabledActionsByInternet}
|
|
484
518
|
onClick={() =>
|
|
485
|
-
|
|
519
|
+
isGrantedPermissions ? handleChangeOrderStatus(3) : goToPermissionPage()
|
|
486
520
|
}
|
|
487
521
|
imgLeftStyle={{ tintColor: theme.colors.backArrow }}
|
|
488
522
|
/>
|
|
489
523
|
</Pickup>
|
|
490
524
|
)}
|
|
491
|
-
|
|
525
|
+
|
|
526
|
+
{(order?.status === 9 || order?.status === 19) && deliveryTypes?.includes(order?.delivery_type) && !props.order?.loading && (
|
|
527
|
+
<View style={{ paddingVertical: 20, marginBottom: 20 }}>
|
|
528
|
+
<OButton
|
|
529
|
+
style={styles.btnPickUp}
|
|
530
|
+
textStyle={{ color: theme.colors.primary }}
|
|
531
|
+
text={t('ARRIVED_TO_CUSTOMER', 'Arrived to customer')}
|
|
532
|
+
isDisabled={disabledActionsByInternet}
|
|
533
|
+
onClick={() =>
|
|
534
|
+
isGrantedPermissions ? handleChangeOrderStatus(26) : goToPermissionPage()
|
|
535
|
+
}
|
|
536
|
+
imgLeftStyle={{ tintColor: theme.colors.backArrow }}
|
|
537
|
+
/>
|
|
538
|
+
</View>
|
|
539
|
+
)}
|
|
540
|
+
{order?.status === 3 && deliveryTypes?.includes(order?.delivery_type) && !isHideRejectButtons && isEnabledOrderNotReady && !props.order?.loading && (
|
|
492
541
|
<View style={{ paddingVertical: 20, marginBottom: 20 }}>
|
|
493
542
|
<OButton
|
|
494
543
|
style={styles.btnPickUp}
|
|
@@ -505,7 +554,7 @@ export const OrderDetailsUI = (props: OrderDetailsParams) => {
|
|
|
505
554
|
<View
|
|
506
555
|
style={{
|
|
507
556
|
height:
|
|
508
|
-
order?.status === 8 && order?.delivery_type
|
|
557
|
+
order?.status === 8 && deliveryTypes?.includes(order?.delivery_type) ? 50 : 35,
|
|
509
558
|
}}
|
|
510
559
|
/>
|
|
511
560
|
|
|
@@ -532,21 +581,31 @@ export const OrderDetailsUI = (props: OrderDetailsParams) => {
|
|
|
532
581
|
))}
|
|
533
582
|
</View>
|
|
534
583
|
)}
|
|
535
|
-
|
|
536
|
-
{(!!props.order?.error || props.order?.error?.length > 0) && (
|
|
537
|
-
<NotFoundSource
|
|
538
|
-
btnTitle={t('GO_TO_MY_ORDERS', 'Go to my orders')}
|
|
539
|
-
content={
|
|
540
|
-
props.order.error[0] ||
|
|
541
|
-
props.order.error ||
|
|
542
|
-
t('NETWORK_ERROR', 'Network Error')
|
|
543
|
-
}
|
|
544
|
-
onClickButton={() => navigation.navigate('Orders')}
|
|
545
|
-
/>
|
|
546
|
-
)}
|
|
547
584
|
{!((!order || Object.keys(order).length === 0) &&
|
|
548
|
-
(props.order?.error?.length < 1 || !props.order?.error)) && (
|
|
585
|
+
(props.order?.error?.length < 1 || !props.order?.error)) && order?.id && (
|
|
549
586
|
<View style={{ flex: 1 }}>
|
|
587
|
+
{order?.unsync && (
|
|
588
|
+
<View
|
|
589
|
+
style={{
|
|
590
|
+
flexDirection: 'row',
|
|
591
|
+
justifyContent: 'flex-start',
|
|
592
|
+
alignItems: 'center'
|
|
593
|
+
}}
|
|
594
|
+
>
|
|
595
|
+
<MCIcon
|
|
596
|
+
name={'cloud-sync'}
|
|
597
|
+
color={'#444'}
|
|
598
|
+
size={16}
|
|
599
|
+
/>
|
|
600
|
+
<OText
|
|
601
|
+
size={14}
|
|
602
|
+
color={theme.colors.textGray}
|
|
603
|
+
style={{ marginLeft: 5 }}
|
|
604
|
+
>
|
|
605
|
+
{t('PENDING_SYNC_CHANGES', 'Pending sync changes')}
|
|
606
|
+
</OText>
|
|
607
|
+
</View>
|
|
608
|
+
)}
|
|
550
609
|
<OrderHeaderComponent
|
|
551
610
|
order={order}
|
|
552
611
|
handleOpenMapView={handleOpenMapView}
|
|
@@ -570,11 +629,11 @@ export const OrderDetailsUI = (props: OrderDetailsParams) => {
|
|
|
570
629
|
</OrderDetailsContainer>
|
|
571
630
|
{showFloatButtonsPickUp[order?.status] && (
|
|
572
631
|
<FloatingButton
|
|
573
|
-
disabled={props.order?.loading}
|
|
632
|
+
disabled={props.order?.loading || disabledActionsByInternet}
|
|
574
633
|
btnText={t('PICKUP_FAILED', 'Pickup failed')}
|
|
575
634
|
isSecondaryBtn={false}
|
|
576
635
|
secondButtonClick={() =>
|
|
577
|
-
|
|
636
|
+
isGrantedPermissions ? handleChangeOrderStatus(9) : goToPermissionPage()
|
|
578
637
|
}
|
|
579
638
|
firstButtonClick={() =>
|
|
580
639
|
handleViewActionOrder && handleViewActionOrder('pickupFailed')
|
|
@@ -583,18 +642,18 @@ export const OrderDetailsUI = (props: OrderDetailsParams) => {
|
|
|
583
642
|
secondButton={true}
|
|
584
643
|
firstColorCustom={theme.colors.red}
|
|
585
644
|
secondColorCustom={theme.colors.green}
|
|
586
|
-
widthButton={isHideRejectButtons ? '100%': '45%'}
|
|
587
|
-
isHideRejectButtons={isHideRejectButtons}
|
|
645
|
+
widthButton={isHideRejectButtons || !isEnabledFailedPickupDriver ? '100%' : '45%'}
|
|
646
|
+
isHideRejectButtons={isHideRejectButtons || !isEnabledFailedPickupDriver}
|
|
588
647
|
/>
|
|
589
648
|
)}
|
|
590
649
|
{(validStatusComplete.includes(order?.status)) && (
|
|
591
650
|
<>
|
|
592
651
|
<FloatingButton
|
|
593
|
-
disabled={props.order?.loading}
|
|
652
|
+
disabled={props.order?.loading || disabledActionsByInternet}
|
|
594
653
|
btnText={t('DELIVERY_FAILED', 'Delivery Failed')}
|
|
595
654
|
isSecondaryBtn={false}
|
|
596
655
|
secondButtonClick={() =>
|
|
597
|
-
|
|
656
|
+
isGrantedPermissions ? handleChangeOrderStatus(11) : goToPermissionPage()
|
|
598
657
|
}
|
|
599
658
|
firstButtonClick={() =>
|
|
600
659
|
handleViewActionOrder && handleViewActionOrder('deliveryFailed')
|
|
@@ -603,23 +662,31 @@ export const OrderDetailsUI = (props: OrderDetailsParams) => {
|
|
|
603
662
|
secondButton={true}
|
|
604
663
|
firstColorCustom={theme.colors.red}
|
|
605
664
|
secondColorCustom={theme.colors.green}
|
|
606
|
-
widthButton={isHideRejectButtons ? '100%': '45%'}
|
|
665
|
+
widthButton={isHideRejectButtons ? '100%' : '45%'}
|
|
607
666
|
isHideRejectButtons={isHideRejectButtons}
|
|
608
667
|
/>
|
|
609
668
|
</>
|
|
610
669
|
)}
|
|
611
670
|
{showFloatButtonsAcceptOrReject[order?.status] && (
|
|
612
671
|
<FloatingButton
|
|
672
|
+
disabled={props.order?.loading || disabledActionsByInternet}
|
|
673
|
+
widthButton={isHideRejectButtons ? '100%' : '45%'}
|
|
674
|
+
isHideRejectButtons={isHideRejectButtons}
|
|
613
675
|
btnText={t('REJECT', 'Reject')}
|
|
676
|
+
firstColorCustom={theme.colors.red}
|
|
677
|
+
firstButtonClick={() => order?.isLogistic && (order?.order_group || logisticOrderStatus.includes(order?.status))
|
|
678
|
+
? handleRejectLogisticOrder()
|
|
679
|
+
: handleViewActionOrder('reject')
|
|
680
|
+
}
|
|
614
681
|
isSecondaryBtn={false}
|
|
615
|
-
secondButtonClick={() => (order?.isLogistic && (order?.order_group || logisticOrderStatus.includes(order?.status))) ? handleAcceptLogisticOrder(order) : handleViewActionOrder('accept')}
|
|
616
|
-
firstButtonClick={() => order?.isLogistic && (order?.order_group || logisticOrderStatus.includes(order?.status)) ? handleRejectLogisticOrder() : handleViewActionOrder('reject')}
|
|
617
|
-
secondBtnText={t('ACCEPT', 'Accept')}
|
|
618
682
|
secondButton={true}
|
|
619
|
-
|
|
683
|
+
secondBtnText={t('ACCEPT', 'Accept')}
|
|
684
|
+
secondButtonClick={() => hideTimer
|
|
685
|
+
? handleChangeOrderStatus(8)
|
|
686
|
+
: (order?.isLogistic && (order?.order_group || logisticOrderStatus.includes(order?.status)))
|
|
687
|
+
? handleAcceptLogisticOrder(order)
|
|
688
|
+
: handleViewActionOrder('accept')}
|
|
620
689
|
secondColorCustom={theme.colors.green}
|
|
621
|
-
widthButton={isHideRejectButtons ? '100%': '45%'}
|
|
622
|
-
isHideRejectButtons={isHideRejectButtons}
|
|
623
690
|
/>
|
|
624
691
|
)}
|
|
625
692
|
</>
|
|
@@ -674,7 +741,7 @@ export const OrderDetailsUI = (props: OrderDetailsParams) => {
|
|
|
674
741
|
entireModal
|
|
675
742
|
customClose>
|
|
676
743
|
<AcceptOrRejectOrder
|
|
677
|
-
handleUpdateOrder={handleChangeOrderStatus}
|
|
744
|
+
handleUpdateOrder={props.handleChangeOrderStatus}
|
|
678
745
|
closeModal={setOpenModalForAccept}
|
|
679
746
|
customerCellphone={order?.customer?.cellphone}
|
|
680
747
|
loading={props.order?.loading}
|
|
@@ -684,11 +751,24 @@ export const OrderDetailsUI = (props: OrderDetailsParams) => {
|
|
|
684
751
|
actions={actions}
|
|
685
752
|
orderTitle={orderTitle}
|
|
686
753
|
appTitle={appTitle}
|
|
754
|
+
isLoadingOrder={props.order?.loading}
|
|
687
755
|
/>
|
|
688
756
|
</OModal>
|
|
689
757
|
)}
|
|
690
758
|
</View>
|
|
691
759
|
)}
|
|
760
|
+
|
|
761
|
+
{(!!props.order?.error || props.order?.error?.length > 0) && (
|
|
762
|
+
<NotFoundSource
|
|
763
|
+
btnTitle={t('GO_TO_MY_ORDERS', 'Go to my orders')}
|
|
764
|
+
content={
|
|
765
|
+
props.order.error[0] ||
|
|
766
|
+
props.order.error ||
|
|
767
|
+
t('NETWORK_ERROR', 'Network Error')
|
|
768
|
+
}
|
|
769
|
+
onClickButton={() => navigation.navigate('Orders')}
|
|
770
|
+
/>
|
|
771
|
+
)}
|
|
692
772
|
{alertState?.open && (
|
|
693
773
|
<Alert
|
|
694
774
|
open={alertState.open}
|