ordering-ui-react-native 0.15.37 → 0.15.38-test
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 +3 -2
- package/src/components/BusinessTypeFilter/index.tsx +4 -1
- package/src/components/LanguageSelector/index.tsx +1 -0
- package/src/components/OrderDetails/index.tsx +2 -2
- package/src/components/PaymentOptions/index.tsx +2 -2
- package/src/components/StripeMethodForm/index.tsx +22 -21
- package/src/pages/BusinessProductsList.tsx +1 -0
- package/src/pages/BusinessesListing.tsx +1 -1
- package/themes/business/src/components/Home/index.tsx +128 -55
- package/themes/business/src/components/Home/styles.tsx +8 -1
- package/themes/business/src/components/NewOrderNotification/index.tsx +59 -98
- package/themes/business/src/components/OrderDetails/Delivery.tsx +9 -9
- package/themes/business/src/components/OrderDetails/OrderContentComponent.tsx +152 -91
- package/themes/business/src/components/OrderDetails/styles.tsx +7 -0
- package/themes/business/src/components/OrdersListManager/index.tsx +51 -48
- package/themes/business/src/components/OrdersOption/index.tsx +52 -48
- package/themes/business/src/components/PreviousOrders/index.tsx +50 -14
- package/themes/kiosk/src/components/Cart/index.tsx +99 -25
- package/themes/kiosk/src/components/Cart/styles.tsx +6 -0
- package/themes/kiosk/src/components/OrderDetails/index.tsx +134 -39
- package/themes/kiosk/src/components/OrderDetails/styles.tsx +5 -0
- package/themes/kiosk/src/components/ProductForm/index.tsx +2 -2
- package/themes/kiosk/src/types/index.d.ts +2 -0
- package/themes/original/index.tsx +165 -0
- package/themes/original/src/components/AddressForm/index.tsx +15 -10
- package/themes/original/src/components/AddressList/index.tsx +28 -2
- package/themes/original/src/components/AppleLogin/index.tsx +118 -77
- package/themes/original/src/components/BusinessBasicInformation/index.tsx +96 -45
- package/themes/original/src/components/BusinessBasicInformation/styles.tsx +28 -1
- package/themes/original/src/components/BusinessController/index.tsx +28 -9
- package/themes/original/src/components/BusinessController/styles.tsx +22 -0
- package/themes/original/src/components/BusinessFeaturedController/index.tsx +20 -1
- package/themes/original/src/components/BusinessFeaturedController/styles.tsx +23 -0
- package/themes/original/src/components/BusinessListingSearch/index.tsx +4 -0
- package/themes/original/src/components/BusinessMenuList/index.tsx +11 -4
- package/themes/original/src/components/BusinessPreorder/index.tsx +141 -121
- package/themes/original/src/components/BusinessProductsCategories/index.tsx +7 -5
- package/themes/original/src/components/BusinessProductsList/index.tsx +126 -21
- package/themes/original/src/components/BusinessProductsList/styles.tsx +32 -2
- package/themes/original/src/components/BusinessProductsListing/index.tsx +12 -5
- package/themes/original/src/components/BusinessReviews/index.tsx +4 -25
- package/themes/original/src/components/BusinessesListing/index.tsx +1 -2
- package/themes/original/src/components/Cart/index.tsx +1 -3
- package/themes/original/src/components/CartContent/index.tsx +2 -2
- package/themes/original/src/components/Checkout/index.tsx +2 -1
- package/themes/original/src/components/Home/index.tsx +1 -1
- package/themes/original/src/components/LoginForm/index.tsx +73 -2
- package/themes/original/src/components/LoginForm/styles.tsx +6 -1
- package/themes/original/src/components/LogoutButton/index.tsx +7 -1
- package/themes/original/src/components/Messages/index.tsx +5 -0
- package/themes/original/src/components/Messages/styles.tsx +1 -3
- package/themes/original/src/components/MomentOption/index.tsx +10 -1
- package/themes/original/src/components/MomentOption/styles.tsx +1 -1
- package/themes/original/src/components/OrderDetails/index.tsx +1 -3
- package/themes/original/src/components/OrderProgress/index.tsx +3 -3
- package/themes/original/src/components/OrderProgress/styles.tsx +1 -0
- package/themes/original/src/components/OrderSummary/index.tsx +2 -2
- package/themes/original/src/components/PaymentOptionWallet/index.tsx +6 -2
- package/themes/original/src/components/PaymentOptions/index.tsx +3 -1
- package/themes/original/src/components/PhoneInputNumber/index.tsx +10 -4
- package/themes/original/src/components/PreviousOrders/index.tsx +14 -12
- package/themes/original/src/components/ProductForm/index.tsx +4 -4
- package/themes/original/src/components/Promotions/index.tsx +232 -0
- package/themes/original/src/components/Promotions/styles.tsx +80 -0
- package/themes/original/src/components/SignupForm/index.tsx +109 -13
- package/themes/original/src/components/SingleProductCard/index.tsx +39 -18
- package/themes/original/src/components/SingleProductCard/styles.tsx +28 -1
- package/themes/original/src/components/TaxInformation/index.tsx +10 -4
- package/themes/original/src/components/UserFormDetails/index.tsx +13 -2
- package/themes/original/src/components/UserProfile/index.tsx +53 -8
- package/themes/original/src/components/Wallets/index.tsx +57 -3
- package/themes/original/src/components/Wallets/styles.tsx +21 -0
- package/themes/original/src/components/shared/HeaderTitle.tsx +21 -0
- package/themes/original/src/components/shared/index.tsx +2 -0
- package/themes/original/src/config/constants.tsx +6 -6
- package/themes/original/src/types/index.tsx +21 -1
- package/themes/original/src/utils/index.tsx +9 -0
- package/themes/single-business/src/components/AddressList/index.tsx +1 -1
- package/themes/single-business/src/components/UserProfile/index.tsx +1 -1
|
@@ -101,9 +101,9 @@ export const OrderDetailsUI = (props: OrderDetailsParams) => {
|
|
|
101
101
|
};
|
|
102
102
|
|
|
103
103
|
const handleOpenMapView = async () => {
|
|
104
|
-
if (permissions
|
|
104
|
+
if (permissions?.locationStatus === 'granted') {
|
|
105
105
|
setOpenModalForMapView(!openModalForMapView);
|
|
106
|
-
} else if (permissions
|
|
106
|
+
} else if (permissions?.locationStatus === 'blocked') {
|
|
107
107
|
// redirectToSettings();
|
|
108
108
|
showToast(
|
|
109
109
|
ToastType.Error,
|
|
@@ -141,9 +141,9 @@ export const OrderDetailsUI = (props: OrderDetailsParams) => {
|
|
|
141
141
|
handleArrowBack()
|
|
142
142
|
}
|
|
143
143
|
|
|
144
|
-
const handleAcceptLogisticOrder = (order
|
|
144
|
+
const handleAcceptLogisticOrder = (order: any) => {
|
|
145
145
|
handleClickLogisticOrder?.(1, order?.logistic_order_id)
|
|
146
|
-
if(order?.order_group){
|
|
146
|
+
if (order?.order_group) {
|
|
147
147
|
handleArrowBack()
|
|
148
148
|
}
|
|
149
149
|
}
|
|
@@ -166,10 +166,10 @@ export const OrderDetailsUI = (props: OrderDetailsParams) => {
|
|
|
166
166
|
];
|
|
167
167
|
|
|
168
168
|
useEffect(() => {
|
|
169
|
-
if (permissions
|
|
169
|
+
if (permissions?.locationStatus !== 'granted' && openModalForMapView) {
|
|
170
170
|
setOpenModalForMapView(false);
|
|
171
171
|
}
|
|
172
|
-
}, [permissions
|
|
172
|
+
}, [permissions?.locationStatus]);
|
|
173
173
|
|
|
174
174
|
useEffect(() => {
|
|
175
175
|
if (openModalForAccept) {
|
|
@@ -215,8 +215,8 @@ export const OrderDetailsUI = (props: OrderDetailsParams) => {
|
|
|
215
215
|
}, [messagesReadList]);
|
|
216
216
|
|
|
217
217
|
useEffect(() => {
|
|
218
|
-
forceUpdate && handleViewActionOrder && handleViewActionOrder(forceUpdate === 9 ? 'forcePickUp': 'forceDelivery')
|
|
219
|
-
},[forceUpdate])
|
|
218
|
+
forceUpdate && handleViewActionOrder && handleViewActionOrder(forceUpdate === 9 ? 'forcePickUp' : 'forceDelivery')
|
|
219
|
+
}, [forceUpdate])
|
|
220
220
|
|
|
221
221
|
const styles = StyleSheet.create({
|
|
222
222
|
btnPickUp: {
|
|
@@ -254,7 +254,7 @@ export const OrderDetailsUI = (props: OrderDetailsParams) => {
|
|
|
254
254
|
);
|
|
255
255
|
}
|
|
256
256
|
|
|
257
|
-
const OrderDetailsInformation = (props
|
|
257
|
+
const OrderDetailsInformation = (props: { order: any, isOrderGroup?: boolean, lastOrder?: boolean }) => {
|
|
258
258
|
const {
|
|
259
259
|
order,
|
|
260
260
|
isOrderGroup,
|
|
@@ -11,6 +11,7 @@ import {
|
|
|
11
11
|
Table,
|
|
12
12
|
OrderBill,
|
|
13
13
|
Total,
|
|
14
|
+
OSRow,
|
|
14
15
|
} from './styles';
|
|
15
16
|
|
|
16
17
|
import { ProductItemAccordion } from '../ProductItemAccordion';
|
|
@@ -75,11 +76,52 @@ export const OrderContentComponent = (props: OrderContent) => {
|
|
|
75
76
|
}
|
|
76
77
|
})
|
|
77
78
|
|
|
79
|
+
const getIncludedTaxes = () => {
|
|
80
|
+
if (order?.taxes?.length === 0) {
|
|
81
|
+
return order.tax_type === 1 ? order?.summary?.tax ?? 0 : 0
|
|
82
|
+
} else {
|
|
83
|
+
return order?.taxes.reduce((taxIncluded: number, tax: any) => {
|
|
84
|
+
return taxIncluded + (tax.type === 1 ? tax.summary?.tax : 0)
|
|
85
|
+
}, 0)
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
const getIncludedTaxesDiscounts = () => {
|
|
90
|
+
return order?.taxes?.filter((tax: any) => tax?.type === 1)?.reduce((carry: number, tax: any) => carry + (tax?.summary?.tax_after_discount ?? tax?.summary?.tax), 0)
|
|
91
|
+
}
|
|
92
|
+
|
|
78
93
|
return (
|
|
79
94
|
<OrderContent isOrderGroup={isOrderGroup} lastOrder={lastOrder}>
|
|
80
95
|
{isOrderGroup && (
|
|
81
96
|
<OText size={18}>{t('ORDER', 'Order')} #{isOrderGroup ? order?.order_group_id : order?.id}</OText>
|
|
82
97
|
)}
|
|
98
|
+
|
|
99
|
+
{order?.metafields?.length > 0 && (
|
|
100
|
+
<OrderBusiness>
|
|
101
|
+
<OText style={{ marginBottom: 5 }} size={16} weight="600">
|
|
102
|
+
{t('CUSTOM_FIELDS', 'Custom fields')}
|
|
103
|
+
</OText>
|
|
104
|
+
|
|
105
|
+
{order.metafields.map((field: any) => (
|
|
106
|
+
<View
|
|
107
|
+
key={field.id}
|
|
108
|
+
style={{
|
|
109
|
+
width: '100%',
|
|
110
|
+
flexDirection: 'row',
|
|
111
|
+
marginBottom: 5
|
|
112
|
+
}}
|
|
113
|
+
>
|
|
114
|
+
<OText style={{ width: '50%' }}>
|
|
115
|
+
{field.key}
|
|
116
|
+
</OText>
|
|
117
|
+
<OText style={{ width: '45%', textAlign: 'right' }}>
|
|
118
|
+
{field.value}
|
|
119
|
+
</OText>
|
|
120
|
+
</View>
|
|
121
|
+
))}
|
|
122
|
+
</OrderBusiness>
|
|
123
|
+
)}
|
|
124
|
+
|
|
83
125
|
<OrderBusiness>
|
|
84
126
|
<OText style={{ marginBottom: 5 }} size={16} weight="600">
|
|
85
127
|
{t('BUSINESS_DETAILS', 'Business details')}
|
|
@@ -281,14 +323,14 @@ export const OrderContentComponent = (props: OrderContent) => {
|
|
|
281
323
|
</OText>
|
|
282
324
|
)}
|
|
283
325
|
{((order?.delivery_option !== undefined && order?.delivery_type === 1) || !!order?.comment) && (
|
|
284
|
-
<View style={{marginTop: 10}}>
|
|
326
|
+
<View style={{ marginTop: 10 }}>
|
|
285
327
|
{order?.delivery_option !== undefined && order?.delivery_type === 1 && (
|
|
286
328
|
<OText>
|
|
287
329
|
{order?.delivery_option?.name}
|
|
288
330
|
</OText>
|
|
289
331
|
)}
|
|
290
332
|
{!!order?.comment && (
|
|
291
|
-
<OText style={{fontStyle: 'italic', opacity: 0.6, marginBottom: 5}}>
|
|
333
|
+
<OText style={{ fontStyle: 'italic', opacity: 0.6, marginBottom: 5 }}>
|
|
292
334
|
{order?.comment}
|
|
293
335
|
</OText>
|
|
294
336
|
)}
|
|
@@ -323,84 +365,109 @@ export const OrderContentComponent = (props: OrderContent) => {
|
|
|
323
365
|
<Table>
|
|
324
366
|
<OText mBottom={4}>{t('SUBTOTAL', 'Subtotal')}</OText>
|
|
325
367
|
<OText mBottom={4}>
|
|
326
|
-
{parsePrice(
|
|
327
|
-
order.tax_type === 1
|
|
328
|
-
? order?.summary?.subtotal + order?.summary?.tax ?? 0
|
|
329
|
-
: order?.summary?.subtotal ?? 0,
|
|
330
|
-
)}
|
|
368
|
+
{parsePrice(((order?.summary?.subtotal ?? order?.subtotal) + getIncludedTaxes()))}
|
|
331
369
|
</OText>
|
|
332
370
|
</Table>
|
|
333
|
-
|
|
334
|
-
|
|
371
|
+
{(order?.summary?.discount > 0 ?? order?.discount > 0) && order?.offers?.length === 0 && (
|
|
372
|
+
<Table>
|
|
373
|
+
{order?.offer_type === 1 ? (
|
|
374
|
+
<OText mBottom={4}>
|
|
375
|
+
{t('DISCOUNT', theme?.defaultLanguages?.DISCOUNT || 'Discount')}{' '}
|
|
376
|
+
<OText>{`(${verifyDecimals(order?.offer_rate, parsePrice)}%)`}</OText>
|
|
377
|
+
</OText>
|
|
378
|
+
) : (
|
|
379
|
+
<OText mBottom={4}>{t('DISCOUNT', theme?.defaultLanguages?.DISCOUNT || 'Discount')}</OText>
|
|
380
|
+
)}
|
|
381
|
+
<OText>- {parsePrice(order?.summary?.discount ?? order?.discount)}</OText>
|
|
382
|
+
</Table>
|
|
383
|
+
)}
|
|
384
|
+
{
|
|
385
|
+
order?.offers?.length > 0 && order?.offers?.filter((offer: any) => offer?.target === 1)?.map((offer: any) => (
|
|
386
|
+
<Table key={offer.id}>
|
|
387
|
+
<OSRow>
|
|
388
|
+
<OText numberOfLines={1} mBottom={4}>
|
|
389
|
+
{offer.name}
|
|
390
|
+
{offer.rate_type === 1 && (
|
|
391
|
+
<OText>{`(${verifyDecimals(offer?.rate, parsePrice)}%)`}</OText>
|
|
392
|
+
)}
|
|
393
|
+
</OText>
|
|
394
|
+
</OSRow>
|
|
395
|
+
<OText mBottom={4}>- {parsePrice(offer?.summary?.discount)}</OText>
|
|
396
|
+
</Table>
|
|
397
|
+
))
|
|
398
|
+
}
|
|
399
|
+
{order?.summary?.subtotal_with_discount > 0 && order?.summary?.discount > 0 && order?.summary?.total >= 0 && (
|
|
400
|
+
<Table>
|
|
401
|
+
<OText mBottom={4}>{t('SUBTOTAL_WITH_DISCOUNT', 'Subtotal with discount')}</OText>
|
|
402
|
+
{order?.tax_type === 1 ? (
|
|
403
|
+
<OText mBottom={4}>{parsePrice((order?.summary?.subtotal_with_discount + getIncludedTaxesDiscounts() ?? 0))}</OText>
|
|
404
|
+
) : (
|
|
405
|
+
<OText mBottom={4}>{parsePrice(order?.summary?.subtotal_with_discount ?? 0)}</OText>
|
|
406
|
+
)}
|
|
407
|
+
</Table>
|
|
408
|
+
)}
|
|
409
|
+
{order?.taxes?.length === 0 && order?.tax_type === 2 && order?.summary?.tax > 0 && (
|
|
335
410
|
<Table>
|
|
336
411
|
<OText mBottom={4}>
|
|
337
|
-
{t('TAX', 'Tax')}
|
|
338
|
-
{`(${verifyDecimals(
|
|
339
|
-
order?.summary?.tax_rate,
|
|
340
|
-
parseNumber,
|
|
341
|
-
)}%)`}
|
|
412
|
+
{t('TAX', 'Tax')} {`(${verifyDecimals(order?.tax, parseNumber)}%)`}
|
|
342
413
|
</OText>
|
|
343
|
-
|
|
344
414
|
<OText mBottom={4}>
|
|
345
415
|
{parsePrice(order?.summary?.tax ?? 0)}
|
|
346
416
|
</OText>
|
|
347
|
-
</Table
|
|
417
|
+
</Table>
|
|
348
418
|
)}
|
|
349
|
-
|
|
350
419
|
{
|
|
351
|
-
order?.summary?.
|
|
420
|
+
order?.fees?.length === 0 && order?.summary?.service_fee > 0 && (
|
|
352
421
|
<Table>
|
|
353
|
-
{order?.offer_type === 1 ? (
|
|
354
|
-
<OText mBottom={4}>
|
|
355
|
-
<OText>{t('DISCOUNT', 'Discount')}</OText>
|
|
356
|
-
|
|
357
|
-
<OText>
|
|
358
|
-
{`(${verifyDecimals(
|
|
359
|
-
order?.offer_rate,
|
|
360
|
-
parsePrice,
|
|
361
|
-
)}%)`}
|
|
362
|
-
</OText>
|
|
363
|
-
</OText>
|
|
364
|
-
) : (
|
|
365
|
-
<OText mBottom={4}>{t('DISCOUNT', 'Discount')}</OText>
|
|
366
|
-
)}
|
|
367
|
-
|
|
368
422
|
<OText mBottom={4}>
|
|
369
|
-
|
|
423
|
+
{t('SERVICE_FEE', 'Service fee')}
|
|
424
|
+
{`(${verifyDecimals(order?.service_fee, parseNumber)}%)`}
|
|
370
425
|
</OText>
|
|
426
|
+
<OText mBottom={4}>{parsePrice(order?.summary?.service_fee ?? 0)}</OText>
|
|
371
427
|
</Table>
|
|
372
428
|
)
|
|
373
429
|
}
|
|
374
|
-
|
|
375
430
|
{
|
|
376
|
-
order?.
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
'SUBTOTAL_WITH_DISCOUNT',
|
|
383
|
-
'Subtotal with discount',
|
|
384
|
-
)}
|
|
385
|
-
</OText>
|
|
386
|
-
{order?.tax_type === 1 ? (
|
|
387
|
-
<OText mBottom={4}>
|
|
388
|
-
{parsePrice(
|
|
389
|
-
order?.summary?.subtotal_with_discount +
|
|
390
|
-
order?.summary?.tax ?? 0,
|
|
391
|
-
)}
|
|
431
|
+
order?.taxes?.length > 0 && order?.taxes?.filter((tax: any) => tax?.type === 2 && tax?.rate !== 0).map((tax: any) => (
|
|
432
|
+
<Table key={tax.id}>
|
|
433
|
+
<OSRow>
|
|
434
|
+
<OText numberOfLines={1} mBottom={4}>
|
|
435
|
+
{tax.name || t('INHERIT_FROM_BUSINESS', 'Inherit from business')}
|
|
436
|
+
{`(${verifyDecimals(tax?.rate, parseNumber)}%)`}{' '}
|
|
392
437
|
</OText>
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
438
|
+
</OSRow>
|
|
439
|
+
<OText mBottom={4}>{parsePrice(tax?.summary?.tax_after_discount ?? tax?.summary?.tax ?? 0)}</OText>
|
|
440
|
+
</Table>
|
|
441
|
+
))
|
|
442
|
+
}
|
|
443
|
+
{
|
|
444
|
+
order?.fees?.length > 0 && order?.fees?.filter((fee: any) => !(fee.fixed === 0 && fee.percentage === 0))?.map((fee: any) => (
|
|
445
|
+
<Table key={fee.id}>
|
|
446
|
+
<OSRow>
|
|
447
|
+
<OText numberOfLines={1} mBottom={4}>
|
|
448
|
+
{fee.name || t('INHERIT_FROM_BUSINESS', 'Inherit from business')}
|
|
449
|
+
({fee?.fixed > 0 && `${parsePrice(fee?.fixed)} + `}{fee.percentage}%){' '}
|
|
450
|
+
</OText>
|
|
451
|
+
</OSRow>
|
|
452
|
+
<OText mBottom={4}>{parsePrice(fee?.summary?.fixed + (fee?.summary?.percentage_after_discount ?? fee?.summary?.percentage) ?? 0)}</OText>
|
|
453
|
+
</Table>
|
|
454
|
+
))
|
|
455
|
+
}
|
|
456
|
+
{
|
|
457
|
+
order?.offers?.length > 0 && order?.offers?.filter((offer: any) => offer?.target === 3)?.map((offer: any) => (
|
|
458
|
+
<Table key={offer.id}>
|
|
459
|
+
<OSRow>
|
|
460
|
+
<OText numberOfLines={1} mBottom={4}>
|
|
461
|
+
{offer.name}
|
|
462
|
+
{offer.rate_type === 1 && (
|
|
463
|
+
<OText>{`(${verifyDecimals(offer?.rate, parsePrice)}%)`}</OText>
|
|
397
464
|
)}
|
|
398
465
|
</OText>
|
|
399
|
-
|
|
466
|
+
</OSRow>
|
|
467
|
+
<OText mBottom={4}>- {parsePrice(offer?.summary?.discount)}</OText>
|
|
400
468
|
</Table>
|
|
401
|
-
)
|
|
469
|
+
))
|
|
402
470
|
}
|
|
403
|
-
|
|
404
471
|
{
|
|
405
472
|
order?.summary?.delivery_price > 0 && (
|
|
406
473
|
<Table>
|
|
@@ -414,41 +481,35 @@ export const OrderContentComponent = (props: OrderContent) => {
|
|
|
414
481
|
</Table>
|
|
415
482
|
)
|
|
416
483
|
}
|
|
417
|
-
|
|
418
|
-
<Table>
|
|
419
|
-
<OText mBottom={4}>
|
|
420
|
-
{t('DRIVER_TIP', 'Driver tip')}{' '}
|
|
421
|
-
{order?.summary?.driver_tip > 0 &&
|
|
422
|
-
parseInt(configs?.driver_tip_type?.value, 10) === 2 &&
|
|
423
|
-
!parseInt(configs?.driver_tip_use_custom?.value, 10) &&
|
|
424
|
-
`(${verifyDecimals(
|
|
425
|
-
order?.summary?.driver_tip,
|
|
426
|
-
parseNumber,
|
|
427
|
-
)}%)`}
|
|
428
|
-
</OText>
|
|
429
|
-
|
|
430
|
-
<OText mBottom={4}>
|
|
431
|
-
{parsePrice(order?.summary?.driver_tip ?? 0)}
|
|
432
|
-
</OText>
|
|
433
|
-
</Table>
|
|
434
|
-
|
|
435
484
|
{
|
|
436
|
-
order?.
|
|
437
|
-
<Table>
|
|
438
|
-
<
|
|
439
|
-
{
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
<OText mBottom={4}>
|
|
447
|
-
{parsePrice(order?.summary?.service_fee)}
|
|
448
|
-
</OText>
|
|
485
|
+
order?.offers?.length > 0 && order?.offers?.filter((offer: any) => offer?.target === 2)?.map((offer: any) => (
|
|
486
|
+
<Table key={offer.id}>
|
|
487
|
+
<OSRow>
|
|
488
|
+
<OText numberOfLines={1} mBottom={4}>
|
|
489
|
+
{offer.name}
|
|
490
|
+
{offer.rate_type === 1 && (
|
|
491
|
+
<OText>{`(${verifyDecimals(offer?.rate, parsePrice)}%)`}</OText>
|
|
492
|
+
)}
|
|
493
|
+
</OText>
|
|
494
|
+
</OSRow>
|
|
495
|
+
<OText mBottom={4}>- {parsePrice(offer?.summary?.discount)}</OText>
|
|
449
496
|
</Table>
|
|
450
|
-
)
|
|
497
|
+
))
|
|
451
498
|
}
|
|
499
|
+
{order?.summary?.driver_tip > 0 && (
|
|
500
|
+
<Table>
|
|
501
|
+
<OText mBottom={4}>
|
|
502
|
+
{t('DRIVER_TIP', 'Driver tip')}
|
|
503
|
+
{order?.summary?.driver_tip > 0 &&
|
|
504
|
+
parseInt(configs?.driver_tip_type?.value, 10) === 2 &&
|
|
505
|
+
!parseInt(configs?.driver_tip_use_custom?.value, 10) &&
|
|
506
|
+
(
|
|
507
|
+
`(${verifyDecimals(order?.summary?.driver_tip, parseNumber)}%)`
|
|
508
|
+
)}
|
|
509
|
+
</OText>
|
|
510
|
+
<OText mBottom={4}>{parsePrice(order?.summary?.driver_tip ?? order?.totalDriverTip)}</OText>
|
|
511
|
+
</Table>
|
|
512
|
+
)}
|
|
452
513
|
|
|
453
514
|
<Total style={{ paddingBottom: 10 }}>
|
|
454
515
|
<Table>
|
|
@@ -460,7 +521,7 @@ export const OrderContentComponent = (props: OrderContent) => {
|
|
|
460
521
|
mBottom={4}
|
|
461
522
|
style={styles.textBold}
|
|
462
523
|
color={theme.colors.primary}>
|
|
463
|
-
{parsePrice(order?.summary?.total ??
|
|
524
|
+
{parsePrice(order?.summary?.total ?? order?.total)}
|
|
464
525
|
</OText>
|
|
465
526
|
</Table>
|
|
466
527
|
</Total>
|
|
@@ -77,6 +77,7 @@ const OrdersListManagerUI = (props: OrdersOptionParams) => {
|
|
|
77
77
|
const [openSearchModal, setOpenSearchModal] = useState(false)
|
|
78
78
|
const [openSLASettingModal, setOpenSLASettingModal] = useState(false)
|
|
79
79
|
const [slaSettingTime, setSlaSettingTime] = useState(6000)
|
|
80
|
+
const [configState] = useConfig()
|
|
80
81
|
const [currentDeliveryType, setCurrentDeliveryType] = useState('Delivery')
|
|
81
82
|
const [search, setSearch] = useState(defaultSearchList)
|
|
82
83
|
const [selectedTabStatus, setSelectedTabStatus] = useState<any>([])
|
|
@@ -311,55 +312,57 @@ const OrdersListManagerUI = (props: OrdersOptionParams) => {
|
|
|
311
312
|
/>
|
|
312
313
|
</IconWrapper>
|
|
313
314
|
</View>
|
|
314
|
-
|
|
315
|
-
<View style={
|
|
316
|
-
<
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
<
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
315
|
+
{configState?.configs?.order_deadlines_enabled?.value === '1' && (
|
|
316
|
+
<View style={styles.SLAwrapper}>
|
|
317
|
+
<View style={{ flex: 0.5 }}>
|
|
318
|
+
<OButton
|
|
319
|
+
text={t('SLA_SETTING', 'SLA’s Settings')}
|
|
320
|
+
textStyle={{ color: theme.colors.backArrow }}
|
|
321
|
+
imgRightSrc={null}
|
|
322
|
+
style={{
|
|
323
|
+
backgroundColor: theme.colors.inputChat,
|
|
324
|
+
borderRadius: 7.6,
|
|
325
|
+
zIndex: 10,
|
|
326
|
+
borderWidth: 0,
|
|
327
|
+
minHeight: 40
|
|
328
|
+
}}
|
|
329
|
+
onClick={onClickSetting}
|
|
330
|
+
/>
|
|
331
|
+
</View>
|
|
332
|
+
<View style={{ width: 10, height: '100%' }} />
|
|
333
|
+
<View style={{ flex: 0.5, justifyContent: 'center' }}>
|
|
334
|
+
<SelectDropdown
|
|
335
|
+
defaultButtonText={t('SLA', 'SLA\'s')}
|
|
336
|
+
data={preorderTypeList}
|
|
337
|
+
onSelect={(selectedItem, index) => {
|
|
338
|
+
onFiltered && onFiltered({ ...search, timeStatus: selectedItem?.key })
|
|
339
|
+
}}
|
|
340
|
+
buttonTextAfterSelection={(selectedItem, index) => {
|
|
341
|
+
return selectedItem.name
|
|
342
|
+
}}
|
|
343
|
+
rowTextForSelection={(item, index) => {
|
|
344
|
+
return item.key
|
|
345
|
+
}}
|
|
346
|
+
buttonStyle={styles.selectOption}
|
|
347
|
+
buttonTextStyle={styles.buttonTextStyle}
|
|
348
|
+
renderDropdownIcon={isOpened => {
|
|
349
|
+
return <FeatherIcon name={isOpened ? 'chevron-up' : 'chevron-down'} color={'#444'} size={18} />;
|
|
350
|
+
}}
|
|
351
|
+
dropdownStyle={styles.dropdownStyle}
|
|
352
|
+
dropdownOverlayColor='transparent'
|
|
353
|
+
rowStyle={styles.rowStyle}
|
|
354
|
+
renderCustomizedRowChild={(item, index) => {
|
|
355
|
+
return (
|
|
356
|
+
<SlaOption>
|
|
357
|
+
{index !== 0 && <OrderStatus timeState={item?.key} />}
|
|
358
|
+
<View><OText size={14} color={'#748194'} >{item?.name}</OText></View>
|
|
359
|
+
</SlaOption>
|
|
360
|
+
);
|
|
361
|
+
}}
|
|
362
|
+
/>
|
|
363
|
+
</View>
|
|
361
364
|
</View>
|
|
362
|
-
|
|
365
|
+
)}
|
|
363
366
|
|
|
364
367
|
<Sides>
|
|
365
368
|
<LeftSide>
|
|
@@ -110,6 +110,7 @@ const OrdersOptionUI = (props: OrdersOptionParams) => {
|
|
|
110
110
|
const theme = useTheme();
|
|
111
111
|
const [, t] = useLanguage();
|
|
112
112
|
const [{ parseDate }] = useUtils()
|
|
113
|
+
const [configState] = useConfig()
|
|
113
114
|
const [orientationState] = useDeviceOrientation();
|
|
114
115
|
const [, { showToast }] = useToast();
|
|
115
116
|
const [openSearchModal, setOpenSearchModal] = useState(false)
|
|
@@ -439,55 +440,57 @@ const OrdersOptionUI = (props: OrdersOptionParams) => {
|
|
|
439
440
|
/>
|
|
440
441
|
</IconWrapper>
|
|
441
442
|
</View>
|
|
442
|
-
|
|
443
|
-
<View style={
|
|
444
|
-
<
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
<
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
443
|
+
{configState?.configs?.order_deadlines_enabled?.value === '1' && (
|
|
444
|
+
<View style={styles.SLAwrapper}>
|
|
445
|
+
<View style={{ flex: 0.5 }}>
|
|
446
|
+
<OButton
|
|
447
|
+
text={t('SLA_SETTING', 'SLA’s Settings')}
|
|
448
|
+
textStyle={{ color: theme.colors.backArrow }}
|
|
449
|
+
imgRightSrc={null}
|
|
450
|
+
style={{
|
|
451
|
+
backgroundColor: theme.colors.inputChat,
|
|
452
|
+
borderRadius: 7.6,
|
|
453
|
+
zIndex: 10,
|
|
454
|
+
borderWidth: 0,
|
|
455
|
+
minHeight: 40
|
|
456
|
+
}}
|
|
457
|
+
onClick={onClickSetting}
|
|
458
|
+
/>
|
|
459
|
+
</View>
|
|
460
|
+
<View style={{ width: 10, height: '100%' }} />
|
|
461
|
+
<View style={{ flex: 0.5, justifyContent: 'center' }}>
|
|
462
|
+
<SelectDropdown
|
|
463
|
+
defaultButtonText={t('SLA', 'SLA\'s')}
|
|
464
|
+
data={preorderTypeList}
|
|
465
|
+
onSelect={(selectedItem, index) => {
|
|
466
|
+
onFiltered && onFiltered({ ...search, timeStatus: selectedItem?.key })
|
|
467
|
+
}}
|
|
468
|
+
buttonTextAfterSelection={(selectedItem, index) => {
|
|
469
|
+
return selectedItem.name
|
|
470
|
+
}}
|
|
471
|
+
rowTextForSelection={(item, index) => {
|
|
472
|
+
return item.key
|
|
473
|
+
}}
|
|
474
|
+
buttonStyle={styles.selectOption}
|
|
475
|
+
buttonTextStyle={styles.buttonTextStyle}
|
|
476
|
+
renderDropdownIcon={isOpened => {
|
|
477
|
+
return <FeatherIcon name={isOpened ? 'chevron-up' : 'chevron-down'} color={'#444'} size={18} />;
|
|
478
|
+
}}
|
|
479
|
+
dropdownStyle={styles.dropdownStyle}
|
|
480
|
+
dropdownOverlayColor='transparent'
|
|
481
|
+
rowStyle={styles.rowStyle}
|
|
482
|
+
renderCustomizedRowChild={(item, index) => {
|
|
483
|
+
return (
|
|
484
|
+
<SlaOption>
|
|
485
|
+
{index !== 0 && <OrderStatus timeState={item?.key} />}
|
|
486
|
+
<View><OText size={14} color={'#748194'} >{item?.name}</OText></View>
|
|
487
|
+
</SlaOption>
|
|
488
|
+
);
|
|
489
|
+
}}
|
|
490
|
+
/>
|
|
491
|
+
</View>
|
|
489
492
|
</View>
|
|
490
|
-
|
|
493
|
+
)}
|
|
491
494
|
<FiltersTab>
|
|
492
495
|
<ScrollView
|
|
493
496
|
ref={scrollRefTab}
|
|
@@ -926,6 +929,7 @@ export const Timer = () => {
|
|
|
926
929
|
|
|
927
930
|
export const OrdersOption = (props: OrdersOptionParams) => {
|
|
928
931
|
const [, t] = useLanguage();
|
|
932
|
+
const [configState] = useConfig()
|
|
929
933
|
const theme = useTheme()
|
|
930
934
|
const ordersProps = {
|
|
931
935
|
...props,
|