ordering-ui-react-native 0.17.98 → 0.17.99-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 +9 -7
- package/src/DeliveryApp.tsx +43 -1
- package/src/components/BusinessInformation/index.tsx +10 -9
- package/src/components/BusinessesListing/index.tsx +1 -1
- package/src/components/OrderCreating/index.tsx +0 -20
- package/src/components/PaymentOptionsWebView/index.tsx +29 -8
- package/src/components/PhoneInputNumber/index.tsx +6 -2
- package/src/components/StripeMethodForm/index.tsx +136 -102
- package/src/components/VerifyPhone/styles.tsx +1 -2
- package/src/components/shared/OToast.tsx +3 -2
- package/src/types/index.tsx +5 -0
- package/src/utils/index.tsx +7 -2
- package/themes/business/index.tsx +2 -0
- package/themes/business/src/components/AcceptOrRejectOrder/index.tsx +36 -26
- package/themes/business/src/components/BusinessController/index.tsx +0 -1
- package/themes/business/src/components/Chat/index.tsx +163 -123
- package/themes/business/src/components/DriverMap/index.tsx +17 -6
- package/themes/business/src/components/DriverSchedule/index.tsx +45 -8
- package/themes/business/src/components/FloatingButton/index.tsx +34 -31
- package/themes/business/src/components/GoogleMap/index.tsx +58 -57
- package/themes/business/src/components/LoginForm/index.tsx +5 -2
- package/themes/business/src/components/MapView/index.tsx +14 -10
- package/themes/business/src/components/MessagesOption/index.tsx +22 -94
- package/themes/business/src/components/NewOrderNotification/index.tsx +123 -96
- package/themes/business/src/components/NotFoundSource/index.tsx +2 -2
- package/themes/business/src/components/OrderDetails/Business.tsx +1 -1
- package/themes/business/src/components/OrderDetails/Delivery.tsx +209 -15
- package/themes/business/src/components/OrderDetails/OrderContentComponent.tsx +84 -37
- package/themes/business/src/components/OrderDetails/OrderHeaderComponent.tsx +87 -66
- package/themes/business/src/components/OrderDetailsLogistic/index.tsx +200 -0
- package/themes/business/src/components/OrderDetailsLogistic/styles.tsx +5 -0
- package/themes/business/src/components/OrderMessage/index.tsx +19 -18
- package/themes/business/src/components/OrderSummary/index.tsx +114 -123
- package/themes/business/src/components/OrdersListManager/index.tsx +7 -2
- package/themes/business/src/components/OrdersListManager/utils.tsx +1 -1
- package/themes/business/src/components/OrdersOption/index.tsx +60 -47
- package/themes/business/src/components/PreviousMessages/FooterMessageComponent.tsx +103 -0
- package/themes/business/src/components/PreviousMessages/index.tsx +97 -55
- package/themes/business/src/components/PreviousOrders/OrderItem.tsx +21 -29
- package/themes/business/src/components/PreviousOrders/OrderList.tsx +93 -0
- package/themes/business/src/components/PreviousOrders/OrdersGroupedItem.tsx +1 -1
- package/themes/business/src/components/PreviousOrders/index.tsx +198 -221
- package/themes/business/src/components/PreviousOrders/styles.tsx +10 -0
- package/themes/business/src/components/ProductItemAccordion/index.tsx +7 -1
- package/themes/business/src/components/ReviewCustomer/index.tsx +18 -13
- package/themes/business/src/components/StoresList/index.tsx +3 -4
- package/themes/business/src/components/UserProfileForm/index.tsx +14 -15
- package/themes/business/src/components/WebsocketStatus/index.tsx +171 -0
- package/themes/business/src/components/WebsocketStatus/styles.tsx +28 -0
- package/themes/business/src/components/shared/OModal.tsx +16 -9
- package/themes/business/src/types/index.tsx +24 -10
- package/themes/business/src/utils/index.tsx +29 -2
- 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/Checkout/index.tsx +6 -0
- package/themes/kiosk/src/components/Intro/index.tsx +16 -1
- package/themes/kiosk/src/components/LoginForm/index.tsx +7 -5
- 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 +2 -2
- package/themes/kiosk/src/components/shared/OButton.tsx +5 -18
- package/themes/original/index.tsx +7 -3
- package/themes/original/src/components/AddressDetails/index.tsx +19 -3
- package/themes/original/src/components/AddressForm/index.tsx +33 -15
- package/themes/original/src/components/AddressList/index.tsx +5 -8
- package/themes/original/src/components/AnalyticsSegment/index.tsx +193 -10
- package/themes/original/src/components/AppleLogin/index.tsx +4 -4
- package/themes/original/src/components/AppleLogin/styles.tsx +3 -1
- package/themes/original/src/components/BusinessBasicInformation/index.tsx +72 -36
- package/themes/original/src/components/BusinessBasicInformation/styles.tsx +10 -12
- package/themes/original/src/components/BusinessController/index.tsx +35 -44
- package/themes/original/src/components/BusinessController/styles.tsx +12 -5
- package/themes/original/src/components/BusinessFeaturedController/index.tsx +21 -54
- package/themes/original/src/components/BusinessFeaturedController/styles.tsx +8 -0
- package/themes/original/src/components/BusinessInformation/index.tsx +140 -85
- package/themes/original/src/components/BusinessItemAccordion/index.tsx +21 -23
- package/themes/original/src/components/BusinessListingSearch/MaxSectionItem/index.tsx +1 -1
- package/themes/original/src/components/BusinessListingSearch/index.tsx +346 -340
- package/themes/original/src/components/BusinessListingSearch/styles.tsx +0 -18
- package/themes/original/src/components/BusinessPreorder/index.tsx +105 -22
- package/themes/original/src/components/BusinessPreorder/styles.tsx +14 -0
- package/themes/original/src/components/BusinessProductsCategories/index.tsx +1 -2
- package/themes/original/src/components/BusinessProductsList/index.tsx +15 -7
- package/themes/original/src/components/BusinessProductsList/styles.tsx +8 -3
- package/themes/original/src/components/BusinessProductsListing/UpsellingRedirect.tsx +1 -1
- package/themes/original/src/components/BusinessProductsListing/index.tsx +137 -32
- package/themes/original/src/components/BusinessProductsListing/styles.tsx +2 -3
- package/themes/original/src/components/BusinessReviews/index.tsx +3 -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 +37 -404
- package/themes/original/src/components/BusinessesListing/index.tsx +0 -1
- package/themes/original/src/components/Cart/index.tsx +49 -47
- package/themes/original/src/components/CartContent/index.tsx +99 -38
- package/themes/original/src/components/CartContent/styles.tsx +6 -6
- package/themes/original/src/components/Checkout/index.tsx +323 -42
- package/themes/original/src/components/CitiesControl/index.tsx +1 -1
- package/themes/original/src/components/CouponControl/index.tsx +10 -3
- 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/DriverTips/index.tsx +12 -4
- package/themes/original/src/components/FacebookLogin/styles.tsx +3 -1
- package/themes/original/src/components/Favorite/index.tsx +1 -5
- package/themes/original/src/components/GPSButton/index.tsx +6 -4
- package/themes/original/src/components/GiftCard/GiftCardUI/index.tsx +8 -3
- package/themes/original/src/components/GiftCard/PurchaseGiftCard/index.tsx +42 -5
- package/themes/original/src/components/GiftCard/PurchaseGiftCard/styles.tsx +2 -0
- package/themes/original/src/components/GiftCard/RedeemGiftCard/index.tsx +84 -8
- package/themes/original/src/components/GoogleLogin/styles.tsx +1 -1
- package/themes/original/src/components/GoogleMap/index.tsx +63 -7
- package/themes/original/src/components/Home/index.tsx +13 -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/LoginForm/Otp/index.tsx +91 -25
- package/themes/original/src/components/LoginForm/index.tsx +64 -34
- package/themes/original/src/components/LottieAnimation/index.tsx +88 -63
- package/themes/original/src/components/MessageListing/index.tsx +9 -2
- package/themes/original/src/components/Messages/index.tsx +15 -4
- package/themes/original/src/components/MomentOption/index.tsx +44 -39
- package/themes/original/src/components/MomentSelector/index.tsx +1 -1
- package/themes/original/src/components/MultiCartsPaymethodsAndWallets/index.tsx +161 -49
- package/themes/original/src/components/MultiCheckout/index.tsx +346 -68
- package/themes/original/src/components/MultiCheckout/styles.tsx +3 -1
- package/themes/original/src/components/MultiOrdersDetails/index.tsx +1 -1
- package/themes/original/src/components/MyOrders/index.tsx +12 -1
- package/themes/original/src/components/NavBar/index.tsx +20 -13
- package/themes/original/src/components/NotFoundSource/index.tsx +14 -10
- package/themes/original/src/components/OrderDetails/OrderEta.tsx +76 -0
- package/themes/original/src/components/OrderDetails/OrderHistory.tsx +21 -5
- package/themes/original/src/components/OrderDetails/index.tsx +50 -38
- package/themes/original/src/components/OrderDetails/styles.tsx +0 -1
- package/themes/original/src/components/OrderItAgain/index.tsx +3 -1
- package/themes/original/src/components/OrderProgress/index.tsx +34 -25
- package/themes/original/src/components/OrderSummary/index.tsx +62 -57
- package/themes/original/src/components/OrderTypeSelector/index.tsx +5 -6
- package/themes/original/src/components/OrdersOption/PreviousProductsOrdered/index.tsx +13 -13
- package/themes/original/src/components/OrdersOption/index.tsx +43 -20
- package/themes/original/src/components/OrdersOption/styles.tsx +1 -1
- package/themes/original/src/components/PageBanner/index.tsx +65 -29
- package/themes/original/src/components/PageBanner/styles.tsx +0 -3
- package/themes/original/src/components/PaymentOptionCard/index.tsx +180 -0
- package/themes/original/src/components/PaymentOptionStripe/styles.tsx +3 -0
- package/themes/original/src/components/PaymentOptionWallet/index.tsx +56 -56
- package/themes/original/src/components/PaymentOptions/index.tsx +100 -34
- package/themes/original/src/components/PhoneInputNumber/index.tsx +18 -4
- package/themes/original/src/components/ProductForm/ActionButton.tsx +120 -0
- package/themes/original/src/components/ProductForm/index.tsx +65 -34
- package/themes/original/src/components/ProductForm/styles.tsx +3 -3
- package/themes/original/src/components/ProductItemAccordion/index.tsx +8 -6
- package/themes/original/src/components/ProductOptionSubOption/index.tsx +49 -20
- package/themes/original/src/components/ProductOptionSubOption/styles.tsx +10 -9
- package/themes/original/src/components/ProfessionalFilter/SingleProfessionalCard/index.tsx +108 -0
- package/themes/original/src/components/ProfessionalFilter/index.tsx +20 -50
- package/themes/original/src/components/ProfessionalProfile/index.tsx +36 -7
- package/themes/original/src/components/Promotions/index.tsx +2 -2
- package/themes/original/src/components/Promotions/styles.tsx +3 -1
- package/themes/original/src/components/ReviewProducts/index.tsx +16 -7
- package/themes/original/src/components/ScheduleAccordion/index.tsx +3 -3
- package/themes/original/src/components/ServiceForm/index.tsx +40 -20
- package/themes/original/src/components/SignupForm/index.tsx +27 -16
- package/themes/original/src/components/SingleOrderCard/index.tsx +44 -20
- package/themes/original/src/components/SingleOrderCard/styles.tsx +1 -1
- package/themes/original/src/components/SingleProductCard/index.tsx +13 -10
- package/themes/original/src/components/SingleProductCard/styles.tsx +8 -3
- package/themes/original/src/components/SingleProductReview/styles.tsx +1 -1
- package/themes/original/src/components/StripeCardsList/index.tsx +61 -5
- package/themes/original/src/components/StripeElementsForm/index.tsx +48 -34
- package/themes/original/src/components/StripeElementsForm/naked.tsx +12 -1
- package/themes/original/src/components/UpsellingProducts/index.tsx +3 -8
- package/themes/original/src/components/UserDetails/index.tsx +3 -1
- package/themes/original/src/components/UserFormDetails/index.tsx +84 -19
- package/themes/original/src/components/UserFormDetails/styles.tsx +1 -1
- package/themes/original/src/components/UserProfile/index.tsx +7 -25
- package/themes/original/src/components/UserProfileForm/index.tsx +30 -31
- package/themes/original/src/components/UserVerification/index.tsx +55 -50
- package/themes/original/src/components/WalletTransactionItem/index.tsx +2 -2
- package/themes/original/src/components/WalletTransactions/index.tsx +3 -3
- package/themes/original/src/components/Wallets/index.tsx +51 -61
- package/themes/original/src/components/Wallets/styles.tsx +2 -4
- package/themes/original/src/components/shared/OButton.tsx +3 -3
- package/themes/original/src/components/shared/OInput.tsx +4 -5
- package/themes/original/src/components/shared/OModal.tsx +3 -3
- package/themes/original/src/types/index.tsx +30 -7
- package/themes/original/src/utils/index.tsx +180 -13
- package/themes/uber-eats/src/components/BusinessesListing/index.tsx +1 -1
- package/src/navigators/BottomNavigator.tsx +0 -117
- package/src/navigators/CheckoutNavigator.tsx +0 -66
- package/src/navigators/HomeNavigator.tsx +0 -202
- package/src/navigators/NavigationRef.tsx +0 -7
- package/src/navigators/RootNavigator.tsx +0 -269
- package/src/pages/Account.tsx +0 -34
- package/src/pages/AddressForm.tsx +0 -62
- package/src/pages/AddressList.tsx +0 -24
- package/src/pages/BusinessProductsList.tsx +0 -81
- package/src/pages/BusinessesListing.tsx +0 -43
- package/src/pages/CartList.tsx +0 -49
- package/src/pages/Checkout.tsx +0 -101
- package/src/pages/ForgotPassword.tsx +0 -24
- package/src/pages/Help.tsx +0 -23
- package/src/pages/HelpAccountAndPayment.tsx +0 -23
- package/src/pages/HelpGuide.tsx +0 -23
- package/src/pages/HelpOrder.tsx +0 -23
- package/src/pages/Home.tsx +0 -36
- package/src/pages/IntroductoryTutorial.tsx +0 -170
- package/src/pages/Login.tsx +0 -47
- package/src/pages/MomentOption.tsx +0 -30
- package/src/pages/MultiCheckout.tsx +0 -31
- package/src/pages/MultiOrdersDetails.tsx +0 -27
- package/src/pages/MyOrders.tsx +0 -40
- package/src/pages/NetworkError.tsx +0 -24
- package/src/pages/NotFound.tsx +0 -22
- package/src/pages/OrderDetails.tsx +0 -25
- package/src/pages/ProductDetails.tsx +0 -55
- package/src/pages/Profile.tsx +0 -36
- package/src/pages/ReviewDriver.tsx +0 -30
- package/src/pages/ReviewOrder.tsx +0 -32
- package/src/pages/ReviewProducts.tsx +0 -30
- package/src/pages/Sessions.tsx +0 -22
- package/src/pages/Signup.tsx +0 -53
- package/src/pages/SpinnerLoader.tsx +0 -10
- package/src/pages/Splash.tsx +0 -21
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React, { useState, useCallback } from 'react'
|
|
2
2
|
|
|
3
|
-
import { Platform, StyleSheet, View, TouchableOpacity } from 'react-native';
|
|
3
|
+
import { Platform, StyleSheet, View, TouchableOpacity, ScrollView } from 'react-native';
|
|
4
4
|
|
|
5
5
|
import { OButton, OText, OLink, OModal } from '../shared'
|
|
6
6
|
import {
|
|
@@ -16,18 +16,23 @@ import {
|
|
|
16
16
|
|
|
17
17
|
import { ProductItemAccordion } from '../ProductItemAccordion';
|
|
18
18
|
|
|
19
|
-
import { verifyDecimals } from '../../utils';
|
|
19
|
+
import { verifyDecimals, calculateDistance, transformDistance } from '../../utils';
|
|
20
20
|
|
|
21
21
|
import {
|
|
22
22
|
useLanguage,
|
|
23
23
|
useUtils,
|
|
24
24
|
useConfig,
|
|
25
|
+
useSession
|
|
25
26
|
} from 'ordering-components/native';
|
|
26
27
|
import { useTheme } from 'styled-components/native';
|
|
27
28
|
import { ReviewCustomer } from '../ReviewCustomer'
|
|
28
29
|
|
|
29
30
|
import MaterialIcon from 'react-native-vector-icons/MaterialCommunityIcons'
|
|
30
31
|
|
|
32
|
+
import { DeviceOrientationMethods } from '../../../../../src/hooks/DeviceOrientation'
|
|
33
|
+
|
|
34
|
+
const { useDeviceOrientation } = DeviceOrientationMethods
|
|
35
|
+
|
|
31
36
|
interface OrderContent {
|
|
32
37
|
order: any,
|
|
33
38
|
logisticOrderStatus?: Array<number>,
|
|
@@ -38,14 +43,25 @@ interface OrderContent {
|
|
|
38
43
|
export const OrderContentComponent = (props: OrderContent) => {
|
|
39
44
|
const [, t] = useLanguage();
|
|
40
45
|
const theme = useTheme()
|
|
41
|
-
|
|
46
|
+
const [{ user }] = useSession()
|
|
42
47
|
const { order, logisticOrderStatus, isOrderGroup, lastOrder } = props;
|
|
43
48
|
const [{ parsePrice, parseNumber }] = useUtils();
|
|
44
49
|
const [{ configs }] = useConfig();
|
|
50
|
+
const [orientationState] = useDeviceOrientation();
|
|
51
|
+
const distanceUnit = configs?.distance_unit?.value
|
|
52
|
+
|
|
53
|
+
const WIDTH_SCREEN = orientationState?.dimensions?.width
|
|
54
|
+
|
|
45
55
|
const [openReviewModal, setOpenReviewModal] = useState(false)
|
|
46
56
|
|
|
47
|
-
const [isReadMore, setIsReadMore] = useState(
|
|
48
|
-
|
|
57
|
+
const [isReadMore, setIsReadMore] = useState({
|
|
58
|
+
customerAddress: false,
|
|
59
|
+
businessAddressNotes: false
|
|
60
|
+
})
|
|
61
|
+
const [lengthMore, setLengthMore] = useState({
|
|
62
|
+
customerAddress: false,
|
|
63
|
+
businessAddressNotes: false
|
|
64
|
+
})
|
|
49
65
|
|
|
50
66
|
const pastOrderStatuses = [1, 2, 5, 6, 10, 11, 12, 16, 17]
|
|
51
67
|
|
|
@@ -98,14 +114,21 @@ export const OrderContentComponent = (props: OrderContent) => {
|
|
|
98
114
|
return /^\d+$/.test(str);
|
|
99
115
|
}
|
|
100
116
|
|
|
101
|
-
const onTextLayout = useCallback((e: any) => {
|
|
102
|
-
|
|
103
|
-
|
|
117
|
+
const onTextLayout = useCallback((e: any, item: string) => {
|
|
118
|
+
if (item === 'customerAddress') {
|
|
119
|
+
const customerAddressMore = (e.nativeEvent.lines.length == 2 && e.nativeEvent.lines[1].width > WIDTH_SCREEN * .76) || e.nativeEvent.lines.length > 2
|
|
120
|
+
setLengthMore(prev => ({ ...prev, customerAddress: customerAddressMore }))
|
|
121
|
+
}
|
|
122
|
+
if (item === 'businessAddressNotes') {
|
|
123
|
+
const businessAddressNotesMore = (e.nativeEvent.lines.length == 3 && e.nativeEvent.lines[2].width > WIDTH_SCREEN * .76) || e.nativeEvent.lines.length > 3
|
|
124
|
+
setLengthMore(prev => ({ ...prev, businessAddressNotes: businessAddressNotesMore }))
|
|
125
|
+
}
|
|
126
|
+
}, []);
|
|
104
127
|
|
|
105
128
|
return (
|
|
106
129
|
<OrderContent isOrderGroup={isOrderGroup} lastOrder={lastOrder}>
|
|
107
130
|
{isOrderGroup && (
|
|
108
|
-
<OText size={18}>{t('ORDER', 'Order')} #{
|
|
131
|
+
<OText size={18}>{t('ORDER', 'Order')} #{order?.id}</OText>
|
|
109
132
|
)}
|
|
110
133
|
|
|
111
134
|
{order?.metafields?.length > 0 && (
|
|
@@ -193,19 +216,34 @@ export const OrderContentComponent = (props: OrderContent) => {
|
|
|
193
216
|
/>
|
|
194
217
|
</View>
|
|
195
218
|
)}
|
|
196
|
-
|
|
219
|
+
{!!order?.business?.location && order?.customer?.location && (
|
|
220
|
+
<OText>
|
|
221
|
+
{t('DISTANCE_TO_THE_BUSINESS', 'Distance to the business')}: {transformDistance(calculateDistance(order?.business?.location, { latitude: order?.customer?.location?.lat, longitude: order?.customer?.location?.lng }), distanceUnit)} {t(distanceUnit.toUpperCase(), distanceUnit)}
|
|
222
|
+
</OText>
|
|
223
|
+
)}
|
|
197
224
|
{!!order?.business?.address_notes && (
|
|
198
|
-
|
|
199
|
-
<
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
225
|
+
<>
|
|
226
|
+
<View style={styles.linkWithIcons}>
|
|
227
|
+
<OLink
|
|
228
|
+
PressStyle={styles.linkWithIcons}
|
|
229
|
+
url={Platform.select({
|
|
230
|
+
ios: `maps:0,0?q=${order?.business?.address_notes}`,
|
|
231
|
+
android: `geo:0,0?q=${order?.business?.address_notes}`,
|
|
232
|
+
})}
|
|
233
|
+
shorcut={order?.business?.address_notes}
|
|
234
|
+
TextStyle={styles.textLink}
|
|
235
|
+
onTextLayout={e => onTextLayout(e, 'businessAddressNotes')}
|
|
236
|
+
numberOfLines={isReadMore.businessAddressNotes ? 20 : 3}
|
|
237
|
+
/>
|
|
238
|
+
</View>
|
|
239
|
+
{lengthMore.businessAddressNotes && (
|
|
240
|
+
<TouchableOpacity
|
|
241
|
+
onPress={() => setIsReadMore({ ...isReadMore, businessAddressNotes: !isReadMore.businessAddressNotes })}
|
|
242
|
+
>
|
|
243
|
+
<OText size={12} color={theme.colors.statusOrderBlue}>{isReadMore.businessAddressNotes ? t('SHOW_LESS', 'Show less') : t('READ_MORE', 'Read more')}</OText>
|
|
244
|
+
</TouchableOpacity>
|
|
245
|
+
)}
|
|
246
|
+
</>
|
|
209
247
|
)}
|
|
210
248
|
</OrderBusiness>
|
|
211
249
|
|
|
@@ -313,15 +351,17 @@ export const OrderContentComponent = (props: OrderContent) => {
|
|
|
313
351
|
ios: `maps:0,0?q=${order?.customer?.address}`,
|
|
314
352
|
android: `geo:0,0?q=${order?.customer?.address}`,
|
|
315
353
|
})}
|
|
316
|
-
onTextLayout={onTextLayout}
|
|
317
|
-
numberOfLines={isReadMore ? 20 : 2}
|
|
354
|
+
onTextLayout={e => onTextLayout(e, 'customerAddress')}
|
|
355
|
+
numberOfLines={isReadMore.customerAddress ? 20 : 2}
|
|
318
356
|
shorcut={order?.customer?.address}
|
|
319
357
|
TextStyle={styles.textLink}
|
|
320
358
|
/>
|
|
321
359
|
</View>
|
|
322
|
-
{lengthMore && (
|
|
323
|
-
<TouchableOpacity
|
|
324
|
-
|
|
360
|
+
{lengthMore.customerAddress && (
|
|
361
|
+
<TouchableOpacity
|
|
362
|
+
onPress={() => setIsReadMore({ ...isReadMore, customerAddress: !isReadMore.customerAddress })}
|
|
363
|
+
>
|
|
364
|
+
<OText size={12} color={theme.colors.statusOrderBlue}>{isReadMore.customerAddress ? t('SHOW_LESS', 'Show less') : t('READ_MORE', 'Read more')}</OText>
|
|
325
365
|
</TouchableOpacity>
|
|
326
366
|
)}
|
|
327
367
|
</>
|
|
@@ -334,9 +374,15 @@ export const OrderContentComponent = (props: OrderContent) => {
|
|
|
334
374
|
)}
|
|
335
375
|
|
|
336
376
|
{!!order?.customer?.address_notes && (
|
|
337
|
-
<
|
|
338
|
-
{
|
|
339
|
-
|
|
377
|
+
<ScrollView
|
|
378
|
+
showsVerticalScrollIndicator={false}
|
|
379
|
+
showsHorizontalScrollIndicator={false}
|
|
380
|
+
horizontal
|
|
381
|
+
>
|
|
382
|
+
<OText numberOfLines={1} mBottom={4} ellipsizeMode="tail">
|
|
383
|
+
{order?.customer?.address_notes}
|
|
384
|
+
</OText>
|
|
385
|
+
</ScrollView>
|
|
340
386
|
)}
|
|
341
387
|
|
|
342
388
|
{!!order?.customer?.zipcode && (
|
|
@@ -503,7 +549,7 @@ export const OrderContentComponent = (props: OrderContent) => {
|
|
|
503
549
|
))
|
|
504
550
|
}
|
|
505
551
|
{
|
|
506
|
-
order?.summary?.delivery_price
|
|
552
|
+
typeof order?.summary?.delivery_price === 'number' && (
|
|
507
553
|
<Table>
|
|
508
554
|
<OText mBottom={4}>
|
|
509
555
|
{t('DELIVERY_FEE', 'Delivery Fee')}
|
|
@@ -530,15 +576,14 @@ export const OrderContentComponent = (props: OrderContent) => {
|
|
|
530
576
|
</Table>
|
|
531
577
|
))
|
|
532
578
|
}
|
|
533
|
-
{order?.summary?.driver_tip > 0 && (
|
|
579
|
+
{(order?.summary?.driver_tip > 0 || order?.driver_tip > 0) && (
|
|
534
580
|
<Table>
|
|
535
581
|
<OText mBottom={4}>
|
|
536
582
|
{t('DRIVER_TIP', 'Driver tip')}
|
|
537
|
-
{order?.
|
|
538
|
-
parseInt(configs?.driver_tip_type?.value, 10) === 2 &&
|
|
583
|
+
{order?.driver_tip > 0 && parseInt(configs?.driver_tip_type?.value, 10) === 2 &&
|
|
539
584
|
!parseInt(configs?.driver_tip_use_custom?.value, 10) &&
|
|
540
585
|
(
|
|
541
|
-
`(${verifyDecimals(order?.
|
|
586
|
+
`(${verifyDecimals(order?.driver_tip, parseNumber)}%)`
|
|
542
587
|
)}
|
|
543
588
|
</OText>
|
|
544
589
|
<OText mBottom={4}>{parsePrice(order?.summary?.driver_tip ?? order?.totalDriverTip, { currency: order?.currency })}</OText>
|
|
@@ -591,14 +636,16 @@ export const OrderContentComponent = (props: OrderContent) => {
|
|
|
591
636
|
? walletName[event?.wallet_event?.wallet?.type]?.name
|
|
592
637
|
: t(event?.paymethod?.name?.toUpperCase()?.replace(/ /g, '_'), event?.paymethod?.name)}
|
|
593
638
|
</OText>
|
|
594
|
-
{event?.data?.charge_id && (
|
|
639
|
+
{/* {event?.data?.charge_id && (
|
|
595
640
|
<OText>
|
|
596
641
|
{`${t('CODE', 'Code')}: ${event?.data?.charge_id}`}
|
|
597
642
|
</OText>
|
|
598
|
-
)}
|
|
643
|
+
)} */}
|
|
599
644
|
</View>
|
|
600
645
|
<OText>
|
|
601
|
-
|
|
646
|
+
{(event?.paymethod?.gateway === 'cash' && order?.cash)
|
|
647
|
+
? parsePrice(order?.cash, { currency: order?.currency })
|
|
648
|
+
: `-${parsePrice(event?.amount, { currency: order?.currency })}`}
|
|
602
649
|
</OText>
|
|
603
650
|
</View>
|
|
604
651
|
))}
|
|
@@ -9,12 +9,15 @@ import {
|
|
|
9
9
|
|
|
10
10
|
//Components
|
|
11
11
|
import {
|
|
12
|
+
OIcon,
|
|
12
13
|
OIconButton,
|
|
13
14
|
OText,
|
|
14
15
|
} from '../shared'
|
|
15
16
|
|
|
16
17
|
import { useTheme } from 'styled-components/native';
|
|
17
|
-
import { StyleSheet, View } from 'react-native';
|
|
18
|
+
import { StyleSheet, TouchableOpacity, View } from 'react-native';
|
|
19
|
+
import SimpleLineIcons from 'react-native-vector-icons/SimpleLineIcons'
|
|
20
|
+
import MaterialCommunityIcons from 'react-native-vector-icons/MaterialCommunityIcons'
|
|
18
21
|
|
|
19
22
|
import {
|
|
20
23
|
useLanguage,
|
|
@@ -54,6 +57,19 @@ export const OrderHeaderComponent = (props: OrderHeader) => {
|
|
|
54
57
|
height: 40,
|
|
55
58
|
padding: 10,
|
|
56
59
|
alignItems: 'flex-end',
|
|
60
|
+
color: theme.colors.textGray,
|
|
61
|
+
},
|
|
62
|
+
btnBackArrow: {
|
|
63
|
+
borderWidth: 0,
|
|
64
|
+
width: 32,
|
|
65
|
+
height: 32,
|
|
66
|
+
tintColor: theme.colors.textGray,
|
|
67
|
+
backgroundColor: theme.colors.clear,
|
|
68
|
+
borderColor: theme.colors.clear,
|
|
69
|
+
shadowColor: theme.colors.clear,
|
|
70
|
+
paddingLeft: 0,
|
|
71
|
+
paddingRight: 0,
|
|
72
|
+
marginTop: 10
|
|
57
73
|
},
|
|
58
74
|
})
|
|
59
75
|
|
|
@@ -108,42 +124,32 @@ export const OrderHeaderComponent = (props: OrderHeader) => {
|
|
|
108
124
|
<>
|
|
109
125
|
{!props.isCustomView && (
|
|
110
126
|
<Header>
|
|
111
|
-
<
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
borderColor={theme.colors.clear}
|
|
115
|
-
style={{ ...styles.icons, justifyContent: 'flex-end' }}
|
|
116
|
-
onClick={() => handleArrowBack()}
|
|
117
|
-
/>
|
|
118
|
-
|
|
127
|
+
<TouchableOpacity onPress={() => handleArrowBack()} style={styles.btnBackArrow}>
|
|
128
|
+
<OIcon src={theme.images.general.arrow_left} color={theme.colors.textGray} />
|
|
129
|
+
</TouchableOpacity>
|
|
119
130
|
{(!order?.isLogistic || (!logisticOrderStatus?.includes(order?.status) && !order?.order_group)) && (
|
|
120
131
|
<Actions>
|
|
121
132
|
{getOrderStatus(order?.status, t)?.value !==
|
|
122
133
|
t('PENDING', 'Pending') && (
|
|
123
134
|
<>
|
|
124
|
-
<
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
}}
|
|
143
|
-
borderColor={theme.colors.clear}
|
|
144
|
-
style={styles.icons}
|
|
145
|
-
onClick={() => handleViewSummaryOrder?.()}
|
|
146
|
-
/>
|
|
135
|
+
<TouchableOpacity onPress={() => handleCopyClipboard?.()}>
|
|
136
|
+
<MaterialCommunityIcons
|
|
137
|
+
name='content-copy'
|
|
138
|
+
color={theme.colors.textGray}
|
|
139
|
+
size={20}
|
|
140
|
+
style={styles.icons}
|
|
141
|
+
/>
|
|
142
|
+
</TouchableOpacity>
|
|
143
|
+
{!!handleViewSummaryOrder && (
|
|
144
|
+
<TouchableOpacity onPress={() => handleViewSummaryOrder?.()}>
|
|
145
|
+
<SimpleLineIcons
|
|
146
|
+
name='printer'
|
|
147
|
+
color={theme.colors.textGray}
|
|
148
|
+
size={20}
|
|
149
|
+
style={styles.icons}
|
|
150
|
+
/>
|
|
151
|
+
</TouchableOpacity>
|
|
152
|
+
)}
|
|
147
153
|
</>
|
|
148
154
|
)}
|
|
149
155
|
<OIconButton
|
|
@@ -151,7 +157,7 @@ export const OrderHeaderComponent = (props: OrderHeader) => {
|
|
|
151
157
|
iconStyle={{
|
|
152
158
|
width: 20,
|
|
153
159
|
height: 20,
|
|
154
|
-
tintColor: theme.colors.
|
|
160
|
+
tintColor: theme.colors.textGray,
|
|
155
161
|
}}
|
|
156
162
|
borderColor={theme.colors.clear}
|
|
157
163
|
style={styles.icons}
|
|
@@ -163,7 +169,7 @@ export const OrderHeaderComponent = (props: OrderHeader) => {
|
|
|
163
169
|
iconStyle={{
|
|
164
170
|
width: 20,
|
|
165
171
|
height: 20,
|
|
166
|
-
tintColor: theme.colors.
|
|
172
|
+
tintColor: theme.colors.textGray,
|
|
167
173
|
}}
|
|
168
174
|
borderColor={theme.colors.clear}
|
|
169
175
|
style={styles.icons}
|
|
@@ -193,29 +199,24 @@ export const OrderHeaderComponent = (props: OrderHeader) => {
|
|
|
193
199
|
{getOrderStatus(order?.status, t)?.value !==
|
|
194
200
|
t('PENDING', 'Pending') && (
|
|
195
201
|
<>
|
|
196
|
-
<
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
}}
|
|
215
|
-
borderColor={theme.colors.clear}
|
|
216
|
-
style={styles.icons}
|
|
217
|
-
onClick={() => handleViewSummaryOrder?.()}
|
|
218
|
-
/>
|
|
202
|
+
<TouchableOpacity onPress={() => handleCopyClipboard?.()}>
|
|
203
|
+
<MaterialCommunityIcons
|
|
204
|
+
name='content-copy'
|
|
205
|
+
color={theme.colors.textGray}
|
|
206
|
+
size={20}
|
|
207
|
+
style={styles.icons}
|
|
208
|
+
/>
|
|
209
|
+
</TouchableOpacity>
|
|
210
|
+
{!!handleViewSummaryOrder && (
|
|
211
|
+
<TouchableOpacity onPress={() => handleViewSummaryOrder?.()}>
|
|
212
|
+
<SimpleLineIcons
|
|
213
|
+
name='printer'
|
|
214
|
+
color={theme.colors.textGray}
|
|
215
|
+
size={20}
|
|
216
|
+
style={styles.icons}
|
|
217
|
+
/>
|
|
218
|
+
</TouchableOpacity>
|
|
219
|
+
)}
|
|
219
220
|
</>
|
|
220
221
|
)}
|
|
221
222
|
<OIconButton
|
|
@@ -223,7 +224,7 @@ export const OrderHeaderComponent = (props: OrderHeader) => {
|
|
|
223
224
|
iconStyle={{
|
|
224
225
|
width: 20,
|
|
225
226
|
height: 20,
|
|
226
|
-
tintColor: theme.colors.
|
|
227
|
+
tintColor: theme.colors.textGray,
|
|
227
228
|
}}
|
|
228
229
|
borderColor={theme.colors.clear}
|
|
229
230
|
style={styles.icons}
|
|
@@ -235,7 +236,7 @@ export const OrderHeaderComponent = (props: OrderHeader) => {
|
|
|
235
236
|
iconStyle={{
|
|
236
237
|
width: 20,
|
|
237
238
|
height: 20,
|
|
238
|
-
tintColor: theme.colors.
|
|
239
|
+
tintColor: theme.colors.textGray,
|
|
239
240
|
}}
|
|
240
241
|
borderColor={theme.colors.clear}
|
|
241
242
|
style={styles.icons}
|
|
@@ -262,7 +263,13 @@ export const OrderHeaderComponent = (props: OrderHeader) => {
|
|
|
262
263
|
)}
|
|
263
264
|
</>
|
|
264
265
|
</OText>
|
|
265
|
-
{
|
|
266
|
+
{order?.external_id && (
|
|
267
|
+
<OText size={13}>
|
|
268
|
+
<OText size={13} weight='bold'>{`${t('EXTERNAL_ID', 'External ID :')} `}</OText>
|
|
269
|
+
{order?.external_id}
|
|
270
|
+
</OText>
|
|
271
|
+
)}
|
|
272
|
+
{!order?.isLogistic && !!order?.delivery_type && (!order?.order_group_id || !logisticOrderStatus?.includes(order?.status)) && (
|
|
266
273
|
<>
|
|
267
274
|
<OText size={13}>
|
|
268
275
|
<OText size={13} weight='bold'>{`${t('ORDER_TYPE', 'Order Type')}: `}</OText>
|
|
@@ -274,12 +281,12 @@ export const OrderHeaderComponent = (props: OrderHeader) => {
|
|
|
274
281
|
{t(order?.delivery_option?.name?.toUpperCase()?.replace(/ /g, '_'), order?.delivery_option?.name)}
|
|
275
282
|
</OText>
|
|
276
283
|
)}
|
|
277
|
-
|
|
278
|
-
<
|
|
284
|
+
<OText>
|
|
285
|
+
<OText size={13} weight='bold'>
|
|
286
|
+
{`${t('PAYMENT_METHODS', 'Payment methods')}: `}
|
|
287
|
+
</OText>
|
|
288
|
+
{order?.payment_events?.length > 0 ? (
|
|
279
289
|
<OText size={13}>
|
|
280
|
-
<OText size={13} weight='bold'>
|
|
281
|
-
{`${t('PAYMENT_METHODS', 'Payment methods')}: `}
|
|
282
|
-
</OText>
|
|
283
290
|
{order?.payment_events?.map((event: any, idx: number) => {
|
|
284
291
|
return event?.wallet_event
|
|
285
292
|
? idx < order?.payment_events?.length - 1
|
|
@@ -290,7 +297,21 @@ export const OrderHeaderComponent = (props: OrderHeader) => {
|
|
|
290
297
|
: t(event?.paymethod?.name?.toUpperCase()?.replace(/ /g, '_'), event?.paymethod?.name)
|
|
291
298
|
})}
|
|
292
299
|
</OText>
|
|
293
|
-
|
|
300
|
+
) : (
|
|
301
|
+
<OText size={13}>{t(order?.paymethod?.gateway?.toUpperCase(), order?.paymethod?.name)}</OText>
|
|
302
|
+
)}
|
|
303
|
+
</OText>
|
|
304
|
+
{order?.spot_number && (
|
|
305
|
+
<OText size={13}>
|
|
306
|
+
<OText size={13} weight='bold'>
|
|
307
|
+
{`${order?.delivery_type === 3
|
|
308
|
+
? t('EATIN_SPOT_NUMBER', 'Table number')
|
|
309
|
+
: order?.delivery_type === 5
|
|
310
|
+
? t('DRIVE_THRU_SPOT_NUMBER', 'Drive thru lane')
|
|
311
|
+
: t('CURBSIDE_SPOT_NUMBER', 'Spot number')}: `}
|
|
312
|
+
</OText>
|
|
313
|
+
{order.spot_number}
|
|
314
|
+
</OText>
|
|
294
315
|
)}
|
|
295
316
|
</>
|
|
296
317
|
)}
|
|
@@ -0,0 +1,200 @@
|
|
|
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
|
+
useConfig
|
|
14
|
+
} from 'ordering-components/native';
|
|
15
|
+
|
|
16
|
+
//Components
|
|
17
|
+
import Alert from '../../providers/AlertProvider';
|
|
18
|
+
import { FloatingButton } from '../FloatingButton';
|
|
19
|
+
import { OrderDetailsLogisticParams } from '../../types';
|
|
20
|
+
import { useTheme } from 'styled-components/native';
|
|
21
|
+
import { NotFoundSource } from '../NotFoundSource';
|
|
22
|
+
import { getOrderStatus } from '../../utils';
|
|
23
|
+
import { OrderHeaderComponent } from '../OrderDetails/OrderHeaderComponent';
|
|
24
|
+
import { OrderContentComponent } from '../OrderDetails/OrderContentComponent';
|
|
25
|
+
//Styles
|
|
26
|
+
import { OrderDetailsContainer } from './styles';
|
|
27
|
+
|
|
28
|
+
export const OrderDetailsLogisticUI = (props: OrderDetailsLogisticParams) => {
|
|
29
|
+
const {
|
|
30
|
+
navigation,
|
|
31
|
+
handleClickLogisticOrder,
|
|
32
|
+
orderAssingId,
|
|
33
|
+
} = props;
|
|
34
|
+
const { order } = props.order
|
|
35
|
+
const theme = useTheme();
|
|
36
|
+
const [, t] = useLanguage();
|
|
37
|
+
const [session] = useSession();
|
|
38
|
+
const [{ configs }] = useConfig();
|
|
39
|
+
|
|
40
|
+
const [alertState, setAlertState] = useState<{
|
|
41
|
+
open: boolean;
|
|
42
|
+
content: Array<string>;
|
|
43
|
+
key?: string | null;
|
|
44
|
+
}>({ open: false, content: [], key: null });
|
|
45
|
+
|
|
46
|
+
const logisticOrderStatus = [4, 6, 7]
|
|
47
|
+
const isHideRejectButtons = configs?.reject_orders_enabled && configs?.reject_orders_enabled?.value !== '1'
|
|
48
|
+
|
|
49
|
+
const showFloatButtonsAcceptOrReject: any = {
|
|
50
|
+
0: true,
|
|
51
|
+
4: true,
|
|
52
|
+
7: true,
|
|
53
|
+
14: true
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
const handleArrowBack: any = () => {
|
|
57
|
+
navigation?.canGoBack() && navigation.goBack();
|
|
58
|
+
};
|
|
59
|
+
|
|
60
|
+
const handleRejectLogisticOrder = (order: any) => {
|
|
61
|
+
handleClickLogisticOrder?.(2, orderAssingId || order?.logistic_order_id, order)
|
|
62
|
+
handleArrowBack()
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
const handleAcceptLogisticOrder = (order: any) => {
|
|
66
|
+
handleClickLogisticOrder?.(1, orderAssingId || order?.logistic_order_id, order)
|
|
67
|
+
handleArrowBack()
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
useEffect(() => {
|
|
71
|
+
if (order?.driver === null && session?.user?.level === 4) {
|
|
72
|
+
setAlertState({
|
|
73
|
+
open: true,
|
|
74
|
+
content: [
|
|
75
|
+
t(
|
|
76
|
+
'YOU_HAVE_BEEN_REMOVED_FROM_THE_ORDER',
|
|
77
|
+
'You have been removed from the order',
|
|
78
|
+
),
|
|
79
|
+
],
|
|
80
|
+
key: null,
|
|
81
|
+
});
|
|
82
|
+
}
|
|
83
|
+
}, [order?.driver]);
|
|
84
|
+
|
|
85
|
+
const OrderDetailsInformation = (props: { order: any, isOrderGroup?: boolean, lastOrder?: boolean }) => {
|
|
86
|
+
const {
|
|
87
|
+
order,
|
|
88
|
+
isOrderGroup,
|
|
89
|
+
lastOrder,
|
|
90
|
+
} = props
|
|
91
|
+
return (
|
|
92
|
+
<>
|
|
93
|
+
<OrderContentComponent
|
|
94
|
+
order={order}
|
|
95
|
+
logisticOrderStatus={logisticOrderStatus}
|
|
96
|
+
isOrderGroup={isOrderGroup}
|
|
97
|
+
lastOrder={lastOrder}
|
|
98
|
+
/>
|
|
99
|
+
<View
|
|
100
|
+
style={{
|
|
101
|
+
height:
|
|
102
|
+
order?.status === 8 && order?.delivery_type === 1 ? 50 : 35,
|
|
103
|
+
}}
|
|
104
|
+
/>
|
|
105
|
+
|
|
106
|
+
</>
|
|
107
|
+
)
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
return (
|
|
111
|
+
<>
|
|
112
|
+
{(!order || Object.keys(order).length === 0) &&
|
|
113
|
+
(props.order?.error?.length < 1 || !props.order?.error) && (
|
|
114
|
+
<View style={{ flex: 1 }}>
|
|
115
|
+
{[...Array(6)].map((item, i) => (
|
|
116
|
+
<Placeholder key={i} Animation={Fade}>
|
|
117
|
+
<View style={{ flexDirection: 'row', paddingVertical: 20 }}>
|
|
118
|
+
<Placeholder>
|
|
119
|
+
<PlaceholderLine width={100} />
|
|
120
|
+
<PlaceholderLine width={70} />
|
|
121
|
+
<PlaceholderLine width={30} />
|
|
122
|
+
<PlaceholderLine width={20} />
|
|
123
|
+
</Placeholder>
|
|
124
|
+
</View>
|
|
125
|
+
</Placeholder>
|
|
126
|
+
))}
|
|
127
|
+
</View>
|
|
128
|
+
)}
|
|
129
|
+
|
|
130
|
+
{(!!props.order?.error || props.order?.error) && (
|
|
131
|
+
<NotFoundSource
|
|
132
|
+
btnTitle={t('GO_TO_MY_ORDERS', 'Go to my orders')}
|
|
133
|
+
content={
|
|
134
|
+
props.order.error[0] ||
|
|
135
|
+
props.order.error ||
|
|
136
|
+
t('NETWORK_ERROR', 'Network Error')
|
|
137
|
+
}
|
|
138
|
+
onClickButton={() => navigation.navigate('Orders')}
|
|
139
|
+
/>
|
|
140
|
+
)}
|
|
141
|
+
{!((!order || Object.keys(order).length === 0) &&
|
|
142
|
+
(props.order?.error?.length < 1 || !props.order?.error)) && (
|
|
143
|
+
<View style={{ flex: 1 }}>
|
|
144
|
+
<OrderHeaderComponent
|
|
145
|
+
order={order}
|
|
146
|
+
getOrderStatus={getOrderStatus}
|
|
147
|
+
handleArrowBack={handleArrowBack}
|
|
148
|
+
logisticOrderStatus={logisticOrderStatus}
|
|
149
|
+
/>
|
|
150
|
+
{order && Object.keys(order).length > 0 && (props.order?.error?.length < 1 || !props.order?.error) && (
|
|
151
|
+
<>
|
|
152
|
+
<OrderDetailsContainer
|
|
153
|
+
keyboardShouldPersistTaps="handled"
|
|
154
|
+
showsVerticalScrollIndicator={false}
|
|
155
|
+
>
|
|
156
|
+
{order?.order_group && !!order?.order_group_id && order?.isLogistic ? order?.order_group?.orders.map((order: any, i: number, hash: any) => (
|
|
157
|
+
<OrderDetailsInformation key={order?.id} order={order} isOrderGroup lastOrder={hash?.length === i + 1} />
|
|
158
|
+
)) : (
|
|
159
|
+
<OrderDetailsInformation order={order} />
|
|
160
|
+
)}
|
|
161
|
+
</OrderDetailsContainer>
|
|
162
|
+
|
|
163
|
+
{showFloatButtonsAcceptOrReject[order?.status] && (
|
|
164
|
+
<FloatingButton
|
|
165
|
+
btnText={t('REJECT', 'Reject')}
|
|
166
|
+
isSecondaryBtn={false}
|
|
167
|
+
secondButtonClick={() => handleAcceptLogisticOrder(order)}
|
|
168
|
+
firstButtonClick={() => handleRejectLogisticOrder(order)}
|
|
169
|
+
secondBtnText={t('ACCEPT', 'Accept')}
|
|
170
|
+
secondButton={true}
|
|
171
|
+
firstColorCustom={theme.colors.red}
|
|
172
|
+
secondColorCustom={theme.colors.green}
|
|
173
|
+
widthButton={isHideRejectButtons ? '100%': '45%'}
|
|
174
|
+
isHideRejectButtons={isHideRejectButtons}
|
|
175
|
+
/>
|
|
176
|
+
)}
|
|
177
|
+
</>
|
|
178
|
+
)}
|
|
179
|
+
</View>
|
|
180
|
+
)}
|
|
181
|
+
{alertState?.open && (
|
|
182
|
+
<Alert
|
|
183
|
+
open={alertState.open}
|
|
184
|
+
onAccept={handleArrowBack}
|
|
185
|
+
onClose={handleArrowBack}
|
|
186
|
+
content={alertState.content}
|
|
187
|
+
title={t('WARNING', 'Warning')}
|
|
188
|
+
/>
|
|
189
|
+
)}
|
|
190
|
+
</>
|
|
191
|
+
);
|
|
192
|
+
};
|
|
193
|
+
|
|
194
|
+
export const OrderDetailsLogistic = (props: OrderDetailsLogisticParams) => {
|
|
195
|
+
const orderDetailsProps = {
|
|
196
|
+
...props,
|
|
197
|
+
UIComponent: OrderDetailsLogisticUI,
|
|
198
|
+
};
|
|
199
|
+
return <OrderDetailsConTableoller {...orderDetailsProps} />;
|
|
200
|
+
};
|