ordering-ui-react-native 0.16.68 → 0.16.69-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 +6 -5
- package/src/DeliveryApp.tsx +43 -1
- package/src/components/ActiveOrders/index.tsx +61 -63
- 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 +10 -10
- package/src/components/BusinessesListing/index.tsx +1 -1
- package/src/components/Checkout/index.tsx +2 -1
- package/src/components/LanguageSelector/index.tsx +21 -16
- package/src/components/Messages/index.tsx +2 -2
- package/src/components/OrdersOption/index.tsx +54 -56
- package/src/components/PaymentOptions/index.tsx +298 -345
- package/src/components/PaymentOptionsWebView/index.tsx +119 -120
- package/src/components/SingleProductReview/index.tsx +7 -4
- package/src/components/StripeElementsForm/index.tsx +25 -16
- package/src/components/VerifyPhone/styles.tsx +1 -2
- package/src/components/shared/OToast.tsx +4 -4
- package/src/types/@fatnlazycat/react-native-recaptcha-v3/index.d.ts +1 -0
- package/src/utils/index.tsx +2 -1
- package/themes/business/src/components/AcceptOrRejectOrder/index.tsx +260 -238
- package/themes/business/src/components/AcceptOrRejectOrder/styles.tsx +6 -4
- package/themes/business/src/components/BusinessController/index.tsx +2 -2
- package/themes/business/src/components/Chat/index.tsx +31 -31
- package/themes/business/src/components/DriverMap/index.tsx +7 -5
- package/themes/business/src/components/LoginForm/index.tsx +111 -74
- package/themes/business/src/components/MapView/index.tsx +14 -3
- package/themes/business/src/components/MessagesOption/index.tsx +11 -1
- package/themes/business/src/components/NewOrderNotification/index.tsx +31 -41
- package/themes/business/src/components/OrderDetails/OrderContentComponent.tsx +70 -43
- package/themes/business/src/components/OrderDetails/OrderHeaderComponent.tsx +3 -3
- package/themes/business/src/components/OrdersOption/index.tsx +63 -73
- package/themes/business/src/components/OrdersOption/styles.tsx +5 -1
- package/themes/business/src/components/OrdersOptionBusiness/index.tsx +15 -1
- package/themes/business/src/components/OrdersOptionCity/index.tsx +15 -1
- package/themes/business/src/components/OrdersOptionDate/index.tsx +19 -6
- package/themes/business/src/components/OrdersOptionDelivery/index.tsx +15 -1
- package/themes/business/src/components/OrdersOptionDriver/index.tsx +15 -1
- package/themes/business/src/components/OrdersOptionPaymethod/index.tsx +15 -1
- package/themes/business/src/components/OrdersOptionStatus/index.tsx +10 -1
- package/themes/business/src/components/PreviousMessages/index.tsx +17 -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 +440 -245
- package/themes/business/src/components/PreviousOrders/styles.tsx +31 -3
- package/themes/business/src/components/ProductItemAccordion/index.tsx +3 -2
- package/themes/business/src/components/ReviewCustomer/index.tsx +39 -15
- package/themes/business/src/components/shared/ODropDown.tsx +42 -8
- package/themes/business/src/components/shared/ODropDownCalendar.tsx +36 -7
- package/themes/business/src/components/shared/OLink.tsx +33 -13
- package/themes/business/src/components/shared/OText.tsx +8 -2
- package/themes/business/src/types/index.tsx +14 -3
- package/themes/business/src/utils/index.tsx +10 -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/index.tsx +121 -10
- package/themes/kiosk/src/components/LoginForm/styles.tsx +5 -0
- 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/ProductForm/index.tsx +1 -14
- package/themes/kiosk/src/components/shared/OButton.tsx +5 -18
- package/themes/kiosk/src/types/index.d.ts +2 -0
- package/themes/original/index.tsx +6 -0
- package/themes/original/src/components/AddressDetails/index.tsx +10 -8
- package/themes/original/src/components/AddressForm/index.tsx +153 -137
- package/themes/original/src/components/AddressList/index.tsx +18 -18
- package/themes/original/src/components/AddressList/styles.tsx +4 -2
- package/themes/original/src/components/AppleLogin/index.tsx +4 -4
- package/themes/original/src/components/BusinessBasicInformation/index.tsx +49 -33
- package/themes/original/src/components/BusinessController/index.tsx +101 -70
- 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 +12 -6
- package/themes/original/src/components/BusinessListingSearch/BusinessControllerSkeletons/index.tsx +57 -0
- package/themes/original/src/components/BusinessListingSearch/MaxSectionItem/index.tsx +59 -0
- package/themes/original/src/components/BusinessListingSearch/MaxSectionItem/styles.tsx +13 -0
- package/themes/original/src/components/BusinessListingSearch/index.tsx +87 -142
- package/themes/original/src/components/BusinessListingSearch/styles.tsx +10 -12
- package/themes/original/src/components/BusinessProductsList/SubcategoriesComponent/index.tsx +87 -0
- package/themes/original/src/components/BusinessProductsList/SubcategoriesComponent/styles.tsx +12 -0
- package/themes/original/src/components/BusinessProductsList/index.tsx +41 -62
- package/themes/original/src/components/BusinessProductsList/styles.tsx +0 -3
- package/themes/original/src/components/BusinessProductsListing/index.tsx +561 -479
- package/themes/original/src/components/BusinessProductsListing/styles.tsx +13 -12
- package/themes/original/src/components/BusinessTypeFilter/index.tsx +3 -2
- package/themes/original/src/components/BusinessesListing/Layout/Appointment/index.tsx +2 -1
- package/themes/original/src/components/BusinessesListing/Layout/Original/index.tsx +93 -98
- package/themes/original/src/components/BusinessesListing/Layout/Original/styles.tsx +1 -9
- package/themes/original/src/components/BusinessesListing/index.tsx +8 -8
- package/themes/original/src/components/Cart/index.tsx +63 -38
- package/themes/original/src/components/CartContent/index.tsx +80 -18
- package/themes/original/src/components/CartContent/styles.tsx +11 -1
- package/themes/original/src/components/Checkout/index.tsx +110 -114
- package/themes/original/src/components/Checkout/styles.tsx +4 -3
- 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/DriverTips/index.tsx +47 -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 +69 -45
- 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/index.tsx +20 -19
- 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 +7 -7
- package/themes/original/src/components/HelpAccountAndPayment/index.tsx +14 -20
- package/themes/original/src/components/HelpAccountAndPayment/styles.tsx +6 -0
- package/themes/original/src/components/HelpGuide/index.tsx +12 -11
- package/themes/original/src/components/HelpGuide/styles.tsx +5 -0
- package/themes/original/src/components/HelpOrder/index.tsx +12 -20
- package/themes/original/src/components/HelpOrder/styles.tsx +8 -1
- package/themes/original/src/components/LanguageSelector/index.tsx +19 -14
- 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 +98 -41
- package/themes/original/src/components/LottieAnimation/index.tsx +78 -0
- package/themes/original/src/components/MessageListing/index.tsx +7 -7
- package/themes/original/src/components/Messages/index.tsx +35 -20
- package/themes/original/src/components/MomentOption/index.tsx +17 -11
- 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 +158 -77
- package/themes/original/src/components/MultiOrdersDetails/index.tsx +60 -33
- package/themes/original/src/components/MyOrders/index.tsx +86 -20
- package/themes/original/src/components/NavBar/index.tsx +7 -6
- 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/index.tsx +114 -15
- package/themes/original/src/components/OrderDetails/styles.tsx +15 -2
- package/themes/original/src/components/OrderItAgain/index.tsx +46 -43
- package/themes/original/src/components/OrderProgress/index.tsx +77 -66
- package/themes/original/src/components/OrderProgress/styles.tsx +5 -0
- package/themes/original/src/components/OrderSummary/index.tsx +3 -36
- package/themes/original/src/components/OrderTypeSelector/index.tsx +13 -6
- package/themes/original/src/components/OrdersOption/PreviousBusinessOrdered/index.tsx +94 -98
- package/themes/original/src/components/OrdersOption/PreviousProductsOrdered/index.tsx +3 -0
- package/themes/original/src/components/OrdersOption/index.tsx +97 -55
- 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 +1 -2
- package/themes/original/src/components/PhoneInputNumber/index.tsx +1 -1
- package/themes/original/src/components/PlaceSpot/index.tsx +249 -47
- package/themes/original/src/components/PlaceSpot/styles.tsx +0 -2
- package/themes/original/src/components/PreviousOrders/index.tsx +3 -2
- package/themes/original/src/components/ProductForm/index.tsx +212 -253
- package/themes/original/src/components/ProductForm/styles.tsx +5 -8
- package/themes/original/src/components/ProductItemAccordion/index.tsx +199 -128
- package/themes/original/src/components/ProductOptionSubOption/index.tsx +17 -9
- package/themes/original/src/components/ProductOptionSubOption/styles.tsx +1 -2
- package/themes/original/src/components/ProfessionalFilter/index.tsx +2 -1
- package/themes/original/src/components/ProfessionalProfile/index.tsx +19 -8
- 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 +328 -264
- package/themes/original/src/components/SignupForm/index.tsx +134 -89
- package/themes/original/src/components/SingleOrderCard/index.tsx +129 -54
- package/themes/original/src/components/SingleOrderCard/styles.tsx +10 -8
- package/themes/original/src/components/SingleProductCard/index.tsx +85 -82
- package/themes/original/src/components/SingleProductCard/styles.tsx +2 -9
- 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 +13 -2
- package/themes/original/src/components/UpsellingProducts/index.tsx +244 -215
- package/themes/original/src/components/UpsellingProducts/styles.tsx +12 -1
- package/themes/original/src/components/UserDetails/index.tsx +5 -3
- package/themes/original/src/components/UserFormDetails/index.tsx +6 -48
- 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 +19 -28
- package/themes/original/src/components/UserProfileForm/styles.tsx +7 -0
- package/themes/original/src/components/WalletTransactions/index.tsx +76 -0
- package/themes/original/src/components/WalletTransactions/styles.tsx +13 -0
- package/themes/original/src/components/Wallets/index.tsx +176 -164
- package/themes/original/src/components/Wallets/styles.tsx +12 -8
- 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 +6 -4
- package/themes/original/src/components/shared/OButton.tsx +9 -4
- package/themes/original/src/components/shared/OIcon.tsx +8 -1
- package/themes/original/src/components/shared/OInput.tsx +10 -1
- package/themes/original/src/layouts/Container.tsx +13 -9
- package/themes/original/src/types/index.tsx +44 -6
- package/themes/original/src/utils/index.tsx +103 -58
- package/themes/uber-eats/src/components/BusinessesListing/index.tsx +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import React, { useState } from 'react'
|
|
1
|
+
import React, { useState, useCallback } from 'react'
|
|
2
2
|
|
|
3
|
-
import { Platform, StyleSheet, View } from 'react-native';
|
|
3
|
+
import { Platform, StyleSheet, View, TouchableOpacity } from 'react-native';
|
|
4
4
|
|
|
5
5
|
import { OButton, OText, OLink, OModal } from '../shared'
|
|
6
6
|
import {
|
|
@@ -44,6 +44,9 @@ export const OrderContentComponent = (props: OrderContent) => {
|
|
|
44
44
|
const [{ configs }] = useConfig();
|
|
45
45
|
const [openReviewModal, setOpenReviewModal] = useState(false)
|
|
46
46
|
|
|
47
|
+
const [isReadMore, setIsReadMore] = useState(false)
|
|
48
|
+
const [lengthMore, setLengthMore] = useState(false)
|
|
49
|
+
|
|
47
50
|
const pastOrderStatuses = [1, 2, 5, 6, 10, 11, 12, 16, 17]
|
|
48
51
|
|
|
49
52
|
const walletName: any = {
|
|
@@ -91,6 +94,14 @@ export const OrderContentComponent = (props: OrderContent) => {
|
|
|
91
94
|
return order?.taxes?.filter((tax: any) => tax?.type === 1)?.reduce((carry: number, tax: any) => carry + (tax?.summary?.tax_after_discount ?? tax?.summary?.tax), 0)
|
|
92
95
|
}
|
|
93
96
|
|
|
97
|
+
const containsOnlyNumbers = (str: string) => {
|
|
98
|
+
return /^\d+$/.test(str);
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
const onTextLayout = useCallback((e: any) => {
|
|
102
|
+
setLengthMore(e.nativeEvent.lines.length >= 3); //to check the text is more than 2 lines or not
|
|
103
|
+
},[]);
|
|
104
|
+
|
|
94
105
|
return (
|
|
95
106
|
<OrderContent isOrderGroup={isOrderGroup} lastOrder={lastOrder}>
|
|
96
107
|
{isOrderGroup && (
|
|
@@ -148,7 +159,7 @@ export const OrderContentComponent = (props: OrderContent) => {
|
|
|
148
159
|
<View style={styles.linkWithIcons}>
|
|
149
160
|
<OLink
|
|
150
161
|
PressStyle={styles.linkWithIcons}
|
|
151
|
-
url={`tel:${order?.business?.cellphone}`}
|
|
162
|
+
url={`tel:${containsOnlyNumbers(order?.business?.cellphone) ? order?.business?.cellphone : 'invalid'}`}
|
|
152
163
|
shorcut={`${order?.business?.cellphone}`}
|
|
153
164
|
TextStyle={styles.textLink}
|
|
154
165
|
/>
|
|
@@ -159,7 +170,7 @@ export const OrderContentComponent = (props: OrderContent) => {
|
|
|
159
170
|
<View style={styles.linkWithIcons}>
|
|
160
171
|
<OLink
|
|
161
172
|
PressStyle={styles.linkWithIcons}
|
|
162
|
-
url={`tel:${order?.business?.phone}`}
|
|
173
|
+
url={`tel:${containsOnlyNumbers(order?.business?.cellphone) ? order?.business?.phone : 'invalid'}`}
|
|
163
174
|
shorcut={order?.business?.phone}
|
|
164
175
|
TextStyle={styles.textLink}
|
|
165
176
|
/>
|
|
@@ -176,6 +187,7 @@ export const OrderContentComponent = (props: OrderContent) => {
|
|
|
176
187
|
ios: `maps:0,0?q=${order?.business?.address}`,
|
|
177
188
|
android: `geo:0,0?q=${order?.business?.address}`,
|
|
178
189
|
})}
|
|
190
|
+
numberOfLines={2}
|
|
179
191
|
shorcut={order?.business?.address}
|
|
180
192
|
TextStyle={styles.textLink}
|
|
181
193
|
/>
|
|
@@ -274,7 +286,7 @@ export const OrderContentComponent = (props: OrderContent) => {
|
|
|
274
286
|
<View style={styles.linkWithIcons}>
|
|
275
287
|
<OLink
|
|
276
288
|
PressStyle={styles.linkWithIcons}
|
|
277
|
-
url={`tel:${!!order?.customer?.country_phone_code ? '+' + order?.customer?.country_phone_code : ''} ${order?.customer?.cellphone}`}
|
|
289
|
+
url={`tel:${!!order?.customer?.country_phone_code ? '+' + order?.customer?.country_phone_code : ''} ${containsOnlyNumbers(order?.customer?.cellphone) ? order?.customer?.cellphone : 'invalid'}`}
|
|
278
290
|
shorcut={`${!!order?.customer?.country_phone_code ? '+' + order?.customer?.country_phone_code : ''} ${order?.customer?.cellphone}`}
|
|
279
291
|
TextStyle={styles.textLink}
|
|
280
292
|
/>
|
|
@@ -285,7 +297,7 @@ export const OrderContentComponent = (props: OrderContent) => {
|
|
|
285
297
|
<View style={styles.linkWithIcons}>
|
|
286
298
|
<OLink
|
|
287
299
|
PressStyle={styles.linkWithIcons}
|
|
288
|
-
url={`tel:${order?.customer?.phone}`}
|
|
300
|
+
url={`tel:${containsOnlyNumbers(order?.customer?.phone) ? order?.customer?.phone : 'invalid'}`}
|
|
289
301
|
shorcut={order?.customer?.phone}
|
|
290
302
|
TextStyle={styles.textLink}
|
|
291
303
|
/>
|
|
@@ -293,17 +305,26 @@ export const OrderContentComponent = (props: OrderContent) => {
|
|
|
293
305
|
)}
|
|
294
306
|
|
|
295
307
|
{!!order?.customer?.address && (
|
|
296
|
-
|
|
297
|
-
<
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
308
|
+
<>
|
|
309
|
+
<View style={styles.linkWithIcons}>
|
|
310
|
+
<OLink
|
|
311
|
+
PressStyle={{ ...styles.linkWithIcons, marginBottom: 0 }}
|
|
312
|
+
url={Platform.select({
|
|
313
|
+
ios: `maps:0,0?q=${order?.customer?.address}`,
|
|
314
|
+
android: `geo:0,0?q=${order?.customer?.address}`,
|
|
315
|
+
})}
|
|
316
|
+
onTextLayout={onTextLayout}
|
|
317
|
+
numberOfLines={isReadMore ? 20 : 2}
|
|
318
|
+
shorcut={order?.customer?.address}
|
|
319
|
+
TextStyle={styles.textLink}
|
|
320
|
+
/>
|
|
321
|
+
</View>
|
|
322
|
+
{lengthMore && (
|
|
323
|
+
<TouchableOpacity onPress={() => setIsReadMore(!isReadMore)}>
|
|
324
|
+
<OText size={12} color={theme.colors.statusOrderBlue}>{isReadMore ? t('SHOW_LESS', 'Show less') : t('READ_MORE', 'Read more')}</OText>
|
|
325
|
+
</TouchableOpacity>
|
|
326
|
+
)}
|
|
327
|
+
</>
|
|
307
328
|
)}
|
|
308
329
|
|
|
309
330
|
{!!order?.customer?.internal_number && (
|
|
@@ -333,13 +354,18 @@ export const OrderContentComponent = (props: OrderContent) => {
|
|
|
333
354
|
<View style={{ marginTop: 10 }}>
|
|
334
355
|
{order?.delivery_option !== undefined && order?.delivery_type === 1 && (
|
|
335
356
|
<OText>
|
|
336
|
-
{order?.delivery_option?.name}
|
|
357
|
+
{t(order?.delivery_option?.name?.toUpperCase()?.replace(/ /g, '_'), order?.delivery_option?.name)}
|
|
337
358
|
</OText>
|
|
338
359
|
)}
|
|
339
360
|
{!!order?.comment && (
|
|
340
|
-
|
|
341
|
-
{
|
|
342
|
-
|
|
361
|
+
<>
|
|
362
|
+
<OText weight='500' style={{ marginBottom: 5 }}>
|
|
363
|
+
{t('ORDER_COMMENT', 'Order Comment')}
|
|
364
|
+
</OText>
|
|
365
|
+
<OText style={{ fontStyle: 'italic', opacity: 0.6, marginBottom: 20 }}>
|
|
366
|
+
{order?.comment}
|
|
367
|
+
</OText>
|
|
368
|
+
</>
|
|
343
369
|
)}
|
|
344
370
|
</View>
|
|
345
371
|
)}
|
|
@@ -364,6 +390,7 @@ export const OrderContentComponent = (props: OrderContent) => {
|
|
|
364
390
|
<ProductItemAccordion
|
|
365
391
|
key={product?.id || i}
|
|
366
392
|
product={product}
|
|
393
|
+
currency={order?.currency}
|
|
367
394
|
/>
|
|
368
395
|
))}
|
|
369
396
|
</OrderProducts>
|
|
@@ -372,7 +399,7 @@ export const OrderContentComponent = (props: OrderContent) => {
|
|
|
372
399
|
<Table>
|
|
373
400
|
<OText mBottom={4}>{t('SUBTOTAL', 'Subtotal')}</OText>
|
|
374
401
|
<OText mBottom={4}>
|
|
375
|
-
{parsePrice(((order?.summary?.subtotal ?? order?.subtotal) + getIncludedTaxes()))}
|
|
402
|
+
{parsePrice(((order?.summary?.subtotal ?? order?.subtotal) + getIncludedTaxes()), { currency: order?.currency })}
|
|
376
403
|
</OText>
|
|
377
404
|
</Table>
|
|
378
405
|
{(order?.summary?.discount > 0 ?? order?.discount > 0) && order?.offers?.length === 0 && (
|
|
@@ -385,7 +412,7 @@ export const OrderContentComponent = (props: OrderContent) => {
|
|
|
385
412
|
) : (
|
|
386
413
|
<OText mBottom={4}>{t('DISCOUNT', theme?.defaultLanguages?.DISCOUNT || 'Discount')}</OText>
|
|
387
414
|
)}
|
|
388
|
-
<OText>- {parsePrice(order?.summary?.discount ?? order?.discount)}</OText>
|
|
415
|
+
<OText>- {parsePrice(order?.summary?.discount ?? order?.discount, { currency: order?.currency })}</OText>
|
|
389
416
|
</Table>
|
|
390
417
|
)}
|
|
391
418
|
{
|
|
@@ -393,13 +420,13 @@ export const OrderContentComponent = (props: OrderContent) => {
|
|
|
393
420
|
<Table key={offer.id}>
|
|
394
421
|
<OSRow>
|
|
395
422
|
<OText mBottom={4}>
|
|
396
|
-
{offer.name}
|
|
423
|
+
{t(offer.name?.toUpperCase()?.replace(/ /g, '_'), offer.name)}
|
|
397
424
|
{offer.rate_type === 1 && (
|
|
398
425
|
<OText>{`(${verifyDecimals(offer?.rate, parsePrice)}%)`}</OText>
|
|
399
426
|
)}
|
|
400
427
|
</OText>
|
|
401
428
|
</OSRow>
|
|
402
|
-
<OText mBottom={4}>- {parsePrice(offer?.summary?.discount)}</OText>
|
|
429
|
+
<OText mBottom={4}>- {parsePrice(offer?.summary?.discount, { currency: order?.currency })}</OText>
|
|
403
430
|
</Table>
|
|
404
431
|
))
|
|
405
432
|
}
|
|
@@ -407,9 +434,9 @@ export const OrderContentComponent = (props: OrderContent) => {
|
|
|
407
434
|
<Table>
|
|
408
435
|
<OText mBottom={4}>{t('SUBTOTAL_WITH_DISCOUNT', 'Subtotal with discount')}</OText>
|
|
409
436
|
{order?.tax_type === 1 ? (
|
|
410
|
-
<OText mBottom={4}>{parsePrice((order?.summary?.subtotal_with_discount + getIncludedTaxesDiscounts() ?? 0))}</OText>
|
|
437
|
+
<OText mBottom={4}>{parsePrice((order?.summary?.subtotal_with_discount + getIncludedTaxesDiscounts() ?? 0), { currency: order?.currency })}</OText>
|
|
411
438
|
) : (
|
|
412
|
-
<OText mBottom={4}>{parsePrice(order?.summary?.subtotal_with_discount ?? 0)}</OText>
|
|
439
|
+
<OText mBottom={4}>{parsePrice(order?.summary?.subtotal_with_discount ?? 0, { currency: order?.currency })}</OText>
|
|
413
440
|
)}
|
|
414
441
|
</Table>
|
|
415
442
|
)}
|
|
@@ -419,7 +446,7 @@ export const OrderContentComponent = (props: OrderContent) => {
|
|
|
419
446
|
{t('TAX', 'Tax')} {`(${verifyDecimals(order?.tax, parseNumber)}%)`}
|
|
420
447
|
</OText>
|
|
421
448
|
<OText mBottom={4}>
|
|
422
|
-
{parsePrice(order?.summary?.tax ?? 0)}
|
|
449
|
+
{parsePrice(order?.summary?.tax ?? 0, { currency: order?.currency })}
|
|
423
450
|
</OText>
|
|
424
451
|
</Table>
|
|
425
452
|
)}
|
|
@@ -430,7 +457,7 @@ export const OrderContentComponent = (props: OrderContent) => {
|
|
|
430
457
|
{t('SERVICE_FEE', 'Service fee')}
|
|
431
458
|
{`(${verifyDecimals(order?.service_fee, parseNumber)}%)`}
|
|
432
459
|
</OText>
|
|
433
|
-
<OText mBottom={4}>{parsePrice(order?.summary?.service_fee ?? 0)}</OText>
|
|
460
|
+
<OText mBottom={4}>{parsePrice(order?.summary?.service_fee ?? 0, { currency: order?.currency })}</OText>
|
|
434
461
|
</Table>
|
|
435
462
|
)
|
|
436
463
|
}
|
|
@@ -439,11 +466,11 @@ export const OrderContentComponent = (props: OrderContent) => {
|
|
|
439
466
|
<Table key={tax.id}>
|
|
440
467
|
<OSRow>
|
|
441
468
|
<OText mBottom={4}>
|
|
442
|
-
{tax
|
|
469
|
+
{t(tax?.name?.toUpperCase()?.replace(/ /g, '_'), tax?.name) || t('INHERIT_FROM_BUSINESS', 'Inherit from business')}
|
|
443
470
|
{`(${verifyDecimals(tax?.rate, parseNumber)}%)`}{' '}
|
|
444
471
|
</OText>
|
|
445
472
|
</OSRow>
|
|
446
|
-
<OText mBottom={4}>{parsePrice(tax?.summary?.tax_after_discount ?? tax?.summary?.tax ?? 0)}</OText>
|
|
473
|
+
<OText mBottom={4}>{parsePrice(tax?.summary?.tax_after_discount ?? tax?.summary?.tax ?? 0, { currency: order?.currency })}</OText>
|
|
447
474
|
</Table>
|
|
448
475
|
))
|
|
449
476
|
}
|
|
@@ -452,11 +479,11 @@ export const OrderContentComponent = (props: OrderContent) => {
|
|
|
452
479
|
<Table key={fee.id}>
|
|
453
480
|
<OSRow>
|
|
454
481
|
<OText mBottom={4}>
|
|
455
|
-
{fee
|
|
456
|
-
({fee?.fixed > 0 && `${parsePrice(fee?.fixed)} + `}{fee.percentage}%){' '}
|
|
482
|
+
{t(fee?.name?.toUpperCase()?.replace(/ /g, '_'), fee?.name) || t('INHERIT_FROM_BUSINESS', 'Inherit from business')}
|
|
483
|
+
({fee?.fixed > 0 && `${parsePrice(fee?.fixed, { currency: order?.currency })} + `}{fee.percentage}%){' '}
|
|
457
484
|
</OText>
|
|
458
485
|
</OSRow>
|
|
459
|
-
<OText mBottom={4}>{parsePrice(fee?.summary?.fixed + (fee?.summary?.percentage_after_discount ?? fee?.summary?.percentage) ?? 0)}</OText>
|
|
486
|
+
<OText mBottom={4}>{parsePrice(fee?.summary?.fixed + (fee?.summary?.percentage_after_discount ?? fee?.summary?.percentage) ?? 0, { currency: order?.currency })}</OText>
|
|
460
487
|
</Table>
|
|
461
488
|
))
|
|
462
489
|
}
|
|
@@ -465,13 +492,13 @@ export const OrderContentComponent = (props: OrderContent) => {
|
|
|
465
492
|
<Table key={offer.id}>
|
|
466
493
|
<OSRow>
|
|
467
494
|
<OText mBottom={4}>
|
|
468
|
-
{offer.name}
|
|
495
|
+
{t(offer.name?.toUpperCase()?.replace(/ /g, '_'), offer.name)}
|
|
469
496
|
{offer.rate_type === 1 && (
|
|
470
497
|
<OText>{`(${verifyDecimals(offer?.rate, parsePrice)}%)`}</OText>
|
|
471
498
|
)}
|
|
472
499
|
</OText>
|
|
473
500
|
</OSRow>
|
|
474
|
-
<OText mBottom={4}>- {parsePrice(offer?.summary?.discount)}</OText>
|
|
501
|
+
<OText mBottom={4}>- {parsePrice(offer?.summary?.discount, { currency: order?.currency })}</OText>
|
|
475
502
|
</Table>
|
|
476
503
|
))
|
|
477
504
|
}
|
|
@@ -483,7 +510,7 @@ export const OrderContentComponent = (props: OrderContent) => {
|
|
|
483
510
|
</OText>
|
|
484
511
|
|
|
485
512
|
<OText mBottom={4}>
|
|
486
|
-
{parsePrice(order?.summary?.delivery_price)}
|
|
513
|
+
{parsePrice(order?.summary?.delivery_price, { currency: order?.currency })}
|
|
487
514
|
</OText>
|
|
488
515
|
</Table>
|
|
489
516
|
)
|
|
@@ -493,13 +520,13 @@ export const OrderContentComponent = (props: OrderContent) => {
|
|
|
493
520
|
<Table key={offer.id}>
|
|
494
521
|
<OSRow>
|
|
495
522
|
<OText mBottom={4}>
|
|
496
|
-
{offer.name}
|
|
523
|
+
{t(offer.name?.toUpperCase()?.replace(/ /g, '_'), offer.name)}
|
|
497
524
|
{offer.rate_type === 1 && (
|
|
498
525
|
<OText>{`(${verifyDecimals(offer?.rate, parsePrice)}%)`}</OText>
|
|
499
526
|
)}
|
|
500
527
|
</OText>
|
|
501
528
|
</OSRow>
|
|
502
|
-
<OText mBottom={4}>- {parsePrice(offer?.summary?.discount)}</OText>
|
|
529
|
+
<OText mBottom={4}>- {parsePrice(offer?.summary?.discount, { currency: order?.currency })}</OText>
|
|
503
530
|
</Table>
|
|
504
531
|
))
|
|
505
532
|
}
|
|
@@ -514,7 +541,7 @@ export const OrderContentComponent = (props: OrderContent) => {
|
|
|
514
541
|
`(${verifyDecimals(order?.summary?.driver_tip, parseNumber)}%)`
|
|
515
542
|
)}
|
|
516
543
|
</OText>
|
|
517
|
-
<OText mBottom={4}>{parsePrice(order?.summary?.driver_tip ?? order?.totalDriverTip)}</OText>
|
|
544
|
+
<OText mBottom={4}>{parsePrice(order?.summary?.driver_tip ?? order?.totalDriverTip, { currency: order?.currency })}</OText>
|
|
518
545
|
</Table>
|
|
519
546
|
)}
|
|
520
547
|
|
|
@@ -528,7 +555,7 @@ export const OrderContentComponent = (props: OrderContent) => {
|
|
|
528
555
|
mBottom={4}
|
|
529
556
|
style={styles.textBold}
|
|
530
557
|
color={theme.colors.primary}>
|
|
531
|
-
{parsePrice(order?.summary?.total ?? order?.total)}
|
|
558
|
+
{parsePrice(order?.summary?.total ?? order?.total, { currency: order?.currency })}
|
|
532
559
|
</OText>
|
|
533
560
|
</Table>
|
|
534
561
|
</Total>
|
|
@@ -562,7 +589,7 @@ export const OrderContentComponent = (props: OrderContent) => {
|
|
|
562
589
|
<OText>
|
|
563
590
|
{event?.wallet_event
|
|
564
591
|
? walletName[event?.wallet_event?.wallet?.type]?.name
|
|
565
|
-
: event?.paymethod?.name}
|
|
592
|
+
: t(event?.paymethod?.name?.toUpperCase()?.replace(/ /g, '_'), event?.paymethod?.name)}
|
|
566
593
|
</OText>
|
|
567
594
|
{event?.data?.charge_id && (
|
|
568
595
|
<OText>
|
|
@@ -571,7 +598,7 @@ export const OrderContentComponent = (props: OrderContent) => {
|
|
|
571
598
|
)}
|
|
572
599
|
</View>
|
|
573
600
|
<OText>
|
|
574
|
-
-{parsePrice(event.amount)}
|
|
601
|
+
-{parsePrice(event.amount, { currency: order?.currency })}
|
|
575
602
|
</OText>
|
|
576
603
|
</View>
|
|
577
604
|
))}
|
|
@@ -271,7 +271,7 @@ export const OrderHeaderComponent = (props: OrderHeader) => {
|
|
|
271
271
|
{order?.delivery_option && (
|
|
272
272
|
<OText size={13}>
|
|
273
273
|
<OText size={13} weight='bold'>{`${t('DELIVERY_PREFERENCE', 'Delivery Preference')}: `}</OText>
|
|
274
|
-
{order?.delivery_option?.name}
|
|
274
|
+
{t(order?.delivery_option?.name?.toUpperCase()?.replace(/ /g, '_'), order?.delivery_option?.name)}
|
|
275
275
|
</OText>
|
|
276
276
|
)}
|
|
277
277
|
{order?.payment_events?.length > 0 && (
|
|
@@ -286,8 +286,8 @@ export const OrderHeaderComponent = (props: OrderHeader) => {
|
|
|
286
286
|
? `${walletName[event?.wallet_event?.wallet?.type]?.name} - `
|
|
287
287
|
: walletName[event?.wallet_event?.wallet?.type]?.name
|
|
288
288
|
: idx < order?.payment_events?.length - 1
|
|
289
|
-
? `${event?.paymethod?.name} - `
|
|
290
|
-
: event?.paymethod?.name
|
|
289
|
+
? `${t(event?.paymethod?.name?.toUpperCase()?.replace(/ /g, '_'), event?.paymethod?.name)} - `
|
|
290
|
+
: t(event?.paymethod?.name?.toUpperCase()?.replace(/ /g, '_'), event?.paymethod?.name)
|
|
291
291
|
})}
|
|
292
292
|
</OText>
|
|
293
293
|
</View>
|
|
@@ -1,10 +1,11 @@
|
|
|
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 } 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';
|
|
7
7
|
import FontistoIcon from 'react-native-vector-icons/Fontisto'
|
|
8
|
+
import AntDesignIcon from 'react-native-vector-icons/AntDesign'
|
|
8
9
|
import { useTheme } from 'styled-components/native';
|
|
9
10
|
import { DeviceOrientationMethods } from '../../../../../src/hooks/DeviceOrientation'
|
|
10
11
|
import { NotificationSetting } from '../../../../../src/components/NotificationSetting'
|
|
@@ -19,7 +20,6 @@ import {
|
|
|
19
20
|
IconWrapper,
|
|
20
21
|
ModalContainer,
|
|
21
22
|
ModalTitle,
|
|
22
|
-
FilterBtnWrapper,
|
|
23
23
|
TabPressable,
|
|
24
24
|
OrderStatus,
|
|
25
25
|
SlaOption,
|
|
@@ -33,41 +33,17 @@ import {
|
|
|
33
33
|
ItemContent,
|
|
34
34
|
TimerInputWrapper,
|
|
35
35
|
OverLine,
|
|
36
|
-
|
|
36
|
+
InputContainer
|
|
37
37
|
} from './styles';
|
|
38
38
|
import { PreviousOrders } from '../PreviousOrders';
|
|
39
39
|
import { OrdersOptionParams } from '../../types';
|
|
40
40
|
|
|
41
|
-
import { TouchableOpacity } from 'react-native-gesture-handler';
|
|
42
|
-
import GestureRecognizer from 'react-native-swipe-gestures';
|
|
43
|
-
import ODropDown from '../shared/ODropDown';
|
|
44
|
-
import { OrdersOptionStatus } from '../OrdersOptionStatus'
|
|
45
41
|
import { OrdersOptionCity } from '../OrdersOptionCity';
|
|
46
42
|
import { OrdersOptionBusiness } from '../OrdersOptionBusiness';
|
|
47
43
|
import { OrdersOptionDelivery } from '../OrdersOptionDelivery';
|
|
48
44
|
import { OrdersOptionPaymethod } from '../OrdersOptionPaymethod';
|
|
49
45
|
import { OrdersOptionDriver } from '../OrdersOptionDriver';
|
|
50
46
|
import { OrdersOptionDate } from '../OrdersOptionDate';
|
|
51
|
-
|
|
52
|
-
const tabsList: any = {
|
|
53
|
-
pending: 1,
|
|
54
|
-
inProgress: 2,
|
|
55
|
-
completed: 3,
|
|
56
|
-
cancelled: 4
|
|
57
|
-
};
|
|
58
|
-
|
|
59
|
-
const tabsListText: any = {
|
|
60
|
-
1: 'pending',
|
|
61
|
-
2: 'inProgress',
|
|
62
|
-
3: 'completed',
|
|
63
|
-
4: 'cancelled'
|
|
64
|
-
};
|
|
65
|
-
|
|
66
|
-
const swipeConfig = {
|
|
67
|
-
velocityThreshold: 0.3,
|
|
68
|
-
directionalOffsetThreshold: 80
|
|
69
|
-
};
|
|
70
|
-
|
|
71
47
|
const { useDeviceOrientation, PORTRAIT } = DeviceOrientationMethods
|
|
72
48
|
|
|
73
49
|
const OrdersOptionUI = (props: OrdersOptionParams) => {
|
|
@@ -79,10 +55,10 @@ const OrdersOptionUI = (props: OrdersOptionParams) => {
|
|
|
79
55
|
ordersGroup,
|
|
80
56
|
setOrdersGroup,
|
|
81
57
|
orderStatus,
|
|
58
|
+
ordersFormatted,
|
|
82
59
|
loadOrders,
|
|
83
60
|
loadMoreOrders,
|
|
84
61
|
onNavigationRedirect,
|
|
85
|
-
filtered,
|
|
86
62
|
onFiltered,
|
|
87
63
|
handleClickOrder,
|
|
88
64
|
isBusinessApp,
|
|
@@ -90,7 +66,9 @@ const OrdersOptionUI = (props: OrdersOptionParams) => {
|
|
|
90
66
|
logisticOrders,
|
|
91
67
|
loadLogisticOrders,
|
|
92
68
|
isLogisticActivated,
|
|
93
|
-
isAlsea
|
|
69
|
+
isAlsea,
|
|
70
|
+
handleChangeOrderStatus,
|
|
71
|
+
handleSendCustomerReview
|
|
94
72
|
} = props;
|
|
95
73
|
|
|
96
74
|
const defaultSearchList = {
|
|
@@ -120,10 +98,10 @@ const OrdersOptionUI = (props: OrdersOptionParams) => {
|
|
|
120
98
|
const [slaSettingTime, setSlaSettingTime] = useState(6000)
|
|
121
99
|
const [currentDeliveryType, setCurrentDeliveryType] = useState('Delivery')
|
|
122
100
|
const [search, setSearch] = useState(defaultSearchList)
|
|
123
|
-
const [selectedTabStatus, setSelectedTabStatus] = useState([])
|
|
101
|
+
const [selectedTabStatus, setSelectedTabStatus] = useState<any>([])
|
|
124
102
|
const [hour, setHour] = useState(0)
|
|
125
103
|
const [minute, setMinute] = useState(0)
|
|
126
|
-
|
|
104
|
+
const [openedSelect, setOpenedSelect] = useState('')
|
|
127
105
|
const WIDTH_SCREEN = orientationState?.dimensions?.width
|
|
128
106
|
const HEIGHT_SCREEN = orientationState?.dimensions?.height
|
|
129
107
|
const IS_PORTRAIT = orientationState.orientation === PORTRAIT
|
|
@@ -344,26 +322,6 @@ const OrdersOptionUI = (props: OrdersOptionParams) => {
|
|
|
344
322
|
})
|
|
345
323
|
}
|
|
346
324
|
|
|
347
|
-
const onSwipeLeft = () => {
|
|
348
|
-
let currentTab = tabsList[currentTabSelected]
|
|
349
|
-
currentTab = currentTab >= 4 ? null : currentTab + 1
|
|
350
|
-
|
|
351
|
-
if (!currentTab) return
|
|
352
|
-
|
|
353
|
-
const nextTab = tabsListText[currentTab]
|
|
354
|
-
nextTab && setCurrentTabSelected(nextTab)
|
|
355
|
-
}
|
|
356
|
-
|
|
357
|
-
const onSwipeRight = () => {
|
|
358
|
-
let currentTab = tabsList[currentTabSelected]
|
|
359
|
-
currentTab = currentTab <= 1 ? null : currentTab - 1
|
|
360
|
-
|
|
361
|
-
if (!currentTab) return
|
|
362
|
-
|
|
363
|
-
const nextTab = tabsListText[currentTab]
|
|
364
|
-
nextTab && setCurrentTabSelected(nextTab)
|
|
365
|
-
}
|
|
366
|
-
|
|
367
325
|
const calculateDate = (type: any, from: any, to: any) => {
|
|
368
326
|
switch (type) {
|
|
369
327
|
case 'today':
|
|
@@ -403,13 +361,15 @@ const OrdersOptionUI = (props: OrdersOptionParams) => {
|
|
|
403
361
|
setOpenSLASettingModal(false)
|
|
404
362
|
}
|
|
405
363
|
|
|
406
|
-
|
|
407
|
-
setCurrentFilters(null)
|
|
408
|
-
onFiltered && onFiltered(null)
|
|
364
|
+
const handleClearFilters = () => {
|
|
409
365
|
setSearch(defaultSearchList)
|
|
366
|
+
}
|
|
367
|
+
|
|
368
|
+
useEffect(() => {
|
|
410
369
|
scrollRefTab.current?.scrollTo({ animated: true });
|
|
411
370
|
scrollListRef.current?.scrollTo({ animated: true });
|
|
412
371
|
scrollRef.current?.scrollTo({ y: 0, animated: true });
|
|
372
|
+
setTags({ values: [] })
|
|
413
373
|
}, [currentTabSelected])
|
|
414
374
|
|
|
415
375
|
useEffect(() => {
|
|
@@ -417,12 +377,6 @@ const OrdersOptionUI = (props: OrdersOptionParams) => {
|
|
|
417
377
|
}, [])
|
|
418
378
|
|
|
419
379
|
return (
|
|
420
|
-
// <GestureRecognizer
|
|
421
|
-
// onSwipeLeft={onSwipeLeft}
|
|
422
|
-
// onSwipeRight={onSwipeRight}
|
|
423
|
-
// config={swipeConfig}
|
|
424
|
-
// style={{ flex: 1 }}
|
|
425
|
-
// >
|
|
426
380
|
<>
|
|
427
381
|
<View style={styles.header}>
|
|
428
382
|
<OText style={styles.title}>{t('MY_ORDERS', 'My orders')}</OText>
|
|
@@ -631,12 +585,18 @@ const OrdersOptionUI = (props: OrdersOptionParams) => {
|
|
|
631
585
|
currentTabSelected !== 'logisticOrders' &&
|
|
632
586
|
(
|
|
633
587
|
<PreviousOrders
|
|
634
|
-
orders={
|
|
588
|
+
orders={ordersFormatted}
|
|
589
|
+
navigation={props.navigation}
|
|
635
590
|
onNavigationRedirect={onNavigationRedirect}
|
|
636
591
|
getOrderStatus={getOrderStatus}
|
|
637
592
|
handleClickOrder={handleClickOrder}
|
|
638
593
|
slaSettingTime={slaSettingTime}
|
|
639
594
|
currentTabSelected={currentTabSelected}
|
|
595
|
+
appTitle={props.orderDetailsProps?.appTitle}
|
|
596
|
+
actions={props.orderDetailsProps?.actions}
|
|
597
|
+
orderTitle={props.orderDetailsProps?.orderTitle}
|
|
598
|
+
handleChangeOrderStatus={handleChangeOrderStatus}
|
|
599
|
+
handleSendCustomerReview={handleSendCustomerReview}
|
|
640
600
|
/>
|
|
641
601
|
)}
|
|
642
602
|
{!logisticOrders?.error?.length &&
|
|
@@ -726,7 +686,6 @@ const OrdersOptionUI = (props: OrdersOptionParams) => {
|
|
|
726
686
|
)}
|
|
727
687
|
</ScrollView>
|
|
728
688
|
</View>
|
|
729
|
-
{/* </GestureRecognizer> */}
|
|
730
689
|
|
|
731
690
|
{isBusinessApp && (
|
|
732
691
|
<NewOrderNotification isBusinessApp={isBusinessApp} />
|
|
@@ -754,22 +713,34 @@ const OrdersOptionUI = (props: OrdersOptionParams) => {
|
|
|
754
713
|
{openSearchModal && (
|
|
755
714
|
<SearchModalContent>
|
|
756
715
|
<ModalTitle>{t('SEARCH_ORDERS', 'Search orders')}</ModalTitle>
|
|
757
|
-
<
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
716
|
+
<InputContainer>
|
|
717
|
+
<OInput
|
|
718
|
+
value={search.id}
|
|
719
|
+
onChange={(value: any) => setSearch({ ...search, id: value })}
|
|
720
|
+
style={styles.inputStyle}
|
|
721
|
+
placeholder={t('ORDER_NUMBER', 'Order number')}
|
|
722
|
+
autoCorrect={false}
|
|
723
|
+
/>
|
|
724
|
+
<AntDesignIcon
|
|
725
|
+
name='close'
|
|
726
|
+
size={20}
|
|
727
|
+
style={{ position: 'absolute', right: 12, top: 13 }}
|
|
728
|
+
onPress={() => setSearch({ ...search, id: '' })}
|
|
729
|
+
/>
|
|
730
|
+
</InputContainer>
|
|
764
731
|
<OrdersOptionDate
|
|
765
732
|
{...props}
|
|
766
733
|
search={search}
|
|
767
734
|
onSearch={setSearch}
|
|
735
|
+
setOpenedSelect={setOpenedSelect}
|
|
736
|
+
openedSelect={openedSelect}
|
|
768
737
|
/>
|
|
769
738
|
<OrdersOptionCity
|
|
770
739
|
{...props}
|
|
771
740
|
search={search}
|
|
772
741
|
onSearch={setSearch}
|
|
742
|
+
setOpenedSelect={setOpenedSelect}
|
|
743
|
+
openedSelect={openedSelect}
|
|
773
744
|
/>
|
|
774
745
|
{isBusinessApp && (
|
|
775
746
|
<>
|
|
@@ -777,21 +748,29 @@ const OrdersOptionUI = (props: OrdersOptionParams) => {
|
|
|
777
748
|
{...props}
|
|
778
749
|
search={search}
|
|
779
750
|
onSearch={setSearch}
|
|
751
|
+
setOpenedSelect={setOpenedSelect}
|
|
752
|
+
openedSelect={openedSelect}
|
|
780
753
|
/>
|
|
781
754
|
<OrdersOptionDelivery
|
|
782
755
|
{...props}
|
|
783
756
|
search={search}
|
|
784
757
|
onSearch={setSearch}
|
|
758
|
+
setOpenedSelect={setOpenedSelect}
|
|
759
|
+
openedSelect={openedSelect}
|
|
785
760
|
/>
|
|
786
761
|
<OrdersOptionDriver
|
|
787
762
|
{...props}
|
|
788
763
|
search={search}
|
|
789
764
|
onSearch={setSearch}
|
|
765
|
+
setOpenedSelect={setOpenedSelect}
|
|
766
|
+
openedSelect={openedSelect}
|
|
790
767
|
/>
|
|
791
768
|
<OrdersOptionPaymethod
|
|
792
769
|
{...props}
|
|
793
770
|
search={search}
|
|
794
771
|
onSearch={setSearch}
|
|
772
|
+
setOpenedSelect={setOpenedSelect}
|
|
773
|
+
openedSelect={openedSelect}
|
|
795
774
|
/>
|
|
796
775
|
</>
|
|
797
776
|
)}
|
|
@@ -801,13 +780,24 @@ const OrdersOptionUI = (props: OrdersOptionParams) => {
|
|
|
801
780
|
imgRightSrc={null}
|
|
802
781
|
style={{
|
|
803
782
|
borderRadius: 7.6,
|
|
804
|
-
marginBottom:
|
|
783
|
+
marginBottom: 10,
|
|
805
784
|
marginTop: 60,
|
|
806
785
|
zIndex: 12
|
|
807
786
|
}}
|
|
808
787
|
onClick={applyFilters}
|
|
809
788
|
/>
|
|
810
|
-
|
|
789
|
+
<OButton
|
|
790
|
+
text={t('CLEAR_SEARCh', 'Clear search')}
|
|
791
|
+
imgRightSrc={null}
|
|
792
|
+
bgColor='#fff'
|
|
793
|
+
style={{
|
|
794
|
+
borderRadius: 7.6,
|
|
795
|
+
marginBottom: 0,
|
|
796
|
+
marginTop: 0,
|
|
797
|
+
zIndex: 12
|
|
798
|
+
}}
|
|
799
|
+
onClick={handleClearFilters}
|
|
800
|
+
/>
|
|
811
801
|
</SearchModalContent>
|
|
812
802
|
)}
|
|
813
803
|
{openSLASettingModal && (
|
|
@@ -849,7 +839,7 @@ const OrdersOptionUI = (props: OrdersOptionParams) => {
|
|
|
849
839
|
</ScrollView>
|
|
850
840
|
</FiltersTab>
|
|
851
841
|
<DeliveryStatusWrapper>
|
|
852
|
-
{selectedTabStatus && selectedTabStatus.length > 0 && selectedTabStatus.map((item, i) => (
|
|
842
|
+
{selectedTabStatus && selectedTabStatus.length > 0 && selectedTabStatus.map((item: any, i: number) => (
|
|
853
843
|
<StatusBlock
|
|
854
844
|
key={i}
|
|
855
845
|
item={item}
|
|
@@ -10,7 +10,9 @@ export const OrdersOptionBusinessUI = (props: any) => {
|
|
|
10
10
|
const {
|
|
11
11
|
search,
|
|
12
12
|
onSearch,
|
|
13
|
-
businessesList
|
|
13
|
+
businessesList,
|
|
14
|
+
setOpenedSelect,
|
|
15
|
+
openedSelect
|
|
14
16
|
} = props
|
|
15
17
|
|
|
16
18
|
const theme = useTheme();
|
|
@@ -25,6 +27,14 @@ export const OrdersOptionBusinessUI = (props: any) => {
|
|
|
25
27
|
setOptionsList(businesses)
|
|
26
28
|
}, [businessesList?.businesses])
|
|
27
29
|
|
|
30
|
+
const handleClear = () => {
|
|
31
|
+
onSearch({ ...search, business: '' })
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
const handleOpenSelect = () => {
|
|
35
|
+
setOpenedSelect('business')
|
|
36
|
+
}
|
|
37
|
+
|
|
28
38
|
return (
|
|
29
39
|
<Container isIos={Platform.OS === 'ios'}>
|
|
30
40
|
<ODropDown
|
|
@@ -36,6 +46,10 @@ export const OrdersOptionBusinessUI = (props: any) => {
|
|
|
36
46
|
textcolor={theme.colors.unselectText}
|
|
37
47
|
placeholder={t('SELECT_BUSINESS', 'Select Business')}
|
|
38
48
|
dropViewMaxHeight={200}
|
|
49
|
+
handleClear={handleClear}
|
|
50
|
+
handleOpenSelect={handleOpenSelect}
|
|
51
|
+
openedSelect={openedSelect}
|
|
52
|
+
selectType='business'
|
|
39
53
|
/>
|
|
40
54
|
</Container>
|
|
41
55
|
);
|