ordering-ui-react-native 0.21.41-test → 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 -3
- package/themes/business/index.tsx +0 -5
- 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/OrderDetails/OrderHeaderComponent.tsx +12 -0
- package/themes/business/src/components/OrderDetailsLogistic/index.tsx +6 -1
- package/themes/business/src/components/OrderSummary/index.tsx +3 -10
- 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/themes/kiosk/src/components/LoginForm/index.tsx +7 -4
- package/themes/original/src/components/BusinessInformation/index.tsx +0 -1
- 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 +22 -402
- package/themes/original/src/components/Checkout/index.tsx +5 -1
- package/themes/original/src/components/GiftCard/RedeemGiftCard/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/MultiCheckout/index.tsx +138 -16
- package/themes/original/src/components/OrderProgress/index.tsx +2 -1
- package/themes/original/src/components/PaymentOptions/index.tsx +3 -1
- package/themes/original/src/components/ProductForm/index.tsx +1 -1
- package/themes/business/src/components/StarPrinter/SearchPrinter.tsx +0 -94
- package/themes/business/src/components/StarPrinter/index.tsx +0 -156
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ordering-ui-react-native",
|
|
3
|
-
"version": "0.21.41
|
|
3
|
+
"version": "0.21.41",
|
|
4
4
|
"description": "Reusable components made in react native",
|
|
5
5
|
"main": "src/index.tsx",
|
|
6
6
|
"author": "ordering.inc",
|
|
@@ -45,7 +45,6 @@
|
|
|
45
45
|
"@react-native-firebase/analytics": "^12.9.3",
|
|
46
46
|
"@react-native-firebase/app": "^12.9.3",
|
|
47
47
|
"@react-native-google-signin/google-signin": "^7.0.1",
|
|
48
|
-
"@react-native-picker/picker": "^2.4.10",
|
|
49
48
|
"@react-navigation/drawer": "^5.10.2",
|
|
50
49
|
"@react-navigation/material-bottom-tabs": "^5.3.14",
|
|
51
50
|
"@react-navigation/native": "^5.7.6",
|
|
@@ -111,7 +110,6 @@
|
|
|
111
110
|
"react-native-signature-canvas": "^4.3.0",
|
|
112
111
|
"react-native-snap-carousel": "^3.9.1",
|
|
113
112
|
"react-native-sound": "^0.11.1",
|
|
114
|
-
"react-native-star-io10": "^1.3.0",
|
|
115
113
|
"react-native-swipe-gestures": "^1.0.5",
|
|
116
114
|
"react-native-swiper": "^1.6.0",
|
|
117
115
|
"react-native-tracking-transparency": "^0.1.1",
|
|
@@ -42,8 +42,6 @@ import { NewOrderNotification } from './src/components/NewOrderNotification';
|
|
|
42
42
|
import { DriverSchedule } from './src/components/DriverSchedule';
|
|
43
43
|
import { ScheduleBlocked } from './src/components/ScheduleBlocked';
|
|
44
44
|
import { OrderDetailsLogistic } from './src/components/OrderDetailsLogistic'
|
|
45
|
-
import { HandleStarPrinter } from './src/components/StarPrinter';
|
|
46
|
-
import { SearchStarPrinter } from './src/components/StarPrinter/SearchPrinter';
|
|
47
45
|
//OComponents
|
|
48
46
|
import {
|
|
49
47
|
OText,
|
|
@@ -132,7 +130,4 @@ export {
|
|
|
132
130
|
useLocation,
|
|
133
131
|
// providers
|
|
134
132
|
StoreMethods,
|
|
135
|
-
//printer
|
|
136
|
-
HandleStarPrinter,
|
|
137
|
-
SearchStarPrinter,
|
|
138
133
|
};
|
|
@@ -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
|
</>
|
|
@@ -295,6 +295,18 @@ export const OrderHeaderComponent = (props: OrderHeader) => {
|
|
|
295
295
|
<OText size={13}>{t(order?.paymethod?.gateway?.toUpperCase(), order?.paymethod?.name)}</OText>
|
|
296
296
|
)}
|
|
297
297
|
</OText>
|
|
298
|
+
{order?.spot_number && (
|
|
299
|
+
<OText size={13}>
|
|
300
|
+
<OText size={13} weight='bold'>
|
|
301
|
+
{`${order?.delivery_type === 3
|
|
302
|
+
? t('EATIN_SPOT_NUMBER', 'Table number')
|
|
303
|
+
: order?.delivery_type === 5
|
|
304
|
+
? t('DRIVE_THRU_SPOT_NUMBER', 'Drive thru lane')
|
|
305
|
+
: t('CURBSIDE_SPOT_NUMBER', 'Spot number')}: `}
|
|
306
|
+
</OText>
|
|
307
|
+
{order.spot_number}
|
|
308
|
+
</OText>
|
|
309
|
+
)}
|
|
298
310
|
</>
|
|
299
311
|
)}
|
|
300
312
|
</OrderHeader>
|
|
@@ -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
|
</>
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import React, { useState } from 'react';
|
|
2
2
|
import { OText, OIconButton } from '../shared';
|
|
3
|
-
import {
|
|
4
|
-
StyleSheet, View, Platform, Alert
|
|
5
|
-
} from 'react-native';
|
|
3
|
+
import { StyleSheet, View, Platform, Alert } from 'react-native';
|
|
6
4
|
import {
|
|
7
5
|
Content,
|
|
8
6
|
OrderCustomer,
|
|
@@ -22,8 +20,8 @@ import { FloatingButton } from '../FloatingButton';
|
|
|
22
20
|
import RNHTMLtoPDF from 'react-native-html-to-pdf';
|
|
23
21
|
import RNPrint from 'react-native-print';
|
|
24
22
|
import { useTheme } from 'styled-components/native';
|
|
25
|
-
import { ProductItemAccordion } from '../ProductItemAccordion';
|
|
26
23
|
|
|
24
|
+
import { ProductItemAccordion } from '../ProductItemAccordion';
|
|
27
25
|
|
|
28
26
|
export const OrderSummary = ({ order, navigation, orderStatus, askBluetoothPermission, getPermissions, isGrantedPermissions, checkBluetoothPermission }: any) => {
|
|
29
27
|
const handleArrowBack: any = () => {
|
|
@@ -36,7 +34,6 @@ export const OrderSummary = ({ order, navigation, orderStatus, askBluetoothPermi
|
|
|
36
34
|
selectedPrinter: { url: undefined },
|
|
37
35
|
});
|
|
38
36
|
|
|
39
|
-
|
|
40
37
|
const getFormattedSubOptionName = ({ quantity, name, position, price }: any) => {
|
|
41
38
|
if (name !== 'No') {
|
|
42
39
|
const pos = position && position !== 'whole' ? `(${t(position.toUpperCase(), position)})` : '';
|
|
@@ -343,10 +340,6 @@ export const OrderSummary = ({ order, navigation, orderStatus, askBluetoothPermi
|
|
|
343
340
|
}
|
|
344
341
|
};
|
|
345
342
|
|
|
346
|
-
const openPrint = () => {
|
|
347
|
-
navigation.navigate('HandleStarPrinter')
|
|
348
|
-
}
|
|
349
|
-
|
|
350
343
|
return (
|
|
351
344
|
<>
|
|
352
345
|
<Content>
|
|
@@ -686,7 +679,7 @@ export const OrderSummary = ({ order, navigation, orderStatus, askBluetoothPermi
|
|
|
686
679
|
|
|
687
680
|
<View style={{ marginBottom: 0 }}>
|
|
688
681
|
<FloatingButton
|
|
689
|
-
firstButtonClick={() =>
|
|
682
|
+
firstButtonClick={() => handlePrint()}
|
|
690
683
|
btnText={t('PRINT', 'Print')}
|
|
691
684
|
color={theme.colors.green}
|
|
692
685
|
widthButton={'100%'}
|
|
@@ -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,
|
|
@@ -52,7 +52,7 @@ const LoginFormUI = (props: LoginParams) => {
|
|
|
52
52
|
} = props;
|
|
53
53
|
|
|
54
54
|
const theme = useTheme()
|
|
55
|
-
const [{ configs }] = useConfig()
|
|
55
|
+
const [{ configs }, { refreshConfigs }] = useConfig()
|
|
56
56
|
const [ordering, { setOrdering }] = useApi();
|
|
57
57
|
const [, { showToast }] = useToast();
|
|
58
58
|
const [, t] = useLanguage();
|
|
@@ -347,13 +347,16 @@ const LoginFormUI = (props: LoginParams) => {
|
|
|
347
347
|
project: projectName
|
|
348
348
|
})
|
|
349
349
|
}
|
|
350
|
-
if (isDeviceLoginEnabled) {
|
|
351
|
-
props.handleChangeTab('device_code')
|
|
352
|
-
}
|
|
353
350
|
}, 1500)
|
|
354
351
|
return () => clearTimeout(projectInputTimeout);
|
|
355
352
|
}, [projectName, isDeviceLoginEnabled])
|
|
356
353
|
|
|
354
|
+
useEffect(() => {
|
|
355
|
+
if (ordering?.project) {
|
|
356
|
+
refreshConfigs()
|
|
357
|
+
}
|
|
358
|
+
}, [ordering?.project])
|
|
359
|
+
|
|
357
360
|
const logo = (
|
|
358
361
|
<LogoWrapper>
|
|
359
362
|
<OIcon src={theme.images.logos.logotype} style={styles.logo} />
|
|
@@ -106,7 +106,6 @@ const BusinessInformationUI = (props: BusinessInformationParams) => {
|
|
|
106
106
|
location={businessLocation.location}
|
|
107
107
|
markerTitle={businessState?.business?.name}
|
|
108
108
|
businessZones={businessState?.business?.zones}
|
|
109
|
-
delta={30}
|
|
110
109
|
/>
|
|
111
110
|
</WrapBusinessMap>
|
|
112
111
|
)}
|