ordering-ui-react-native 0.21.49-test → 0.21.49-test-v2
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/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/MessagesOption/index.tsx +2 -1
- 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/OrdersListManager/index.tsx +7 -2
- package/themes/business/src/components/OrdersOption/index.tsx +4 -0
- package/themes/business/src/components/PreviousOrders/OrderList.tsx +17 -12
- package/themes/business/src/components/PreviousOrders/index.tsx +77 -65
- package/themes/business/src/components/WebsocketStatus/index.tsx +171 -0
- package/themes/business/src/components/WebsocketStatus/styles.tsx +28 -0
- package/themes/kiosk/src/components/LoginForm/index.tsx +7 -4
- package/themes/original/index.tsx +6 -2
- package/themes/original/src/components/AddressForm/index.tsx +2 -2
- package/themes/original/src/components/AddressForm/styles.tsx +1 -1
- package/themes/original/src/components/AddressList/styles.tsx +4 -4
- package/themes/original/src/components/BusinessBasicInformation/index.tsx +2 -2
- package/themes/original/src/components/BusinessBasicInformation/styles.tsx +1 -1
- package/themes/original/src/components/BusinessInformation/index.tsx +0 -1
- package/themes/original/src/components/BusinessInformation/styles.tsx +2 -2
- package/themes/original/src/components/BusinessItemAccordion/index.tsx +11 -7
- package/themes/original/src/components/BusinessListingSearch/index.tsx +2 -3
- package/themes/original/src/components/BusinessListingSearch/styles.tsx +1 -1
- package/themes/original/src/components/BusinessPreorder/index.tsx +2 -2
- package/themes/original/src/components/BusinessProductsCategories/index.tsx +1 -1
- package/themes/original/src/components/BusinessProductsList/index.tsx +2 -2
- package/themes/original/src/components/BusinessProductsListing/index.tsx +12 -8
- package/themes/original/src/components/BusinessProductsListing/styles.tsx +2 -2
- package/themes/original/src/components/BusinessReviews/index.tsx +1 -1
- package/themes/original/src/components/BusinessesListing/Layout/Appointment/index.tsx +1 -1
- package/themes/original/src/components/BusinessesListing/Layout/Appointment/styles.tsx +5 -5
- package/themes/original/src/components/BusinessesListing/Layout/Original/FlatListBusinessListFooter.tsx +69 -0
- package/themes/original/src/components/BusinessesListing/Layout/Original/FlatListBusinessListHeader.tsx +406 -0
- package/themes/original/src/components/BusinessesListing/Layout/Original/FlatListBusinessListing.tsx +76 -0
- package/themes/original/src/components/BusinessesListing/Layout/Original/index.tsx +23 -403
- package/themes/original/src/components/BusinessesListing/Layout/Original/styles.tsx +1 -1
- package/themes/original/src/components/Cart/index.tsx +15 -4
- package/themes/original/src/components/CartContent/index.tsx +59 -38
- package/themes/original/src/components/CartStoresListing/styles.tsx +2 -2
- package/themes/original/src/components/Checkout/index.tsx +47 -9
- package/themes/original/src/components/Checkout/styles.tsx +17 -0
- package/themes/original/src/components/CitiesControl/styles.tsx +1 -1
- package/themes/original/src/components/DatePicker/index.tsx +17 -0
- package/themes/original/src/components/DatePicker/styles.tsx +20 -0
- package/themes/original/src/components/Favorite/index.tsx +1 -3
- package/themes/original/src/components/Favorite/styles.tsx +0 -2
- package/themes/original/src/components/FloatingButton/styles.tsx +1 -1
- package/themes/original/src/components/GPSButton/index.tsx +1 -1
- package/themes/original/src/components/GiftCard/GiftCardUI/index.tsx +8 -3
- package/themes/original/src/components/GiftCard/PurchaseGiftCard/index.tsx +36 -3
- package/themes/original/src/components/GiftCard/PurchaseGiftCard/styles.tsx +1 -1
- package/themes/original/src/components/GiftCard/RedeemGiftCard/index.tsx +67 -4
- package/themes/original/src/components/GiftCard/RedeemGiftCard/styles.tsx +1 -1
- package/themes/original/src/components/GiftCard/SendGiftCard/styles.tsx +1 -1
- package/themes/original/src/components/HighestRatedBusinesses/index.tsx +1 -1
- package/themes/original/src/components/HighestRatedBusinesses/styles.tsx +1 -1
- package/themes/original/src/components/Home/index.tsx +1 -1
- package/themes/original/src/components/LastOrder/index.tsx +2 -1
- package/themes/original/src/components/LastOrders/index.tsx +2 -1
- package/themes/original/src/components/Messages/styles.tsx +1 -1
- package/themes/original/src/components/MomentOption/index.tsx +3 -3
- package/themes/original/src/components/MultiCart/index.tsx +1 -1
- package/themes/original/src/components/MultiCheckout/index.tsx +140 -18
- package/themes/original/src/components/MultiOrdersDetails/index.tsx +1 -1
- package/themes/original/src/components/MyOrders/index.tsx +5 -5
- package/themes/original/src/components/NavBar/index.tsx +0 -1
- package/themes/original/src/components/NetworkError/styles.tsx +2 -2
- package/themes/original/src/components/Notifications/index.tsx +2 -4
- package/themes/original/src/components/Notifications/styles.tsx +0 -1
- package/themes/original/src/components/OrderDetails/OrderHistory.tsx +1 -1
- package/themes/original/src/components/OrderDetails/index.tsx +709 -664
- package/themes/original/src/components/OrderDetails/styles.tsx +24 -7
- package/themes/original/src/components/OrderProgress/index.tsx +2 -1
- package/themes/original/src/components/OrderProgress/styles.tsx +1 -1
- package/themes/original/src/components/OrderSummary/index.tsx +3 -1
- package/themes/original/src/components/OrdersOption/PreviousBusinessOrdered/styles.tsx +1 -1
- package/themes/original/src/components/OrdersOption/PreviousProductsOrdered/styles.tsx +1 -1
- package/themes/original/src/components/OrdersOption/index.tsx +1 -1
- package/themes/original/src/components/OrdersOption/styles.tsx +1 -1
- package/themes/original/src/components/PaymentOptions/index.tsx +3 -1
- package/themes/original/src/components/ProductForm/ActionButton.tsx +117 -0
- package/themes/original/src/components/ProductForm/ExtraOptions.tsx +56 -0
- package/themes/original/src/components/ProductForm/index.tsx +52 -146
- package/themes/original/src/components/ProductItemAccordion/index.tsx +5 -0
- package/themes/original/src/components/ProductOptionSubOption/index.tsx +1 -1
- package/themes/original/src/components/ProfessionalProfile/styles.tsx +3 -3
- package/themes/original/src/components/Promotions/index.tsx +2 -3
- package/themes/original/src/components/Promotions/styles.tsx +0 -2
- package/themes/original/src/components/ReviewDriver/styles.tsx +1 -1
- package/themes/original/src/components/ReviewOrder/styles.tsx +1 -1
- package/themes/original/src/components/ReviewProducts/styles.tsx +1 -1
- package/themes/original/src/components/ServiceForm/index.tsx +1 -1
- package/themes/original/src/components/ServiceForm/styles.tsx +4 -4
- package/themes/original/src/components/StripeElementsForm/index.tsx +1 -1
- package/themes/original/src/components/UpsellingProducts/UpsellingContent.tsx +170 -0
- package/themes/original/src/components/UpsellingProducts/UpsellingLayout.tsx +86 -0
- package/themes/original/src/components/UpsellingProducts/index.tsx +15 -199
- package/themes/original/src/components/UpsellingProducts/styles.tsx +19 -0
- package/themes/original/src/components/UserFormDetails/index.tsx +51 -4
- package/themes/original/src/components/UserProfile/index.tsx +1 -1
- package/themes/original/src/components/WalletTransactions/styles.tsx +1 -0
- package/themes/original/src/components/Wallets/index.tsx +1 -0
- package/themes/original/src/components/Wallets/styles.tsx +0 -1
- package/themes/original/src/components/shared/OModal.tsx +12 -14
- package/themes/original/src/layouts/Container.tsx +1 -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.49-test",
|
|
3
|
+
"version": "0.21.49-test-v2",
|
|
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.0.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",
|
|
@@ -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({
|
|
@@ -12,6 +12,7 @@ import { PreviousMessages } from '../PreviousMessages';
|
|
|
12
12
|
import { FiltersTab, TabsContainer, TagsContainer, Tag } from './styles';
|
|
13
13
|
import { MessagesOptionParams } from '../../types';
|
|
14
14
|
import { useDeviceOrientation } from '../../../../../src/hooks/DeviceOrientation';
|
|
15
|
+
import { WebsocketStatus } from '../WebsocketStatus'
|
|
15
16
|
|
|
16
17
|
const MessagesOptionUI = (props: MessagesOptionParams) => {
|
|
17
18
|
const {
|
|
@@ -163,7 +164,7 @@ const MessagesOptionUI = (props: MessagesOptionParams) => {
|
|
|
163
164
|
<View style={styles.header}>
|
|
164
165
|
<OText style={styles.title}>{t('MESSAGES', 'Messages')}</OText>
|
|
165
166
|
</View>
|
|
166
|
-
|
|
167
|
+
<WebsocketStatus />
|
|
167
168
|
<FiltersTab>
|
|
168
169
|
<TabsContainer width={dimensions.width - 42}>
|
|
169
170
|
{tabs.map((tab: any) => (
|
|
@@ -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%'}
|
|
@@ -40,6 +40,7 @@ import { OrdersOptionPaymethod } from '../OrdersOptionPaymethod';
|
|
|
40
40
|
import { OrdersOptionDriver } from '../OrdersOptionDriver';
|
|
41
41
|
import { OrdersOptionDate } from '../OrdersOptionDate';
|
|
42
42
|
import { OrderDetailsBusiness } from '../OrderDetails/Business';
|
|
43
|
+
import { WebsocketStatus } from '../WebsocketStatus'
|
|
43
44
|
|
|
44
45
|
const { useDeviceOrientation, PORTRAIT } = DeviceOrientationMethods
|
|
45
46
|
|
|
@@ -314,7 +315,11 @@ const OrdersListManagerUI = (props: OrdersOptionParams) => {
|
|
|
314
315
|
</View>
|
|
315
316
|
{configState?.configs?.order_deadlines_enabled?.value === '1' && (
|
|
316
317
|
<View style={styles.SLAwrapper}>
|
|
317
|
-
<View style={{ flex:
|
|
318
|
+
<View style={{ flex: 1 }}>
|
|
319
|
+
<WebsocketStatus />
|
|
320
|
+
</View>
|
|
321
|
+
<View style={{ width: 10, height: '100%' }} />
|
|
322
|
+
<View style={{ flex: 1 }}>
|
|
318
323
|
<OButton
|
|
319
324
|
text={t('SLA_SETTING', 'SLA’s Settings')}
|
|
320
325
|
textStyle={{ color: theme.colors.backArrow }}
|
|
@@ -330,7 +335,7 @@ const OrdersListManagerUI = (props: OrdersOptionParams) => {
|
|
|
330
335
|
/>
|
|
331
336
|
</View>
|
|
332
337
|
<View style={{ width: 10, height: '100%' }} />
|
|
333
|
-
<View style={{ flex:
|
|
338
|
+
<View style={{ flex: 1, justifyContent: 'center' }}>
|
|
334
339
|
<SelectDropdown
|
|
335
340
|
defaultButtonText={t('SLA', 'SLA\'s')}
|
|
336
341
|
data={preorderTypeList}
|
|
@@ -11,6 +11,7 @@ import { useTheme } from 'styled-components/native';
|
|
|
11
11
|
import { DeviceOrientationMethods } from '../../../../../src/hooks/DeviceOrientation'
|
|
12
12
|
import { NotificationSetting } from '../../../../../src/components/NotificationSetting'
|
|
13
13
|
import { NewOrderNotification } from '../NewOrderNotification';
|
|
14
|
+
import { WebsocketStatus } from '../WebsocketStatus'
|
|
14
15
|
|
|
15
16
|
import { OText, OButton, OModal, OInput, OIcon } from '../shared';
|
|
16
17
|
import { NotFoundSource } from '../NotFoundSource';
|
|
@@ -407,6 +408,7 @@ const OrdersOptionUI = (props: OrdersOptionParams) => {
|
|
|
407
408
|
/>
|
|
408
409
|
</IconWrapper>
|
|
409
410
|
</View>
|
|
411
|
+
<WebsocketStatus />
|
|
410
412
|
{configState?.configs?.order_deadlines_enabled?.value === '1' && (
|
|
411
413
|
<View style={styles.SLAwrapper}>
|
|
412
414
|
<View style={{ flex: 0.5 }}>
|
|
@@ -608,6 +610,7 @@ const OrdersOptionUI = (props: OrdersOptionParams) => {
|
|
|
608
610
|
orderTitle={props.orderDetailsProps?.orderTitle}
|
|
609
611
|
handleChangeOrderStatus={handleChangeOrderStatus}
|
|
610
612
|
handleSendCustomerReview={handleSendCustomerReview}
|
|
613
|
+
isBusinessApp={isBusinessApp}
|
|
611
614
|
/>
|
|
612
615
|
)}
|
|
613
616
|
{!logisticOrders?.error?.length &&
|
|
@@ -618,6 +621,7 @@ const OrdersOptionUI = (props: OrdersOptionParams) => {
|
|
|
618
621
|
onNavigationRedirect={onNavigationRedirect}
|
|
619
622
|
getOrderStatus={getOrderStatus}
|
|
620
623
|
handleClickLogisticOrder={handleClickLogisticOrder}
|
|
624
|
+
isBusinessApp={isBusinessApp}
|
|
621
625
|
isLogisticOrder
|
|
622
626
|
/>
|
|
623
627
|
)
|
|
@@ -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
|
</>
|