ordering-ui-react-native 0.21.48-test → 0.21.48-test-3
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 +2 -3
- package/src/components/StripeMethodForm/index.tsx +3 -2
- package/themes/business/index.tsx +0 -5
- package/themes/business/src/components/AcceptOrRejectOrder/index.tsx +9 -2
- package/themes/business/src/components/FloatingButton/index.tsx +34 -31
- package/themes/business/src/components/MapView/index.tsx +6 -2
- 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/index.tsx +6 -2
- package/themes/original/src/components/BusinessInformation/index.tsx +0 -1
- package/themes/original/src/components/BusinessProductsList/index.tsx +2 -2
- package/themes/original/src/components/BusinessProductsListing/index.tsx +5 -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 +9 -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/GiftCard/GiftCardUI/index.tsx +8 -3
- package/themes/original/src/components/GiftCard/PurchaseGiftCard/index.tsx +36 -3
- package/themes/original/src/components/GiftCard/RedeemGiftCard/index.tsx +67 -4
- 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/NavBar/index.tsx +0 -1
- package/themes/original/src/components/OrderDetails/index.tsx +8 -4
- package/themes/original/src/components/OrderProgress/index.tsx +2 -1
- package/themes/original/src/components/PaymentOptions/index.tsx +4 -2
- package/themes/original/src/components/ProductForm/index.tsx +1 -2
- package/themes/original/src/components/UserFormDetails/index.tsx +35 -1
- package/themes/original/src/components/Wallets/index.tsx +1 -0
- package/themes/original/src/components/Wallets/styles.tsx +0 -1
- package/themes/business/src/components/StarPrinter/SearchPrinter.tsx +0 -106
- package/themes/business/src/components/StarPrinter/index.tsx +0 -235
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ordering-ui-react-native",
|
|
3
|
-
"version": "0.21.48-test",
|
|
3
|
+
"version": "0.21.48-test-3",
|
|
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",
|
|
@@ -77,6 +76,7 @@
|
|
|
77
76
|
"react-native-color-matrix-image-filters": "^5.2.10",
|
|
78
77
|
"react-native-country-picker-modal": "^2.0.0",
|
|
79
78
|
"react-native-credit-card-input": "^0.4.1",
|
|
79
|
+
"react-native-date-picker": "^4.2.13",
|
|
80
80
|
"react-native-device-info": "^8.7.1",
|
|
81
81
|
"react-native-document-picker": "^5.2.0",
|
|
82
82
|
"react-native-elements": "^3.0.0-alpha.1",
|
|
@@ -111,7 +111,6 @@
|
|
|
111
111
|
"react-native-signature-canvas": "^4.3.0",
|
|
112
112
|
"react-native-snap-carousel": "^3.9.1",
|
|
113
113
|
"react-native-sound": "^0.11.1",
|
|
114
|
-
"react-native-star-io10": "^1.1.0",
|
|
115
114
|
"react-native-swipe-gestures": "^1.0.5",
|
|
116
115
|
"react-native-swiper": "^1.6.0",
|
|
117
116
|
"react-native-tracking-transparency": "^0.1.1",
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React, { useEffect } from 'react'
|
|
2
|
-
import { useLanguage, useConfig, useOrder } from 'ordering-components/native'
|
|
2
|
+
import { useLanguage, useConfig, useOrder, useToast, ToastType } from 'ordering-components/native'
|
|
3
3
|
import { useGooglePay, useApplePay } from '@stripe/stripe-react-native'
|
|
4
4
|
import { Platform } from 'react-native';
|
|
5
5
|
import { StripeMethodFormParams } from '../../types';
|
|
@@ -26,7 +26,7 @@ export const StripeMethodForm = (props: StripeMethodFormParams) => {
|
|
|
26
26
|
const [{ configs }] = useConfig()
|
|
27
27
|
const applePay = ['global_apple_pay', 'apple_pay']
|
|
28
28
|
const googlePay = ['global_google_pay', 'google_pay']
|
|
29
|
-
|
|
29
|
+
const [, { showToast }] = useToast()
|
|
30
30
|
useEffect(() => {
|
|
31
31
|
if (Platform.OS === 'ios') {
|
|
32
32
|
return
|
|
@@ -187,6 +187,7 @@ export const StripeMethodForm = (props: StripeMethodFormParams) => {
|
|
|
187
187
|
|
|
188
188
|
useEffect(() => {
|
|
189
189
|
if (isApplePaySupported && applePay.includes(paymethod)) {
|
|
190
|
+
showToast(ToastType.Success, 'ENABLED TEST PRO')
|
|
190
191
|
setMethodPaySupported({
|
|
191
192
|
enabled: true,
|
|
192
193
|
loading: false
|
|
@@ -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>
|
|
@@ -511,7 +515,10 @@ export const AcceptOrRejectOrder = (props: AcceptOrRejectOrderParams) => {
|
|
|
511
515
|
<View
|
|
512
516
|
style={{
|
|
513
517
|
...styles.bottomParent,
|
|
514
|
-
marginBottom:
|
|
518
|
+
marginBottom: Platform.OS === 'ios'
|
|
519
|
+
? 30 : (keyboardState.height === 0)
|
|
520
|
+
? isPage ? 0 : 30
|
|
521
|
+
: keyboardState.height - (isPage ? 20 : -10)
|
|
515
522
|
}}
|
|
516
523
|
>
|
|
517
524
|
<OButton
|
|
@@ -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
|
|
@@ -132,6 +132,10 @@ const MapViewComponent = (props: MapViewParams) => {
|
|
|
132
132
|
|
|
133
133
|
const RenderMarker = ({ marker, customer, orderIds }: { marker: any, customer?: boolean, orderIds?: Array<number> }) => {
|
|
134
134
|
const markerRef = useRef<any>()
|
|
135
|
+
|
|
136
|
+
let coordinateLat = (customer ? marker?.customer?.location?.lat : marker?.business?.location?.lat) ?? initialPosition?.latitude
|
|
137
|
+
let coordinateLng = (customer ? marker?.customer?.location?.lng : marker?.business?.location?.lng) ?? initialPosition?.longitude
|
|
138
|
+
|
|
135
139
|
useEffect(() => {
|
|
136
140
|
if (
|
|
137
141
|
markerRef?.current?.props?.coordinate?.latitude === locationSelected?.latitude &&
|
|
@@ -145,8 +149,8 @@ const MapViewComponent = (props: MapViewParams) => {
|
|
|
145
149
|
<Marker
|
|
146
150
|
key={customer ? marker?.customer?.id : marker?.business?.id}
|
|
147
151
|
coordinate={{
|
|
148
|
-
latitude:
|
|
149
|
-
longitude:
|
|
152
|
+
latitude: coordinateLat,
|
|
153
|
+
longitude: coordinateLng
|
|
150
154
|
}}
|
|
151
155
|
onPress={() =>
|
|
152
156
|
setLocationSelected({
|
|
@@ -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
|
</>
|