ordering-ui-react-native 0.21.40 → 0.21.41
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 +1 -1
- package/themes/business/src/components/AcceptOrRejectOrder/index.tsx +5 -1
- package/themes/business/src/components/FloatingButton/index.tsx +34 -31
- package/themes/business/src/components/OrderDetails/Delivery.tsx +11 -6
- package/themes/business/src/components/OrderDetailsLogistic/index.tsx +6 -1
- package/themes/business/src/components/OrdersOption/index.tsx +2 -0
- package/themes/business/src/components/PreviousOrders/OrderList.tsx +17 -12
- package/themes/business/src/components/PreviousOrders/index.tsx +77 -65
package/package.json
CHANGED
|
@@ -307,7 +307,11 @@ export const AcceptOrRejectOrder = (props: AcceptOrRejectOrderParams) => {
|
|
|
307
307
|
}, [])
|
|
308
308
|
|
|
309
309
|
return (
|
|
310
|
-
<KeyboardAvoidingView
|
|
310
|
+
<KeyboardAvoidingView
|
|
311
|
+
enabled
|
|
312
|
+
behavior={Platform.OS === 'ios' ? 'padding' : 'height'}
|
|
313
|
+
style={{ flex: 1 }}
|
|
314
|
+
>
|
|
311
315
|
<View style={styles.parent}>
|
|
312
316
|
<View style={styles.upper}>
|
|
313
317
|
<TopActions>
|
|
@@ -25,6 +25,7 @@ const FloatingButtonUI = (props: FloatingButtonParams) => {
|
|
|
25
25
|
secondButton,
|
|
26
26
|
widthButton,
|
|
27
27
|
isPadding,
|
|
28
|
+
isHideRejectButtons
|
|
28
29
|
} = props;
|
|
29
30
|
|
|
30
31
|
const theme = useTheme();
|
|
@@ -61,39 +62,41 @@ const FloatingButtonUI = (props: FloatingButtonParams) => {
|
|
|
61
62
|
width: '100%',
|
|
62
63
|
justifyContent: 'space-between',
|
|
63
64
|
}}>
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
{
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
{
|
|
83
|
-
|
|
65
|
+
{!isHideRejectButtons && (
|
|
66
|
+
<Button
|
|
67
|
+
secondButton={secondButton}
|
|
68
|
+
style={[
|
|
69
|
+
{
|
|
70
|
+
borderWidth: colorTxt1 ? 1 : 0,
|
|
71
|
+
borderColor: colorTxt1 ? colorTxt1 : null,
|
|
72
|
+
},
|
|
73
|
+
secondButton
|
|
74
|
+
? { backgroundColor: firstColorCustom || styles.primaryBtn }
|
|
75
|
+
: color
|
|
76
|
+
? { backgroundColor: color }
|
|
77
|
+
: styles.primaryBtn,
|
|
78
|
+
,
|
|
79
|
+
{ width: widthButton },
|
|
80
|
+
]}
|
|
81
|
+
onPress={firstButtonClick}
|
|
82
|
+
disabled={disabled}>
|
|
83
|
+
<OText color={theme.colors.white} size={16} mLeft={20}>
|
|
84
|
+
{btnLeftValueShow ? btnLeftValue : ''}
|
|
85
|
+
</OText>
|
|
84
86
|
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
87
|
+
<OText
|
|
88
|
+
style={styles.btnTextStyle}
|
|
89
|
+
color={colorTxt1 ? colorTxt1 : theme.colors.white}
|
|
90
|
+
numberOfLines={2}
|
|
91
|
+
adjustsFontSizeToFit>
|
|
92
|
+
{btnText}
|
|
93
|
+
</OText>
|
|
92
94
|
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
95
|
+
<OText color={theme.colors.white} size={16} mRight={20}>
|
|
96
|
+
{btnRightValueShow ? btnRightValue : ''}
|
|
97
|
+
</OText>
|
|
98
|
+
</Button>
|
|
99
|
+
)}
|
|
97
100
|
|
|
98
101
|
{secondButton && (
|
|
99
102
|
<Button
|
|
@@ -61,9 +61,11 @@ export const OrderDetailsUI = (props: OrderDetailsParams) => {
|
|
|
61
61
|
const [, { showToast }] = useToast();
|
|
62
62
|
const [{ parsePrice, parseNumber }] = useUtils();
|
|
63
63
|
const [{ configs }] = useConfig();
|
|
64
|
+
|
|
64
65
|
const { order } = props.order
|
|
65
66
|
|
|
66
67
|
const isAllowedDriverRejectOrder = configs?.allow_driver_reject_order?.value === '1'
|
|
68
|
+
const isHideRejectButtons = configs?.reject_orders_enabled && configs?.reject_orders_enabled?.value !== '1'
|
|
67
69
|
const theme = useTheme();
|
|
68
70
|
const [, t] = useLanguage();
|
|
69
71
|
const [session] = useSession();
|
|
@@ -88,9 +90,9 @@ export const OrderDetailsUI = (props: OrderDetailsParams) => {
|
|
|
88
90
|
const logisticOrderStatus = [4, 6, 7]
|
|
89
91
|
|
|
90
92
|
const showFloatButtonsPickUp: any = {
|
|
91
|
-
8:
|
|
93
|
+
8: !isHideRejectButtons,
|
|
92
94
|
3: true,
|
|
93
|
-
18:
|
|
95
|
+
18: !isHideRejectButtons,
|
|
94
96
|
};
|
|
95
97
|
|
|
96
98
|
const showFloatButtonsAcceptOrReject: any = {
|
|
@@ -482,7 +484,7 @@ export const OrderDetailsUI = (props: OrderDetailsParams) => {
|
|
|
482
484
|
/>
|
|
483
485
|
</Pickup>
|
|
484
486
|
)}
|
|
485
|
-
{order?.status === 3 && order?.delivery_type === 1 && (
|
|
487
|
+
{order?.status === 3 && order?.delivery_type === 1 && !isHideRejectButtons && (
|
|
486
488
|
<View style={{ paddingVertical: 20, marginBottom: 20 }}>
|
|
487
489
|
<OButton
|
|
488
490
|
style={styles.btnPickUp}
|
|
@@ -577,7 +579,8 @@ export const OrderDetailsUI = (props: OrderDetailsParams) => {
|
|
|
577
579
|
secondButton={true}
|
|
578
580
|
firstColorCustom={theme.colors.red}
|
|
579
581
|
secondColorCustom={theme.colors.green}
|
|
580
|
-
widthButton={'45%'}
|
|
582
|
+
widthButton={isHideRejectButtons ? '100%': '45%'}
|
|
583
|
+
isHideRejectButtons={isHideRejectButtons}
|
|
581
584
|
/>
|
|
582
585
|
)}
|
|
583
586
|
{(validStatusComplete.includes(order?.status)) && (
|
|
@@ -596,7 +599,8 @@ export const OrderDetailsUI = (props: OrderDetailsParams) => {
|
|
|
596
599
|
secondButton={true}
|
|
597
600
|
firstColorCustom={theme.colors.red}
|
|
598
601
|
secondColorCustom={theme.colors.green}
|
|
599
|
-
widthButton={'45%'}
|
|
602
|
+
widthButton={isHideRejectButtons ? '100%': '45%'}
|
|
603
|
+
isHideRejectButtons={isHideRejectButtons}
|
|
600
604
|
/>
|
|
601
605
|
</>
|
|
602
606
|
)}
|
|
@@ -610,7 +614,8 @@ export const OrderDetailsUI = (props: OrderDetailsParams) => {
|
|
|
610
614
|
secondButton={true}
|
|
611
615
|
firstColorCustom={theme.colors.red}
|
|
612
616
|
secondColorCustom={theme.colors.green}
|
|
613
|
-
widthButton={'45%'}
|
|
617
|
+
widthButton={isHideRejectButtons ? '100%': '45%'}
|
|
618
|
+
isHideRejectButtons={isHideRejectButtons}
|
|
614
619
|
/>
|
|
615
620
|
)}
|
|
616
621
|
</>
|
|
@@ -10,6 +10,7 @@ import {
|
|
|
10
10
|
useLanguage,
|
|
11
11
|
OrderDetails as OrderDetailsConTableoller,
|
|
12
12
|
useSession,
|
|
13
|
+
useConfig
|
|
13
14
|
} from 'ordering-components/native';
|
|
14
15
|
|
|
15
16
|
//Components
|
|
@@ -34,6 +35,8 @@ export const OrderDetailsLogisticUI = (props: OrderDetailsLogisticParams) => {
|
|
|
34
35
|
const theme = useTheme();
|
|
35
36
|
const [, t] = useLanguage();
|
|
36
37
|
const [session] = useSession();
|
|
38
|
+
const [{ configs }] = useConfig();
|
|
39
|
+
|
|
37
40
|
const [alertState, setAlertState] = useState<{
|
|
38
41
|
open: boolean;
|
|
39
42
|
content: Array<string>;
|
|
@@ -41,6 +44,7 @@ export const OrderDetailsLogisticUI = (props: OrderDetailsLogisticParams) => {
|
|
|
41
44
|
}>({ open: false, content: [], key: null });
|
|
42
45
|
|
|
43
46
|
const logisticOrderStatus = [4, 6, 7]
|
|
47
|
+
const isHideRejectButtons = configs?.reject_orders_enabled && configs?.reject_orders_enabled?.value !== '1'
|
|
44
48
|
|
|
45
49
|
const showFloatButtonsAcceptOrReject: any = {
|
|
46
50
|
0: true,
|
|
@@ -166,7 +170,8 @@ export const OrderDetailsLogisticUI = (props: OrderDetailsLogisticParams) => {
|
|
|
166
170
|
secondButton={true}
|
|
167
171
|
firstColorCustom={theme.colors.red}
|
|
168
172
|
secondColorCustom={theme.colors.green}
|
|
169
|
-
widthButton={'45%'}
|
|
173
|
+
widthButton={isHideRejectButtons ? '100%': '45%'}
|
|
174
|
+
isHideRejectButtons={isHideRejectButtons}
|
|
170
175
|
/>
|
|
171
176
|
)}
|
|
172
177
|
</>
|
|
@@ -608,6 +608,7 @@ const OrdersOptionUI = (props: OrdersOptionParams) => {
|
|
|
608
608
|
orderTitle={props.orderDetailsProps?.orderTitle}
|
|
609
609
|
handleChangeOrderStatus={handleChangeOrderStatus}
|
|
610
610
|
handleSendCustomerReview={handleSendCustomerReview}
|
|
611
|
+
isBusinessApp={isBusinessApp}
|
|
611
612
|
/>
|
|
612
613
|
)}
|
|
613
614
|
{!logisticOrders?.error?.length &&
|
|
@@ -618,6 +619,7 @@ const OrdersOptionUI = (props: OrdersOptionParams) => {
|
|
|
618
619
|
onNavigationRedirect={onNavigationRedirect}
|
|
619
620
|
getOrderStatus={getOrderStatus}
|
|
620
621
|
handleClickLogisticOrder={handleClickLogisticOrder}
|
|
622
|
+
isBusinessApp={isBusinessApp}
|
|
621
623
|
isLogisticOrder
|
|
622
624
|
/>
|
|
623
625
|
)
|
|
@@ -2,7 +2,7 @@ import React from 'react'
|
|
|
2
2
|
import { View } from 'react-native'
|
|
3
3
|
import { useTheme } from 'styled-components/native'
|
|
4
4
|
import { OButton } from '../shared';
|
|
5
|
-
import { useLanguage } from 'ordering-components/native'
|
|
5
|
+
import { useLanguage, useConfig } from 'ordering-components/native'
|
|
6
6
|
import { OrderItem } from './OrderItem';
|
|
7
7
|
import { AcceptOrRejectOrder as AcceptOrRejectOrderStyle } from './styles';
|
|
8
8
|
|
|
@@ -28,6 +28,9 @@ export const OrdersList = React.memo((props: any) => {
|
|
|
28
28
|
|
|
29
29
|
const theme = useTheme()
|
|
30
30
|
const [, t] = useLanguage()
|
|
31
|
+
const [{ configs }] = useConfig();
|
|
32
|
+
|
|
33
|
+
const isHideRejectButtons = configs?.reject_orders_enabled && configs?.reject_orders_enabled?.value !== '1'
|
|
31
34
|
|
|
32
35
|
return (
|
|
33
36
|
<View
|
|
@@ -59,16 +62,18 @@ export const OrdersList = React.memo((props: any) => {
|
|
|
59
62
|
/>
|
|
60
63
|
) : (
|
|
61
64
|
<>
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
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
|
+
)}
|
|
72
77
|
<OButton
|
|
73
78
|
text={t('ACCEPT', 'Accept')}
|
|
74
79
|
onClick={() => handleClickLogisticOrder(1, _order?.id)}
|
|
@@ -76,7 +81,7 @@ export const OrdersList = React.memo((props: any) => {
|
|
|
76
81
|
borderColor={theme.colors.green}
|
|
77
82
|
imgRightSrc={null}
|
|
78
83
|
style={{ borderRadius: 7, height: 40 }}
|
|
79
|
-
parentStyle={{ width: '45%' }}
|
|
84
|
+
parentStyle={{ width: isHideRejectButtons ? '100%' : '45%' }}
|
|
80
85
|
textStyle={{ color: theme.colors.white }}
|
|
81
86
|
/>
|
|
82
87
|
</>
|
|
@@ -1,7 +1,7 @@
|
|
|
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
6
|
import { AcceptOrRejectOrder as AcceptOrRejectOrderStyle } from './styles';
|
|
7
7
|
|
|
@@ -24,12 +24,15 @@ 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();
|
|
35
|
+
|
|
33
36
|
|
|
34
37
|
// const [, setCurrentTime] = useState()
|
|
35
38
|
const [openModal, setOpenModal] = useState(false)
|
|
@@ -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
|
|
@@ -168,28 +172,30 @@ export const PreviousOrders = (props: any) => {
|
|
|
168
172
|
}
|
|
169
173
|
{_ordersGrouped[k][0]?.status === 0 && (
|
|
170
174
|
<AcceptOrRejectOrderStyle>
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
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
|
+
)}
|
|
186
192
|
<OButton
|
|
187
193
|
text={t('ACCEPT_ALL', 'Accept all')}
|
|
188
194
|
bgColor={theme.colors.success100}
|
|
189
195
|
borderColor={theme.colors.success100}
|
|
190
196
|
imgRightSrc={null}
|
|
191
197
|
style={{ borderRadius: 7, height: 40 }}
|
|
192
|
-
parentStyle={{ width: '45%' }}
|
|
198
|
+
parentStyle={{ width: isHideRejectButtons ? '100%' : '45%' }}
|
|
193
199
|
textStyle={{ color: theme.colors.success500, fontSize: 12 }}
|
|
194
200
|
onClick={() => onNavigationRedirect('AcceptOrRejectOrder', {
|
|
195
201
|
action: 'accept',
|
|
@@ -236,7 +242,7 @@ export const PreviousOrders = (props: any) => {
|
|
|
236
242
|
/>
|
|
237
243
|
</AcceptOrRejectOrderStyle>
|
|
238
244
|
)}
|
|
239
|
-
{_ordersGrouped[k][0]?.status === 3 && _ordersGrouped[k][0]?.delivery_type === 1 &&
|
|
245
|
+
{_ordersGrouped[k][0]?.status === 3 && _ordersGrouped[k][0]?.delivery_type === 1 && !isHideRejectButtons &&
|
|
240
246
|
(
|
|
241
247
|
<AcceptOrRejectOrderStyle>
|
|
242
248
|
<OButton
|
|
@@ -276,26 +282,28 @@ export const PreviousOrders = (props: any) => {
|
|
|
276
282
|
![1].includes(_ordersGrouped[k][0]?.delivery_type) &&
|
|
277
283
|
(
|
|
278
284
|
<AcceptOrRejectOrderStyle>
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
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
|
+
/>
|
|
299
|
+
)}
|
|
292
300
|
<OButton
|
|
293
301
|
text={t('PICKUP_COMPLETED_BY_CUSTOMER', 'Pickup completed by customer')}
|
|
294
302
|
bgColor={theme.colors.success100}
|
|
295
303
|
borderColor={theme.colors.success100}
|
|
296
304
|
imgRightSrc={null}
|
|
297
305
|
style={{ borderRadius: 7, height: 40, paddingLeft: 10, paddingRight: 10 }}
|
|
298
|
-
parentStyle={{ width: '45%' }}
|
|
306
|
+
parentStyle={{ width: isHideRejectButtons ? '100%' : '45%' }}
|
|
299
307
|
textStyle={{ color: theme.colors.success500, fontSize: 12, textAlign: 'center' }}
|
|
300
308
|
onClick={() => handleChangeOrderStatus(
|
|
301
309
|
15,
|
|
@@ -324,28 +332,30 @@ export const PreviousOrders = (props: any) => {
|
|
|
324
332
|
)}
|
|
325
333
|
{!!deliveryPickupBtn && deliveryPickupBtn?.includes(_ordersGrouped[k][0]?.status) && (
|
|
326
334
|
<AcceptOrRejectOrderStyle>
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
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
|
+
)}
|
|
342
352
|
<OButton
|
|
343
353
|
text={t('PICKUP_COMPLETE', 'Pickup complete')}
|
|
344
354
|
bgColor={theme.colors.success100}
|
|
345
355
|
borderColor={theme.colors.success100}
|
|
346
356
|
imgRightSrc={null}
|
|
347
357
|
style={{ borderRadius: 7, height: 40, paddingLeft: 10, paddingRight: 10 }}
|
|
348
|
-
parentStyle={{ width: '45%' }}
|
|
358
|
+
parentStyle={{ width: isHideRejectButtons ? '100%' : '45%' }}
|
|
349
359
|
textStyle={{ color: theme.colors.success500, fontSize: 12, textAlign: 'center' }}
|
|
350
360
|
onClick={() => handleChangeOrderStatus(
|
|
351
361
|
9,
|
|
@@ -356,28 +366,30 @@ export const PreviousOrders = (props: any) => {
|
|
|
356
366
|
)}
|
|
357
367
|
{!!deliveryStatusCompleteBtn && deliveryStatusCompleteBtn.includes(_ordersGrouped[k][0]?.status) && (
|
|
358
368
|
<AcceptOrRejectOrderStyle>
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
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
|
+
)}
|
|
374
386
|
<OButton
|
|
375
387
|
text={t('DELIVERY_COMPLETE', 'Delivery complete')}
|
|
376
388
|
bgColor={theme.colors.success100}
|
|
377
389
|
borderColor={theme.colors.success100}
|
|
378
390
|
imgRightSrc={null}
|
|
379
391
|
style={{ borderRadius: 7, height: 40, paddingLeft: 10, paddingRight: 10 }}
|
|
380
|
-
parentStyle={{ width: '45%' }}
|
|
392
|
+
parentStyle={{ width: isHideRejectButtons ? '100%' : '45%' }}
|
|
381
393
|
textStyle={{ color: theme.colors.success500, fontSize: 12, textAlign: 'center' }}
|
|
382
394
|
onClick={() => handleChangeOrderStatus(
|
|
383
395
|
11,
|