ordering-ui-react-native 0.22.56-test → 0.22.57
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 +1 -1
- package/themes/business/src/components/AcceptOrRejectOrder/index.tsx +4 -3
- package/themes/business/src/components/OrderDetails/Delivery.tsx +14 -2
- package/themes/business/src/components/OrderDetails/OrderContentComponent.tsx +9 -9
- package/themes/business/src/types/index.tsx +1 -0
- package/themes/original/src/components/MomentOption/index.tsx +2 -5
package/package.json
CHANGED
|
@@ -31,6 +31,7 @@ export const AcceptOrRejectOrder = (props: AcceptOrRejectOrderParams) => {
|
|
|
31
31
|
notShowCustomerPhone,
|
|
32
32
|
orderTitle,
|
|
33
33
|
appTitle,
|
|
34
|
+
isLoadingOrder
|
|
34
35
|
} = props;
|
|
35
36
|
|
|
36
37
|
const [, t] = useLanguage();
|
|
@@ -277,7 +278,7 @@ export const AcceptOrRejectOrder = (props: AcceptOrRejectOrderParams) => {
|
|
|
277
278
|
}
|
|
278
279
|
|
|
279
280
|
bodyToSend.id = orderId;
|
|
280
|
-
handleUpdateOrder
|
|
281
|
+
handleUpdateOrder?.(bodyToSend.status, bodyToSend);
|
|
281
282
|
};
|
|
282
283
|
|
|
283
284
|
useEffect(() => {
|
|
@@ -517,7 +518,7 @@ export const AcceptOrRejectOrder = (props: AcceptOrRejectOrderParams) => {
|
|
|
517
518
|
...styles.bottomParent,
|
|
518
519
|
marginBottom: Platform.OS === 'ios'
|
|
519
520
|
? 30 : (keyboardState.height === 0)
|
|
520
|
-
? isPage ? 0 :
|
|
521
|
+
? isPage ? 0 : 40
|
|
521
522
|
: keyboardState.height - (isPage ? 20 : -10)
|
|
522
523
|
}}
|
|
523
524
|
>
|
|
@@ -529,7 +530,7 @@ export const AcceptOrRejectOrder = (props: AcceptOrRejectOrderParams) => {
|
|
|
529
530
|
style={{ borderRadius: 7, height: 45 }}
|
|
530
531
|
parentStyle={{ width: '100%' }}
|
|
531
532
|
textStyle={{ color: '#FFF', fontSize: 18 }}
|
|
532
|
-
isDisabled={showTextArea && !comments}
|
|
533
|
+
isDisabled={(showTextArea && !comments) || isLoadingOrder}
|
|
533
534
|
onClick={() => handleAcceptOrReject()}
|
|
534
535
|
/>
|
|
535
536
|
</View>
|
|
@@ -428,6 +428,16 @@ export const OrderDetailsUI = (props: OrderDetailsParams) => {
|
|
|
428
428
|
forceUpdate && handleViewActionOrder && handleViewActionOrder(forceUpdate === 9 ? 'forcePickUp' : 'forceDelivery')
|
|
429
429
|
}, [forceUpdate])
|
|
430
430
|
|
|
431
|
+
useEffect(() => {
|
|
432
|
+
if (!!props.order?.error || props.order?.error?.length > 0) {
|
|
433
|
+
showToast(ToastType.Error,
|
|
434
|
+
props.order?.error?.[0] ||
|
|
435
|
+
props.order?.error ||
|
|
436
|
+
t('NETWORK_ERROR', 'Network Error'),
|
|
437
|
+
5000)
|
|
438
|
+
}
|
|
439
|
+
}, [props.order?.error])
|
|
440
|
+
|
|
431
441
|
const styles = StyleSheet.create({
|
|
432
442
|
btnPickUp: {
|
|
433
443
|
borderWidth: 0,
|
|
@@ -478,7 +488,7 @@ export const OrderDetailsUI = (props: OrderDetailsParams) => {
|
|
|
478
488
|
isOrderGroup={isOrderGroup}
|
|
479
489
|
lastOrder={lastOrder}
|
|
480
490
|
/>
|
|
481
|
-
{(order?.status === 8 || order?.status === 18) && order?.delivery_type === 1 && (
|
|
491
|
+
{(order?.status === 8 || order?.status === 18) && order?.delivery_type === 1 && !props.order?.loading && (
|
|
482
492
|
<Pickup>
|
|
483
493
|
<OButton
|
|
484
494
|
style={styles.btnPickUp}
|
|
@@ -491,7 +501,7 @@ export const OrderDetailsUI = (props: OrderDetailsParams) => {
|
|
|
491
501
|
/>
|
|
492
502
|
</Pickup>
|
|
493
503
|
)}
|
|
494
|
-
{order?.status === 3 && order?.delivery_type === 1 && !isHideRejectButtons && isEnabledOrderNotReady && (
|
|
504
|
+
{order?.status === 3 && order?.delivery_type === 1 && !isHideRejectButtons && isEnabledOrderNotReady && !props.order?.loading && (
|
|
495
505
|
<View style={{ paddingVertical: 20, marginBottom: 20 }}>
|
|
496
506
|
<OButton
|
|
497
507
|
style={styles.btnPickUp}
|
|
@@ -613,6 +623,7 @@ export const OrderDetailsUI = (props: OrderDetailsParams) => {
|
|
|
613
623
|
)}
|
|
614
624
|
{showFloatButtonsAcceptOrReject[order?.status] && (
|
|
615
625
|
<FloatingButton
|
|
626
|
+
disabled={props.order?.loading}
|
|
616
627
|
btnText={t('REJECT', 'Reject')}
|
|
617
628
|
isSecondaryBtn={false}
|
|
618
629
|
secondButtonClick={() => hideTimer ? handleChangeOrderStatus && handleChangeOrderStatus(8) : (order?.isLogistic && (order?.order_group || logisticOrderStatus.includes(order?.status))) ? handleAcceptLogisticOrder(order) : handleViewActionOrder('accept')}
|
|
@@ -687,6 +698,7 @@ export const OrderDetailsUI = (props: OrderDetailsParams) => {
|
|
|
687
698
|
actions={actions}
|
|
688
699
|
orderTitle={orderTitle}
|
|
689
700
|
appTitle={appTitle}
|
|
701
|
+
isLoadingOrder={props.order?.loading}
|
|
690
702
|
/>
|
|
691
703
|
</OModal>
|
|
692
704
|
)}
|
|
@@ -230,7 +230,7 @@ export const OrderContentComponent = (props: OrderContent) => {
|
|
|
230
230
|
)}
|
|
231
231
|
{!!order?.business?.location && order?.customer?.location && (
|
|
232
232
|
<OText>
|
|
233
|
-
{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
|
|
233
|
+
{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)}
|
|
234
234
|
</OText>
|
|
235
235
|
)}
|
|
236
236
|
{!!order?.business?.address_notes && (
|
|
@@ -412,7 +412,7 @@ export const OrderContentComponent = (props: OrderContent) => {
|
|
|
412
412
|
<View style={{ marginTop: 10 }}>
|
|
413
413
|
{order?.delivery_option !== undefined && order?.delivery_type === 1 && (
|
|
414
414
|
<OText>
|
|
415
|
-
{t(order?.delivery_option?.name?.toUpperCase()?.replace(/ /g, '_'), order?.delivery_option?.name)}
|
|
415
|
+
{t(order?.delivery_option?.name?.toUpperCase?.()?.replace(/ /g, '_'), order?.delivery_option?.name)}
|
|
416
416
|
</OText>
|
|
417
417
|
)}
|
|
418
418
|
</View>
|
|
@@ -474,7 +474,7 @@ export const OrderContentComponent = (props: OrderContent) => {
|
|
|
474
474
|
<Table key={offer.id}>
|
|
475
475
|
<OSRow>
|
|
476
476
|
<OText mBottom={4}>
|
|
477
|
-
{t(offer.name?.toUpperCase()?.replace(/ /g, '_'), offer.name)}
|
|
477
|
+
{t(offer.name?.toUpperCase?.()?.replace(/ /g, '_'), offer.name)}
|
|
478
478
|
{offer.rate_type === 1 && (
|
|
479
479
|
<OText>{`(${verifyDecimals(offer?.rate, parsePrice)}%)`}</OText>
|
|
480
480
|
)}
|
|
@@ -520,7 +520,7 @@ export const OrderContentComponent = (props: OrderContent) => {
|
|
|
520
520
|
<Table key={tax.id}>
|
|
521
521
|
<OSRow>
|
|
522
522
|
<OText mBottom={4}>
|
|
523
|
-
{t(tax?.name?.toUpperCase()?.replace(/ /g, '_'), tax?.name) || t('INHERIT_FROM_BUSINESS', 'Inherit from business')}
|
|
523
|
+
{t(tax?.name?.toUpperCase?.()?.replace(/ /g, '_'), tax?.name) || t('INHERIT_FROM_BUSINESS', 'Inherit from business')}
|
|
524
524
|
{`(${verifyDecimals(tax?.rate, parseNumber)}%)`}{' '}
|
|
525
525
|
</OText>
|
|
526
526
|
</OSRow>
|
|
@@ -533,7 +533,7 @@ export const OrderContentComponent = (props: OrderContent) => {
|
|
|
533
533
|
<Table key={fee.id}>
|
|
534
534
|
<OSRow>
|
|
535
535
|
<OText mBottom={4}>
|
|
536
|
-
{t(fee?.name?.toUpperCase()?.replace(/ /g, '_'), fee?.name) || t('INHERIT_FROM_BUSINESS', 'Inherit from business')}
|
|
536
|
+
{t(fee?.name?.toUpperCase?.()?.replace(/ /g, '_'), fee?.name) || t('INHERIT_FROM_BUSINESS', 'Inherit from business')}
|
|
537
537
|
({fee?.fixed > 0 && `${parsePrice(fee?.fixed, { currency: order?.currency })} + `}{fee.percentage}%){' '}
|
|
538
538
|
</OText>
|
|
539
539
|
</OSRow>
|
|
@@ -546,7 +546,7 @@ export const OrderContentComponent = (props: OrderContent) => {
|
|
|
546
546
|
<Table key={offer.id}>
|
|
547
547
|
<OSRow>
|
|
548
548
|
<OText mBottom={4}>
|
|
549
|
-
{t(offer.name?.toUpperCase()?.replace(/ /g, '_'), offer.name)}
|
|
549
|
+
{t(offer.name?.toUpperCase?.()?.replace(/ /g, '_'), offer.name)}
|
|
550
550
|
{offer.rate_type === 1 && (
|
|
551
551
|
<OText>{`(${verifyDecimals(offer?.rate, parsePrice)}%)`}</OText>
|
|
552
552
|
)}
|
|
@@ -574,7 +574,7 @@ export const OrderContentComponent = (props: OrderContent) => {
|
|
|
574
574
|
<Table key={offer.id}>
|
|
575
575
|
<OSRow>
|
|
576
576
|
<OText mBottom={4}>
|
|
577
|
-
{t(offer.name?.toUpperCase()?.replace(/ /g, '_'), offer.name)}
|
|
577
|
+
{t(offer.name?.toUpperCase?.()?.replace(/ /g, '_'), offer.name)}
|
|
578
578
|
{offer.rate_type === 1 && (
|
|
579
579
|
<OText>{`(${verifyDecimals(offer?.rate, parsePrice)}%)`}</OText>
|
|
580
580
|
)}
|
|
@@ -643,9 +643,9 @@ export const OrderContentComponent = (props: OrderContent) => {
|
|
|
643
643
|
{event?.wallet_event
|
|
644
644
|
? walletName[event?.wallet_event?.wallet?.type]?.name
|
|
645
645
|
: event?.paymethod?.gateway
|
|
646
|
-
? t(event?.paymethod?.gateway?.toUpperCase(), event?.paymethod?.name)
|
|
646
|
+
? t(event?.paymethod?.gateway?.toUpperCase?.(), event?.paymethod?.name)
|
|
647
647
|
: order?.paymethod?.id === event?.paymethod_id
|
|
648
|
-
? t(order?.paymethod?.gateway?.toUpperCase(), order?.paymethod?.name)
|
|
648
|
+
? t(order?.paymethod?.gateway?.toUpperCase?.(), order?.paymethod?.name)
|
|
649
649
|
: ''}
|
|
650
650
|
</OText>
|
|
651
651
|
</View>
|
|
@@ -29,7 +29,7 @@ import {
|
|
|
29
29
|
TimeItem
|
|
30
30
|
} from './styles';
|
|
31
31
|
import { useSafeAreaInsets } from 'react-native-safe-area-context';
|
|
32
|
-
import { locale, monthsEnum
|
|
32
|
+
import { locale, monthsEnum } from '../../utils';
|
|
33
33
|
|
|
34
34
|
const MomentOptionUI = (props: MomentOptionParams) => {
|
|
35
35
|
const {
|
|
@@ -323,10 +323,6 @@ const MomentOptionUI = (props: MomentOptionParams) => {
|
|
|
323
323
|
}
|
|
324
324
|
}, [dateSelected, JSON.stringify(hoursList), JSON.stringify(datesWhitelist), cateringPreorder, JSON.stringify(business)])
|
|
325
325
|
|
|
326
|
-
useEffect(() => {
|
|
327
|
-
setLocalMoment(moment, t)
|
|
328
|
-
}, [])
|
|
329
|
-
|
|
330
326
|
return (
|
|
331
327
|
<>
|
|
332
328
|
<Container
|
|
@@ -398,6 +394,7 @@ const MomentOptionUI = (props: MomentOptionParams) => {
|
|
|
398
394
|
<View style={{ flex: 1 }}>
|
|
399
395
|
{selectDate && datesWhitelist[0]?.start !== null && (
|
|
400
396
|
<CalendarStrip
|
|
397
|
+
locale={locale}
|
|
401
398
|
scrollable
|
|
402
399
|
style={styles.calendar}
|
|
403
400
|
calendarHeaderContainerStyle={styles.calendarHeaderContainer}
|