ordering-ui-react-native 0.16.92 → 0.16.93-release
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +5 -5
- package/src/DeliveryApp.tsx +43 -1
- package/src/components/ActiveOrders/styles.tsx +8 -14
- package/src/components/BusinessInformation/index.tsx +19 -4
- package/src/components/BusinessInformation/styles.tsx +2 -2
- package/src/components/BusinessProductsList/index.tsx +1 -1
- package/src/components/BusinessesListing/index.tsx +1 -1
- package/src/components/OrderCreating/index.tsx +1 -21
- package/src/components/OrdersOption/index.tsx +54 -56
- package/src/components/PaymentOptionsWebView/index.tsx +119 -120
- package/src/components/SingleProductReview/index.tsx +7 -4
- package/src/components/VerifyPhone/styles.tsx +1 -2
- package/src/components/shared/OToast.tsx +4 -4
- package/src/utils/index.tsx +2 -1
- package/themes/business/index.tsx +2 -0
- package/themes/business/src/components/AcceptOrRejectOrder/index.tsx +265 -240
- package/themes/business/src/components/AcceptOrRejectOrder/styles.tsx +6 -4
- package/themes/business/src/components/BusinessController/index.tsx +2 -3
- package/themes/business/src/components/Chat/index.tsx +30 -30
- package/themes/business/src/components/DriverMap/index.tsx +22 -9
- package/themes/business/src/components/GoogleMap/index.tsx +58 -57
- package/themes/business/src/components/LoginForm/Otp/index.tsx +120 -0
- package/themes/business/src/components/LoginForm/Otp/styles.tsx +7 -0
- package/themes/business/src/components/LoginForm/index.tsx +239 -80
- package/themes/business/src/components/LoginForm/styles.tsx +10 -0
- package/themes/business/src/components/MapView/index.tsx +18 -7
- package/themes/business/src/components/NewOrderNotification/index.tsx +31 -41
- package/themes/business/src/components/OrderDetails/Delivery.tsx +4 -3
- package/themes/business/src/components/OrderDetails/OrderContentComponent.tsx +96 -50
- package/themes/business/src/components/OrderDetails/OrderHeaderComponent.tsx +59 -62
- package/themes/business/src/components/OrderDetailsLogistic/index.tsx +195 -0
- package/themes/business/src/components/OrderDetailsLogistic/styles.tsx +5 -0
- package/themes/business/src/components/OrderMessage/index.tsx +18 -17
- package/themes/business/src/components/OrdersOption/index.tsx +33 -75
- package/themes/business/src/components/OrdersOptionBusiness/index.tsx +1 -1
- package/themes/business/src/components/PreviousMessages/index.tsx +16 -18
- package/themes/business/src/components/PreviousOrders/OrderItem.tsx +250 -0
- package/themes/business/src/components/PreviousOrders/OrdersGroupedItem.tsx +115 -0
- package/themes/business/src/components/PreviousOrders/index.tsx +447 -247
- package/themes/business/src/components/PreviousOrders/styles.tsx +31 -3
- package/themes/business/src/components/ProductItemAccordion/index.tsx +27 -3
- package/themes/business/src/components/ReviewCustomer/index.tsx +42 -25
- package/themes/business/src/components/StoresList/index.tsx +2 -2
- package/themes/business/src/components/shared/OLink.tsx +33 -13
- package/themes/business/src/components/shared/OModal.tsx +16 -9
- package/themes/business/src/components/shared/OText.tsx +8 -2
- package/themes/business/src/types/index.tsx +33 -2
- package/themes/business/src/utils/index.tsx +53 -0
- package/themes/doordash/src/components/BusinessesListing/index.tsx +1 -1
- package/themes/doordash/src/components/LoginForm/index.tsx +1 -2
- package/themes/instacart/src/components/BusinessesListing/index.tsx +1 -1
- package/themes/kiosk/src/components/BusinessesListing/index.tsx +2 -1
- package/themes/kiosk/src/components/Checkout/index.tsx +6 -0
- package/themes/kiosk/src/components/LoginForm/Otp/index.tsx +92 -0
- package/themes/kiosk/src/components/LoginForm/Otp/styles.tsx +7 -0
- package/themes/kiosk/src/components/LoginForm/index.tsx +473 -151
- package/themes/kiosk/src/components/LoginForm/styles.tsx +14 -1
- package/themes/kiosk/src/components/NavBar/index.tsx +14 -14
- package/themes/kiosk/src/components/OptionCard/index.tsx +1 -1
- package/themes/kiosk/src/components/OrderTypeCardSelector/index.tsx +8 -10
- package/themes/kiosk/src/components/PhoneInputNumber/index.tsx +1 -0
- package/themes/kiosk/src/components/PhoneInputNumber/styles.tsx +1 -3
- package/themes/kiosk/src/components/ProductForm/index.tsx +1 -14
- package/themes/kiosk/src/components/shared/OButton.tsx +5 -18
- package/themes/kiosk/src/components/shared/OModal.tsx +14 -11
- package/themes/kiosk/src/layouts/Container.tsx +7 -1
- package/themes/kiosk/src/types/index.d.ts +13 -0
- package/themes/kiosk/src/utils/index.tsx +15 -0
- package/themes/original/index.tsx +8 -0
- package/themes/original/src/components/AddressDetails/index.tsx +10 -8
- package/themes/original/src/components/AddressForm/index.tsx +143 -115
- package/themes/original/src/components/AddressList/index.tsx +26 -21
- package/themes/original/src/components/AddressList/styles.tsx +4 -2
- package/themes/original/src/components/AnalyticsSegment/index.tsx +164 -8
- package/themes/original/src/components/AppleLogin/index.tsx +4 -4
- package/themes/original/src/components/BusinessBasicInformation/index.tsx +121 -80
- package/themes/original/src/components/BusinessBasicInformation/styles.tsx +1 -4
- package/themes/original/src/components/BusinessController/index.tsx +100 -47
- package/themes/original/src/components/BusinessController/styles.tsx +14 -9
- package/themes/original/src/components/BusinessInformation/index.tsx +10 -31
- package/themes/original/src/components/BusinessItemAccordion/index.tsx +23 -5
- package/themes/original/src/components/BusinessListingSearch/index.tsx +52 -24
- package/themes/original/src/components/BusinessPreorder/index.tsx +96 -15
- package/themes/original/src/components/BusinessProductsList/index.tsx +16 -9
- package/themes/original/src/components/BusinessProductsList/styles.tsx +0 -3
- package/themes/original/src/components/BusinessProductsListing/index.tsx +606 -490
- package/themes/original/src/components/BusinessProductsListing/styles.tsx +7 -13
- package/themes/original/src/components/BusinessTypeFilter/index.tsx +3 -2
- package/themes/original/src/components/BusinessesListing/Layout/Appointment/index.tsx +1 -1
- package/themes/original/src/components/BusinessesListing/Layout/Original/index.tsx +96 -73
- package/themes/original/src/components/BusinessesListing/Layout/Original/styles.tsx +1 -9
- package/themes/original/src/components/BusinessesListing/index.tsx +6 -6
- package/themes/original/src/components/Cart/index.tsx +93 -43
- package/themes/original/src/components/CartContent/index.tsx +77 -15
- package/themes/original/src/components/CartContent/styles.tsx +11 -1
- package/themes/original/src/components/Checkout/index.tsx +294 -175
- package/themes/original/src/components/Checkout/styles.tsx +4 -2
- package/themes/original/src/components/CitiesControl/index.tsx +89 -0
- package/themes/original/src/components/CitiesControl/styles.tsx +17 -0
- package/themes/original/src/components/CouponControl/index.tsx +10 -3
- package/themes/original/src/components/DriverTips/index.tsx +52 -37
- package/themes/original/src/components/DriverTips/styles.tsx +2 -1
- package/themes/original/src/components/Favorite/index.tsx +7 -4
- package/themes/original/src/components/Favorite/styles.tsx +1 -1
- package/themes/original/src/components/FavoriteList/index.tsx +70 -80
- package/themes/original/src/components/FloatingButton/index.tsx +1 -2
- package/themes/original/src/components/FloatingButton/styles.tsx +1 -1
- package/themes/original/src/components/GPSButton/styles.ts +3 -3
- package/themes/original/src/components/GoogleMap/index.tsx +10 -1
- package/themes/original/src/components/Help/index.tsx +8 -8
- package/themes/original/src/components/HelpAccountAndPayment/index.tsx +11 -22
- package/themes/original/src/components/HelpAccountAndPayment/styles.tsx +6 -0
- package/themes/original/src/components/HelpGuide/index.tsx +12 -16
- package/themes/original/src/components/HelpGuide/styles.tsx +6 -0
- package/themes/original/src/components/HelpOrder/index.tsx +12 -25
- package/themes/original/src/components/HelpOrder/styles.tsx +8 -1
- package/themes/original/src/components/Home/index.tsx +13 -4
- package/themes/original/src/components/LanguageSelector/index.tsx +19 -14
- package/themes/original/src/components/LastOrder/index.tsx +1 -34
- package/themes/original/src/components/LoginForm/Otp/index.tsx +89 -73
- package/themes/original/src/components/LoginForm/Otp/styles.tsx +0 -1
- package/themes/original/src/components/LoginForm/index.tsx +43 -19
- package/themes/original/src/components/LottieAnimation/index.tsx +78 -0
- package/themes/original/src/components/MessageListing/index.tsx +16 -42
- package/themes/original/src/components/Messages/index.tsx +31 -10
- package/themes/original/src/components/MomentOption/index.tsx +195 -88
- package/themes/original/src/components/MultiCart/index.tsx +50 -0
- package/themes/original/src/components/MultiCartsPaymethodsAndWallets/index.tsx +92 -93
- package/themes/original/src/components/MultiCheckout/index.tsx +210 -79
- package/themes/original/src/components/MultiOrdersDetails/SingleOrderCard.tsx +37 -224
- package/themes/original/src/components/MultiOrdersDetails/index.tsx +67 -20
- package/themes/original/src/components/MultiOrdersDetails/styles.tsx +1 -1
- package/themes/original/src/components/MyOrders/index.tsx +66 -17
- package/themes/original/src/components/NavBar/index.tsx +6 -11
- package/themes/original/src/components/NetworkError/index.tsx +5 -3
- package/themes/original/src/components/NotFoundSource/index.tsx +2 -1
- package/themes/original/src/components/Notifications/index.tsx +144 -0
- package/themes/original/src/components/Notifications/styles.tsx +20 -0
- package/themes/original/src/components/OrderDetails/OrderEta.tsx +59 -0
- package/themes/original/src/components/OrderDetails/index.tsx +110 -221
- package/themes/original/src/components/OrderDetails/styles.tsx +10 -1
- package/themes/original/src/components/OrderItAgain/index.tsx +47 -43
- package/themes/original/src/components/OrderProgress/index.tsx +74 -112
- package/themes/original/src/components/OrderProgress/styles.tsx +5 -0
- package/themes/original/src/components/OrderSummary/index.tsx +52 -17
- package/themes/original/src/components/OrderTypeSelector/index.tsx +4 -3
- package/themes/original/src/components/OrdersOption/PreviousBusinessOrdered/index.tsx +28 -19
- package/themes/original/src/components/OrdersOption/PreviousProductsOrdered/index.tsx +3 -0
- package/themes/original/src/components/OrdersOption/index.tsx +76 -83
- package/themes/original/src/components/PageBanner/index.tsx +171 -0
- package/themes/original/src/components/PageBanner/styles.tsx +11 -0
- package/themes/original/src/components/PaymentOptionStripe/styles.tsx +1 -1
- package/themes/original/src/components/PaymentOptionWallet/index.tsx +56 -56
- package/themes/original/src/components/PaymentOptions/index.tsx +2 -2
- package/themes/original/src/components/PhoneInputNumber/index.tsx +1 -1
- package/themes/original/src/components/PlaceSpot/index.tsx +12 -6
- package/themes/original/src/components/PreviousOrders/index.tsx +3 -2
- package/themes/original/src/components/ProductForm/index.tsx +247 -269
- package/themes/original/src/components/ProductForm/styles.tsx +4 -7
- package/themes/original/src/components/ProductItemAccordion/index.tsx +199 -128
- package/themes/original/src/components/ProductOptionSubOption/index.tsx +18 -10
- package/themes/original/src/components/ProductOptionSubOption/styles.tsx +1 -2
- package/themes/original/src/components/ProfessionalFilter/SingleProfessionalCard/index.tsx +108 -0
- package/themes/original/src/components/ProfessionalFilter/index.tsx +20 -49
- package/themes/original/src/components/ProfessionalProfile/index.tsx +54 -14
- package/themes/original/src/components/Promotions/index.tsx +234 -220
- package/themes/original/src/components/Promotions/styles.tsx +7 -2
- package/themes/original/src/components/ReviewDriver/index.tsx +3 -3
- package/themes/original/src/components/ReviewOrder/index.tsx +43 -11
- package/themes/original/src/components/ReviewOrder/styles.tsx +7 -0
- package/themes/original/src/components/ReviewProducts/index.tsx +8 -5
- package/themes/original/src/components/ReviewTrigger/index.tsx +27 -9
- package/themes/original/src/components/ReviewTrigger/styles.tsx +8 -1
- package/themes/original/src/components/ScheduleAccordion/index.tsx +68 -0
- package/themes/original/src/components/ScheduleAccordion/styles.tsx +14 -0
- package/themes/original/src/components/ServiceForm/index.tsx +377 -270
- package/themes/original/src/components/Sessions/index.tsx +11 -8
- package/themes/original/src/components/Sessions/styles.tsx +5 -0
- package/themes/original/src/components/SignupForm/index.tsx +79 -66
- package/themes/original/src/components/SingleOrderCard/index.tsx +126 -57
- package/themes/original/src/components/SingleOrderCard/styles.tsx +10 -8
- package/themes/original/src/components/SingleProductCard/index.tsx +106 -46
- package/themes/original/src/components/SingleProductCard/styles.tsx +19 -13
- package/themes/original/src/components/SingleProductReview/index.tsx +38 -5
- package/themes/original/src/components/SingleProductReview/styles.tsx +12 -0
- package/themes/original/src/components/StripeCardsList/index.tsx +1 -1
- package/themes/original/src/components/StripeElementsForm/index.tsx +4 -1
- package/themes/original/src/components/UpsellingProducts/index.tsx +238 -218
- package/themes/original/src/components/UpsellingProducts/styles.tsx +12 -1
- package/themes/original/src/components/UserDetails/index.tsx +8 -4
- package/themes/original/src/components/UserFormDetails/index.tsx +53 -54
- package/themes/original/src/components/UserProfile/index.tsx +58 -35
- package/themes/original/src/components/UserProfile/styles.ts +17 -0
- package/themes/original/src/components/UserProfileForm/index.tsx +21 -28
- package/themes/original/src/components/UserProfileForm/styles.tsx +7 -0
- package/themes/original/src/components/Wallets/index.tsx +20 -21
- package/themes/original/src/components/Wallets/styles.tsx +2 -0
- package/themes/original/src/components/shared/CardAnimation.tsx +47 -0
- package/themes/original/src/components/shared/HeaderTitle.tsx +8 -3
- package/themes/original/src/components/shared/OBottomPopup.tsx +1 -1
- package/themes/original/src/components/shared/OButton.tsx +6 -2
- package/themes/original/src/components/shared/OIcon.tsx +8 -1
- package/themes/original/src/components/shared/OInput.tsx +10 -1
- package/themes/original/src/components/shared/OModal.tsx +3 -3
- package/themes/original/src/layouts/Container.tsx +13 -9
- package/themes/original/src/types/index.tsx +45 -7
- package/themes/original/src/utils/index.tsx +321 -58
- package/themes/uber-eats/src/components/BusinessesListing/index.tsx +1 -1
|
@@ -0,0 +1,195 @@
|
|
|
1
|
+
//React & React Native
|
|
2
|
+
import React, { useState, useEffect } from 'react';
|
|
3
|
+
import { View } from 'react-native';
|
|
4
|
+
|
|
5
|
+
// Thirds
|
|
6
|
+
import { Placeholder, PlaceholderLine, Fade } from 'rn-placeholder';
|
|
7
|
+
|
|
8
|
+
//OrderingComponent
|
|
9
|
+
import {
|
|
10
|
+
useLanguage,
|
|
11
|
+
OrderDetails as OrderDetailsConTableoller,
|
|
12
|
+
useSession,
|
|
13
|
+
} from 'ordering-components/native';
|
|
14
|
+
|
|
15
|
+
//Components
|
|
16
|
+
import Alert from '../../providers/AlertProvider';
|
|
17
|
+
import { FloatingButton } from '../FloatingButton';
|
|
18
|
+
import { OrderDetailsLogisticParams } from '../../types';
|
|
19
|
+
import { useTheme } from 'styled-components/native';
|
|
20
|
+
import { NotFoundSource } from '../NotFoundSource';
|
|
21
|
+
import { getOrderStatus } from '../../utils';
|
|
22
|
+
import { OrderHeaderComponent } from '../OrderDetails/OrderHeaderComponent';
|
|
23
|
+
import { OrderContentComponent } from '../OrderDetails/OrderContentComponent';
|
|
24
|
+
//Styles
|
|
25
|
+
import { OrderDetailsContainer } from './styles';
|
|
26
|
+
|
|
27
|
+
export const OrderDetailsLogisticUI = (props: OrderDetailsLogisticParams) => {
|
|
28
|
+
const {
|
|
29
|
+
navigation,
|
|
30
|
+
handleClickLogisticOrder,
|
|
31
|
+
orderAssingId,
|
|
32
|
+
} = props;
|
|
33
|
+
const { order } = props.order
|
|
34
|
+
const theme = useTheme();
|
|
35
|
+
const [, t] = useLanguage();
|
|
36
|
+
const [session] = useSession();
|
|
37
|
+
const [alertState, setAlertState] = useState<{
|
|
38
|
+
open: boolean;
|
|
39
|
+
content: Array<string>;
|
|
40
|
+
key?: string | null;
|
|
41
|
+
}>({ open: false, content: [], key: null });
|
|
42
|
+
|
|
43
|
+
const logisticOrderStatus = [4, 6, 7]
|
|
44
|
+
|
|
45
|
+
const showFloatButtonsAcceptOrReject: any = {
|
|
46
|
+
0: true,
|
|
47
|
+
4: true,
|
|
48
|
+
7: true,
|
|
49
|
+
14: true
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
const handleArrowBack: any = () => {
|
|
53
|
+
navigation?.canGoBack() && navigation.goBack();
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
const handleRejectLogisticOrder = (order: any) => {
|
|
57
|
+
handleClickLogisticOrder?.(2, orderAssingId || order?.logistic_order_id, order)
|
|
58
|
+
handleArrowBack()
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
const handleAcceptLogisticOrder = (order: any) => {
|
|
62
|
+
handleClickLogisticOrder?.(1, orderAssingId || order?.logistic_order_id, order)
|
|
63
|
+
handleArrowBack()
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
useEffect(() => {
|
|
67
|
+
if (order?.driver === null && session?.user?.level === 4) {
|
|
68
|
+
setAlertState({
|
|
69
|
+
open: true,
|
|
70
|
+
content: [
|
|
71
|
+
t(
|
|
72
|
+
'YOU_HAVE_BEEN_REMOVED_FROM_THE_ORDER',
|
|
73
|
+
'You have been removed from the order',
|
|
74
|
+
),
|
|
75
|
+
],
|
|
76
|
+
key: null,
|
|
77
|
+
});
|
|
78
|
+
}
|
|
79
|
+
}, [order?.driver]);
|
|
80
|
+
|
|
81
|
+
const OrderDetailsInformation = (props: { order: any, isOrderGroup?: boolean, lastOrder?: boolean }) => {
|
|
82
|
+
const {
|
|
83
|
+
order,
|
|
84
|
+
isOrderGroup,
|
|
85
|
+
lastOrder,
|
|
86
|
+
} = props
|
|
87
|
+
return (
|
|
88
|
+
<>
|
|
89
|
+
<OrderContentComponent
|
|
90
|
+
order={order}
|
|
91
|
+
logisticOrderStatus={logisticOrderStatus}
|
|
92
|
+
isOrderGroup={isOrderGroup}
|
|
93
|
+
lastOrder={lastOrder}
|
|
94
|
+
/>
|
|
95
|
+
<View
|
|
96
|
+
style={{
|
|
97
|
+
height:
|
|
98
|
+
order?.status === 8 && order?.delivery_type === 1 ? 50 : 35,
|
|
99
|
+
}}
|
|
100
|
+
/>
|
|
101
|
+
|
|
102
|
+
</>
|
|
103
|
+
)
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
return (
|
|
107
|
+
<>
|
|
108
|
+
{(!order || Object.keys(order).length === 0) &&
|
|
109
|
+
(props.order?.error?.length < 1 || !props.order?.error) && (
|
|
110
|
+
<View style={{ flex: 1 }}>
|
|
111
|
+
{[...Array(6)].map((item, i) => (
|
|
112
|
+
<Placeholder key={i} Animation={Fade}>
|
|
113
|
+
<View style={{ flexDirection: 'row', paddingVertical: 20 }}>
|
|
114
|
+
<Placeholder>
|
|
115
|
+
<PlaceholderLine width={100} />
|
|
116
|
+
<PlaceholderLine width={70} />
|
|
117
|
+
<PlaceholderLine width={30} />
|
|
118
|
+
<PlaceholderLine width={20} />
|
|
119
|
+
</Placeholder>
|
|
120
|
+
</View>
|
|
121
|
+
</Placeholder>
|
|
122
|
+
))}
|
|
123
|
+
</View>
|
|
124
|
+
)}
|
|
125
|
+
|
|
126
|
+
{(!!props.order?.error || props.order?.error) && (
|
|
127
|
+
<NotFoundSource
|
|
128
|
+
btnTitle={t('GO_TO_MY_ORDERS', 'Go to my orders')}
|
|
129
|
+
content={
|
|
130
|
+
props.order.error[0] ||
|
|
131
|
+
props.order.error ||
|
|
132
|
+
t('NETWORK_ERROR', 'Network Error')
|
|
133
|
+
}
|
|
134
|
+
onClickButton={() => navigation.navigate('Orders')}
|
|
135
|
+
/>
|
|
136
|
+
)}
|
|
137
|
+
{!((!order || Object.keys(order).length === 0) &&
|
|
138
|
+
(props.order?.error?.length < 1 || !props.order?.error)) && (
|
|
139
|
+
<View style={{ flex: 1 }}>
|
|
140
|
+
<OrderHeaderComponent
|
|
141
|
+
order={order}
|
|
142
|
+
getOrderStatus={getOrderStatus}
|
|
143
|
+
handleArrowBack={handleArrowBack}
|
|
144
|
+
logisticOrderStatus={logisticOrderStatus}
|
|
145
|
+
/>
|
|
146
|
+
{order && Object.keys(order).length > 0 && (props.order?.error?.length < 1 || !props.order?.error) && (
|
|
147
|
+
<>
|
|
148
|
+
<OrderDetailsContainer
|
|
149
|
+
keyboardShouldPersistTaps="handled"
|
|
150
|
+
showsVerticalScrollIndicator={false}
|
|
151
|
+
>
|
|
152
|
+
{order?.order_group && order?.order_group_id && order?.isLogistic ? order?.order_group?.orders.map((order: any, i: number, hash: any) => (
|
|
153
|
+
<OrderDetailsInformation key={order?.id} order={order} isOrderGroup lastOrder={hash?.length === i + 1} />
|
|
154
|
+
)) : (
|
|
155
|
+
<OrderDetailsInformation order={order} />
|
|
156
|
+
)}
|
|
157
|
+
</OrderDetailsContainer>
|
|
158
|
+
|
|
159
|
+
{showFloatButtonsAcceptOrReject[order?.status] && (
|
|
160
|
+
<FloatingButton
|
|
161
|
+
btnText={t('REJECT', 'Reject')}
|
|
162
|
+
isSecondaryBtn={false}
|
|
163
|
+
secondButtonClick={() => handleAcceptLogisticOrder(order)}
|
|
164
|
+
firstButtonClick={() => handleRejectLogisticOrder(order)}
|
|
165
|
+
secondBtnText={t('ACCEPT', 'Accept')}
|
|
166
|
+
secondButton={true}
|
|
167
|
+
firstColorCustom={theme.colors.red}
|
|
168
|
+
secondColorCustom={theme.colors.green}
|
|
169
|
+
widthButton={'45%'}
|
|
170
|
+
/>
|
|
171
|
+
)}
|
|
172
|
+
</>
|
|
173
|
+
)}
|
|
174
|
+
</View>
|
|
175
|
+
)}
|
|
176
|
+
{alertState?.open && (
|
|
177
|
+
<Alert
|
|
178
|
+
open={alertState.open}
|
|
179
|
+
onAccept={handleArrowBack}
|
|
180
|
+
onClose={handleArrowBack}
|
|
181
|
+
content={alertState.content}
|
|
182
|
+
title={t('WARNING', 'Warning')}
|
|
183
|
+
/>
|
|
184
|
+
)}
|
|
185
|
+
</>
|
|
186
|
+
);
|
|
187
|
+
};
|
|
188
|
+
|
|
189
|
+
export const OrderDetailsLogistic = (props: OrderDetailsLogisticParams) => {
|
|
190
|
+
const orderDetailsProps = {
|
|
191
|
+
...props,
|
|
192
|
+
UIComponent: OrderDetailsLogisticUI,
|
|
193
|
+
};
|
|
194
|
+
return <OrderDetailsConTableoller {...orderDetailsProps} />;
|
|
195
|
+
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React, { useState, useEffect } from 'react';
|
|
2
2
|
import { Placeholder, PlaceholderLine, Fade } from 'rn-placeholder';
|
|
3
3
|
import { Chat } from '../Chat';
|
|
4
|
-
import { StyleSheet, View, BackHandler } from 'react-native';
|
|
4
|
+
import { StyleSheet, View, BackHandler, TouchableOpacity } from 'react-native';
|
|
5
5
|
import {
|
|
6
6
|
useLanguage,
|
|
7
7
|
OrderDetails as OrderDetailsController,
|
|
@@ -9,7 +9,7 @@ import {
|
|
|
9
9
|
} from 'ordering-components/native';
|
|
10
10
|
import { useUtils } from 'ordering-components/native';
|
|
11
11
|
|
|
12
|
-
import { OIcon,
|
|
12
|
+
import { OIcon, OText } from '../shared';
|
|
13
13
|
import { OrderDetailsParams } from '../../types';
|
|
14
14
|
import { USER_TYPE } from '../../config/constants';
|
|
15
15
|
import { useTheme } from 'styled-components/native';
|
|
@@ -146,13 +146,6 @@ export const OrderMessageUI = (props: OrderDetailsParams) => {
|
|
|
146
146
|
shadowRadius: 3.84,
|
|
147
147
|
elevation: 3,
|
|
148
148
|
},
|
|
149
|
-
cancelBtn: {
|
|
150
|
-
marginRight: 5,
|
|
151
|
-
zIndex: 10000,
|
|
152
|
-
height: 30,
|
|
153
|
-
width: 20,
|
|
154
|
-
justifyContent: 'flex-end',
|
|
155
|
-
},
|
|
156
149
|
modalText: {
|
|
157
150
|
fontFamily: 'Poppins',
|
|
158
151
|
fontStyle: 'normal',
|
|
@@ -161,6 +154,18 @@ export const OrderMessageUI = (props: OrderDetailsParams) => {
|
|
|
161
154
|
textAlign: 'center',
|
|
162
155
|
zIndex: 10,
|
|
163
156
|
},
|
|
157
|
+
btnBackArrow: {
|
|
158
|
+
borderWidth: 0,
|
|
159
|
+
width: 32,
|
|
160
|
+
height: 32,
|
|
161
|
+
tintColor: theme.colors.textGray,
|
|
162
|
+
backgroundColor: theme.colors.clear,
|
|
163
|
+
borderColor: theme.colors.clear,
|
|
164
|
+
shadowColor: theme.colors.clear,
|
|
165
|
+
paddingLeft: 0,
|
|
166
|
+
paddingRight: 0,
|
|
167
|
+
marginTop: 10
|
|
168
|
+
},
|
|
164
169
|
});
|
|
165
170
|
|
|
166
171
|
return (
|
|
@@ -260,13 +265,9 @@ export const OrderMessageUI = (props: OrderDetailsParams) => {
|
|
|
260
265
|
<>
|
|
261
266
|
<View style={styles.titleSection}>
|
|
262
267
|
<View style={styles.titleGroups}>
|
|
263
|
-
<
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
borderColor={theme.colors.clear}
|
|
267
|
-
style={styles.cancelBtn}
|
|
268
|
-
onClick={handleArrowBack}
|
|
269
|
-
/>
|
|
268
|
+
<TouchableOpacity onPress={() => handleArrowBack()} style={styles.btnBackArrow}>
|
|
269
|
+
<OIcon src={theme.images.general.arrow_left} color={theme.colors.textGray} />
|
|
270
|
+
</TouchableOpacity>
|
|
270
271
|
|
|
271
272
|
<OText size={16} style={styles.modalText} adjustsFontSizeToFit>
|
|
272
273
|
{`${t('INVOICE_ORDER_NO', 'Order No.')} ${order?.id}`}
|
|
@@ -292,7 +293,7 @@ export const OrderMessageUI = (props: OrderDetailsParams) => {
|
|
|
292
293
|
<OIcon
|
|
293
294
|
url={optimizeImage(
|
|
294
295
|
order?.customer?.photo ||
|
|
295
|
-
|
|
296
|
+
theme?.images?.dummies?.customerPhoto,
|
|
296
297
|
'h_300,c_limit',
|
|
297
298
|
)}
|
|
298
299
|
style={styles.titleIcons}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React, { useEffect, useState, useRef } from 'react';
|
|
2
|
-
import { View, Pressable, StyleSheet, ScrollView, RefreshControl,
|
|
3
|
-
import { useLanguage, useUtils, useToast,
|
|
2
|
+
import { View, Pressable, StyleSheet, ScrollView, RefreshControl, Platform, TouchableOpacity } from 'react-native';
|
|
3
|
+
import { useLanguage, useUtils, useToast, OrderListGroups, useConfig } from 'ordering-components/native';
|
|
4
4
|
import SelectDropdown from 'react-native-select-dropdown'
|
|
5
5
|
import { Placeholder, PlaceholderLine, Fade } from 'rn-placeholder';
|
|
6
6
|
import FeatherIcon from 'react-native-vector-icons/Feather';
|
|
@@ -20,7 +20,6 @@ import {
|
|
|
20
20
|
IconWrapper,
|
|
21
21
|
ModalContainer,
|
|
22
22
|
ModalTitle,
|
|
23
|
-
FilterBtnWrapper,
|
|
24
23
|
TabPressable,
|
|
25
24
|
OrderStatus,
|
|
26
25
|
SlaOption,
|
|
@@ -34,42 +33,17 @@ import {
|
|
|
34
33
|
ItemContent,
|
|
35
34
|
TimerInputWrapper,
|
|
36
35
|
OverLine,
|
|
37
|
-
Actions,
|
|
38
36
|
InputContainer
|
|
39
37
|
} from './styles';
|
|
40
38
|
import { PreviousOrders } from '../PreviousOrders';
|
|
41
39
|
import { OrdersOptionParams } from '../../types';
|
|
42
40
|
|
|
43
|
-
import { TouchableOpacity } from 'react-native-gesture-handler';
|
|
44
|
-
import GestureRecognizer from 'react-native-swipe-gestures';
|
|
45
|
-
import ODropDown from '../shared/ODropDown';
|
|
46
|
-
import { OrdersOptionStatus } from '../OrdersOptionStatus'
|
|
47
41
|
import { OrdersOptionCity } from '../OrdersOptionCity';
|
|
48
42
|
import { OrdersOptionBusiness } from '../OrdersOptionBusiness';
|
|
49
43
|
import { OrdersOptionDelivery } from '../OrdersOptionDelivery';
|
|
50
44
|
import { OrdersOptionPaymethod } from '../OrdersOptionPaymethod';
|
|
51
45
|
import { OrdersOptionDriver } from '../OrdersOptionDriver';
|
|
52
46
|
import { OrdersOptionDate } from '../OrdersOptionDate';
|
|
53
|
-
import { GestureEvent, GestureDetector } from 'react-native-gesture-handler'
|
|
54
|
-
const tabsList: any = {
|
|
55
|
-
pending: 1,
|
|
56
|
-
inProgress: 2,
|
|
57
|
-
completed: 3,
|
|
58
|
-
cancelled: 4
|
|
59
|
-
};
|
|
60
|
-
|
|
61
|
-
const tabsListText: any = {
|
|
62
|
-
1: 'pending',
|
|
63
|
-
2: 'inProgress',
|
|
64
|
-
3: 'completed',
|
|
65
|
-
4: 'cancelled'
|
|
66
|
-
};
|
|
67
|
-
|
|
68
|
-
const swipeConfig = {
|
|
69
|
-
velocityThreshold: 0.3,
|
|
70
|
-
directionalOffsetThreshold: 80
|
|
71
|
-
};
|
|
72
|
-
|
|
73
47
|
const { useDeviceOrientation, PORTRAIT } = DeviceOrientationMethods
|
|
74
48
|
|
|
75
49
|
const OrdersOptionUI = (props: OrdersOptionParams) => {
|
|
@@ -81,10 +55,10 @@ const OrdersOptionUI = (props: OrdersOptionParams) => {
|
|
|
81
55
|
ordersGroup,
|
|
82
56
|
setOrdersGroup,
|
|
83
57
|
orderStatus,
|
|
58
|
+
ordersFormatted,
|
|
84
59
|
loadOrders,
|
|
85
60
|
loadMoreOrders,
|
|
86
61
|
onNavigationRedirect,
|
|
87
|
-
filtered,
|
|
88
62
|
onFiltered,
|
|
89
63
|
handleClickOrder,
|
|
90
64
|
isBusinessApp,
|
|
@@ -92,7 +66,9 @@ const OrdersOptionUI = (props: OrdersOptionParams) => {
|
|
|
92
66
|
logisticOrders,
|
|
93
67
|
loadLogisticOrders,
|
|
94
68
|
isLogisticActivated,
|
|
95
|
-
isAlsea
|
|
69
|
+
isAlsea,
|
|
70
|
+
handleChangeOrderStatus,
|
|
71
|
+
handleSendCustomerReview
|
|
96
72
|
} = props;
|
|
97
73
|
|
|
98
74
|
const defaultSearchList = {
|
|
@@ -122,7 +98,7 @@ const OrdersOptionUI = (props: OrdersOptionParams) => {
|
|
|
122
98
|
const [slaSettingTime, setSlaSettingTime] = useState(6000)
|
|
123
99
|
const [currentDeliveryType, setCurrentDeliveryType] = useState('Delivery')
|
|
124
100
|
const [search, setSearch] = useState(defaultSearchList)
|
|
125
|
-
const [selectedTabStatus, setSelectedTabStatus] = useState([])
|
|
101
|
+
const [selectedTabStatus, setSelectedTabStatus] = useState<any>([])
|
|
126
102
|
const [hour, setHour] = useState(0)
|
|
127
103
|
const [minute, setMinute] = useState(0)
|
|
128
104
|
const [openedSelect, setOpenedSelect] = useState('')
|
|
@@ -263,6 +239,19 @@ const OrdersOptionUI = (props: OrdersOptionParams) => {
|
|
|
263
239
|
overflow: 'hidden',
|
|
264
240
|
minHeight: 155
|
|
265
241
|
},
|
|
242
|
+
btnBackArrow: {
|
|
243
|
+
borderWidth: 0,
|
|
244
|
+
width: 32,
|
|
245
|
+
height: 32,
|
|
246
|
+
tintColor: theme.colors.textGray,
|
|
247
|
+
backgroundColor: theme.colors.clear,
|
|
248
|
+
borderColor: theme.colors.clear,
|
|
249
|
+
shadowColor: theme.colors.clear,
|
|
250
|
+
paddingLeft: 0,
|
|
251
|
+
paddingRight: 0,
|
|
252
|
+
marginBottom: 30,
|
|
253
|
+
marginTop: 30
|
|
254
|
+
},
|
|
266
255
|
rowStyle: {
|
|
267
256
|
display: 'flex',
|
|
268
257
|
borderBottomWidth: 0,
|
|
@@ -346,26 +335,6 @@ const OrdersOptionUI = (props: OrdersOptionParams) => {
|
|
|
346
335
|
})
|
|
347
336
|
}
|
|
348
337
|
|
|
349
|
-
const onSwipeLeft = () => {
|
|
350
|
-
let currentTab = tabsList[currentTabSelected]
|
|
351
|
-
currentTab = currentTab >= 4 ? null : currentTab + 1
|
|
352
|
-
|
|
353
|
-
if (!currentTab) return
|
|
354
|
-
|
|
355
|
-
const nextTab = tabsListText[currentTab]
|
|
356
|
-
nextTab && setCurrentTabSelected(nextTab)
|
|
357
|
-
}
|
|
358
|
-
|
|
359
|
-
const onSwipeRight = () => {
|
|
360
|
-
let currentTab = tabsList[currentTabSelected]
|
|
361
|
-
currentTab = currentTab <= 1 ? null : currentTab - 1
|
|
362
|
-
|
|
363
|
-
if (!currentTab) return
|
|
364
|
-
|
|
365
|
-
const nextTab = tabsListText[currentTab]
|
|
366
|
-
nextTab && setCurrentTabSelected(nextTab)
|
|
367
|
-
}
|
|
368
|
-
|
|
369
338
|
const calculateDate = (type: any, from: any, to: any) => {
|
|
370
339
|
switch (type) {
|
|
371
340
|
case 'today':
|
|
@@ -413,19 +382,14 @@ const OrdersOptionUI = (props: OrdersOptionParams) => {
|
|
|
413
382
|
scrollRefTab.current?.scrollTo({ animated: true });
|
|
414
383
|
scrollListRef.current?.scrollTo({ animated: true });
|
|
415
384
|
scrollRef.current?.scrollTo({ y: 0, animated: true });
|
|
385
|
+
setTags({ values: [] })
|
|
416
386
|
}, [currentTabSelected])
|
|
417
387
|
|
|
418
388
|
useEffect(() => {
|
|
419
389
|
setSelectedTabStatus(deliveryStatus)
|
|
420
390
|
}, [])
|
|
421
|
-
|
|
391
|
+
|
|
422
392
|
return (
|
|
423
|
-
// <GestureRecognizer
|
|
424
|
-
// onSwipeLeft={onSwipeLeft}
|
|
425
|
-
// onSwipeRight={onSwipeRight}
|
|
426
|
-
// config={swipeConfig}
|
|
427
|
-
// style={{ flex: 1 }}
|
|
428
|
-
// >
|
|
429
393
|
<>
|
|
430
394
|
<View style={styles.header}>
|
|
431
395
|
<OText style={styles.title}>{t('MY_ORDERS', 'My orders')}</OText>
|
|
@@ -634,12 +598,18 @@ const OrdersOptionUI = (props: OrdersOptionParams) => {
|
|
|
634
598
|
currentTabSelected !== 'logisticOrders' &&
|
|
635
599
|
(
|
|
636
600
|
<PreviousOrders
|
|
637
|
-
orders={
|
|
601
|
+
orders={ordersFormatted}
|
|
602
|
+
navigation={props.navigation}
|
|
638
603
|
onNavigationRedirect={onNavigationRedirect}
|
|
639
604
|
getOrderStatus={getOrderStatus}
|
|
640
605
|
handleClickOrder={handleClickOrder}
|
|
641
606
|
slaSettingTime={slaSettingTime}
|
|
642
607
|
currentTabSelected={currentTabSelected}
|
|
608
|
+
appTitle={props.orderDetailsProps?.appTitle}
|
|
609
|
+
actions={props.orderDetailsProps?.actions}
|
|
610
|
+
orderTitle={props.orderDetailsProps?.orderTitle}
|
|
611
|
+
handleChangeOrderStatus={handleChangeOrderStatus}
|
|
612
|
+
handleSendCustomerReview={handleSendCustomerReview}
|
|
643
613
|
/>
|
|
644
614
|
)}
|
|
645
615
|
{!logisticOrders?.error?.length &&
|
|
@@ -729,7 +699,6 @@ const OrdersOptionUI = (props: OrdersOptionParams) => {
|
|
|
729
699
|
)}
|
|
730
700
|
</ScrollView>
|
|
731
701
|
</View>
|
|
732
|
-
{/* </GestureRecognizer> */}
|
|
733
702
|
|
|
734
703
|
{isBusinessApp && (
|
|
735
704
|
<NewOrderNotification isBusinessApp={isBusinessApp} />
|
|
@@ -740,20 +709,9 @@ const OrdersOptionUI = (props: OrdersOptionParams) => {
|
|
|
740
709
|
<ModalContainer
|
|
741
710
|
nestedScrollEnabled={true}
|
|
742
711
|
>
|
|
743
|
-
<
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
iconColor={theme.colors.backArrow}
|
|
747
|
-
iconStyle={{ width: 20, height: 13 }}
|
|
748
|
-
style={{
|
|
749
|
-
maxWidth: 40,
|
|
750
|
-
height: 35,
|
|
751
|
-
justifyContent: 'flex-end',
|
|
752
|
-
marginBottom: 30,
|
|
753
|
-
marginTop: 30
|
|
754
|
-
}}
|
|
755
|
-
onClick={() => handleClose()}
|
|
756
|
-
/>
|
|
712
|
+
<TouchableOpacity onPress={() => handleClose()} style={styles.btnBackArrow}>
|
|
713
|
+
<OIcon src={theme.images.general.arrow_left} color={theme.colors.textGray} />
|
|
714
|
+
</TouchableOpacity>
|
|
757
715
|
{openSearchModal && (
|
|
758
716
|
<SearchModalContent>
|
|
759
717
|
<ModalTitle>{t('SEARCH_ORDERS', 'Search orders')}</ModalTitle>
|
|
@@ -883,7 +841,7 @@ const OrdersOptionUI = (props: OrdersOptionParams) => {
|
|
|
883
841
|
</ScrollView>
|
|
884
842
|
</FiltersTab>
|
|
885
843
|
<DeliveryStatusWrapper>
|
|
886
|
-
{selectedTabStatus && selectedTabStatus.length > 0 && selectedTabStatus.map((item, i) => (
|
|
844
|
+
{selectedTabStatus && selectedTabStatus.length > 0 && selectedTabStatus.map((item: any, i: number) => (
|
|
887
845
|
<StatusBlock
|
|
888
846
|
key={i}
|
|
889
847
|
item={item}
|
|
@@ -176,17 +176,17 @@ export const PreviousMessages = (props: PreviousMessagesParams) => {
|
|
|
176
176
|
slug: 'ORDER_CUSTOMER_ARRIVED_BUSINESS',
|
|
177
177
|
percentage: 95,
|
|
178
178
|
},
|
|
179
|
-
{
|
|
180
|
-
key: 22,
|
|
181
|
-
value: t('ORDER_LOOKING_FOR_DRIVER', 'Looking for driver'),
|
|
182
|
-
slug: 'ORDER_LOOKING_FOR_DRIVER',
|
|
179
|
+
{
|
|
180
|
+
key: 22,
|
|
181
|
+
value: t('ORDER_LOOKING_FOR_DRIVER', 'Looking for driver'),
|
|
182
|
+
slug: 'ORDER_LOOKING_FOR_DRIVER',
|
|
183
183
|
percentage: 35
|
|
184
184
|
},
|
|
185
|
-
{
|
|
186
|
-
key: 23,
|
|
187
|
-
value: t('ORDER_DRIVER_ON_WAY', 'Driver on way'),
|
|
188
|
-
slug: 'ORDER_DRIVER_ON_WAY',
|
|
189
|
-
percentage: 45
|
|
185
|
+
{
|
|
186
|
+
key: 23,
|
|
187
|
+
value: t('ORDER_DRIVER_ON_WAY', 'Driver on way'),
|
|
188
|
+
slug: 'ORDER_DRIVER_ON_WAY',
|
|
189
|
+
percentage: 45
|
|
190
190
|
}
|
|
191
191
|
];
|
|
192
192
|
|
|
@@ -266,15 +266,13 @@ export const PreviousMessages = (props: PreviousMessagesParams) => {
|
|
|
266
266
|
style={styles.cardButton}
|
|
267
267
|
activeOpacity={1}>
|
|
268
268
|
<Card key={order?.id}>
|
|
269
|
-
{
|
|
270
|
-
<
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
)}
|
|
277
|
-
|
|
269
|
+
<Logo style={styles.logo}>
|
|
270
|
+
<OIcon
|
|
271
|
+
url={optimizeImage(order?.business?.logo, 'h_300,c_limit')}
|
|
272
|
+
src={!order?.business?.logo && theme?.images?.dummies?.businessLogo}
|
|
273
|
+
style={styles.icon}
|
|
274
|
+
/>
|
|
275
|
+
</Logo>
|
|
278
276
|
<Information>
|
|
279
277
|
<Header>
|
|
280
278
|
<OText numberOfLines={1} style={styles.title}>
|