ordering-ui-react-native 0.15.11 → 0.15.12-release
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +5 -3
- package/src/DeliveryApp.tsx +43 -1
- package/src/components/BusinessTypeFilter/index.tsx +12 -2
- package/src/components/BusinessTypeFilter/styles.tsx +1 -1
- package/src/components/BusinessesListing/index.tsx +1 -1
- package/src/components/Checkout/index.tsx +0 -1
- package/src/components/LanguageSelector/index.tsx +1 -0
- package/src/components/OrderDetails/index.tsx +26 -5
- package/src/components/PaymentOptions/index.tsx +9 -16
- package/src/components/PaymentOptionsWebView/index.tsx +123 -124
- package/src/components/ProductForm/index.tsx +1 -1
- package/src/components/ProductForm/styles.tsx +1 -0
- package/src/components/StripeElementsForm/index.tsx +27 -48
- package/src/components/VerifyPhone/styles.tsx +1 -2
- package/src/config.json +0 -2
- package/src/pages/BusinessProductsList.tsx +1 -0
- package/src/pages/BusinessesListing.tsx +1 -1
- package/src/pages/Checkout.tsx +1 -1
- package/src/types/index.tsx +1 -9
- package/themes/business/index.tsx +2 -0
- package/themes/business/src/components/Chat/index.tsx +3 -2
- 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/Business.tsx +2 -1
- package/themes/business/src/components/OrderDetails/Delivery.tsx +9 -9
- package/themes/business/src/components/OrderDetails/OrderContentComponent.tsx +150 -89
- package/themes/business/src/components/OrderDetails/OrderHeaderComponent.tsx +91 -17
- package/themes/business/src/components/OrderDetails/styles.tsx +7 -0
- package/themes/business/src/components/OrdersListManager/index.tsx +874 -0
- package/themes/business/src/components/OrdersListManager/styles.tsx +123 -0
- package/themes/business/src/components/OrdersListManager/utils.tsx +216 -0
- package/themes/business/src/components/OrdersOption/index.tsx +70 -116
- package/themes/business/src/components/OrdersOption/styles.tsx +2 -5
- package/themes/business/src/components/PreviousOrders/index.tsx +82 -23
- 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/BusinessController/index.tsx +27 -6
- package/themes/kiosk/src/components/BusinessController/styles.tsx +1 -1
- package/themes/kiosk/src/components/BusinessProductsListing/index.tsx +48 -21
- package/themes/kiosk/src/components/Cart/index.tsx +98 -24
- package/themes/kiosk/src/components/Cart/styles.tsx +6 -0
- package/themes/kiosk/src/components/CartBottomSheet/index.tsx +1 -1
- package/themes/kiosk/src/components/CartBottomSheet/styles.tsx +1 -1
- package/themes/kiosk/src/components/CartContent/index.tsx +13 -3
- package/themes/kiosk/src/components/CartItem/index.tsx +20 -8
- package/themes/kiosk/src/components/CategoriesMenu/index.tsx +6 -5
- package/themes/kiosk/src/components/CustomerName/index.tsx +89 -88
- package/themes/kiosk/src/components/Intro/index.tsx +13 -13
- package/themes/kiosk/src/components/LanguageSelector/index.tsx +12 -8
- 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/OrderDetails/index.tsx +136 -41
- package/themes/kiosk/src/components/OrderDetails/styles.tsx +5 -0
- package/themes/kiosk/src/components/OrderSummary/index.tsx +1 -1
- package/themes/kiosk/src/components/OrderTypeCardSelector/index.tsx +10 -12
- package/themes/kiosk/src/components/ProductForm/index.tsx +174 -125
- package/themes/kiosk/src/components/ProductForm/styles.tsx +1 -1
- package/themes/kiosk/src/components/ProductOption/index.tsx +1 -0
- package/themes/kiosk/src/components/ProductOption/styles.tsx +1 -0
- package/themes/kiosk/src/components/UpsellingProducts/index.tsx +48 -34
- package/themes/kiosk/src/components/shared/OButton.tsx +5 -18
- package/themes/kiosk/src/components/shared/OCard.tsx +112 -78
- package/themes/kiosk/src/types/index.d.ts +2 -0
- package/themes/original/index.tsx +179 -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 +119 -78
- 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 +52 -22
- 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 +129 -22
- package/themes/original/src/components/BusinessProductsList/styles.tsx +29 -2
- package/themes/original/src/components/BusinessProductsListing/index.tsx +92 -37
- package/themes/original/src/components/BusinessProductsListing/styles.tsx +22 -0
- package/themes/original/src/components/BusinessReviews/index.tsx +4 -25
- package/themes/original/src/components/BusinessesListing/index.tsx +40 -53
- package/themes/original/src/components/Cart/index.tsx +41 -10
- package/themes/original/src/components/CartContent/index.tsx +2 -2
- package/themes/original/src/components/Checkout/index.tsx +23 -27
- package/themes/original/src/components/CouponControl/index.tsx +1 -0
- package/themes/original/src/components/DriverTips/index.tsx +1 -1
- package/themes/original/src/components/ForgotPasswordForm/index.tsx +8 -12
- package/themes/original/src/components/HighestRatedBusinesses/index.tsx +97 -89
- package/themes/original/src/components/Home/index.tsx +1 -1
- package/themes/original/src/components/LoginForm/index.tsx +156 -70
- package/themes/original/src/components/LoginForm/styles.tsx +6 -1
- package/themes/original/src/components/Messages/index.tsx +50 -45
- 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 +105 -127
- package/themes/original/src/components/OrderDetails/styles.tsx +3 -1
- package/themes/original/src/components/OrderProgress/index.tsx +4 -4
- package/themes/original/src/components/OrderProgress/styles.tsx +1 -0
- package/themes/original/src/components/OrderSummary/index.tsx +35 -2
- package/themes/original/src/components/OrderTypeSelector/index.tsx +1 -1
- package/themes/original/src/components/OrdersOption/index.tsx +15 -46
- package/themes/original/src/components/OrdersOption/styles.tsx +0 -6
- package/themes/original/src/components/PaymentOptionWallet/index.tsx +6 -2
- package/themes/original/src/components/PaymentOptions/index.tsx +24 -25
- package/themes/original/src/components/PhoneInputNumber/index.tsx +15 -8
- package/themes/original/src/components/PlaceSpot/index.tsx +114 -0
- package/themes/original/src/components/PlaceSpot/styles.tsx +11 -0
- package/themes/original/src/components/PreviousOrders/index.tsx +19 -13
- package/themes/original/src/components/ProductForm/index.tsx +47 -36
- package/themes/original/src/components/ProductForm/styles.tsx +2 -2
- package/themes/original/src/components/Promotions/index.tsx +233 -0
- package/themes/original/src/components/Promotions/styles.tsx +58 -0
- package/themes/original/src/components/ReviewOrder/index.tsx +10 -9
- package/themes/original/src/components/ReviewProducts/index.tsx +1 -1
- package/themes/original/src/components/SignupForm/index.tsx +173 -154
- 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/StripeElementsForm/index.tsx +55 -72
- package/themes/original/src/components/TaxInformation/index.tsx +17 -7
- package/themes/original/src/components/UpsellingProducts/index.tsx +6 -6
- package/themes/original/src/components/UserDetails/index.tsx +4 -95
- package/themes/original/src/components/UserFormDetails/index.tsx +2 -14
- package/themes/original/src/components/UserProfile/index.tsx +24 -17
- package/themes/original/src/components/UserProfileForm/index.tsx +8 -6
- package/themes/original/src/components/VerifyPhone/index.tsx +10 -7
- package/themes/original/src/components/VerifyPhone/styles.tsx +2 -1
- package/themes/original/src/components/Wallets/index.tsx +58 -4
- 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 +63 -23
- package/themes/original/src/utils/index.tsx +12 -2
- package/themes/single-business/src/components/AddressList/index.tsx +1 -1
- package/themes/single-business/src/components/OrderTypeSelector/index.tsx +6 -6
- package/themes/single-business/src/components/UserProfile/index.tsx +1 -1
- package/themes/uber-eats/src/components/BusinessesListing/index.tsx +1 -1
- package/src/components/StripeMethodForm/index.tsx +0 -168
|
@@ -335,7 +335,7 @@ export const OrderDetailsUI = (props: OrderDetailsParams) => {
|
|
|
335
335
|
addressName: order?.business?.address,
|
|
336
336
|
zipcode: order?.business?.zipcode
|
|
337
337
|
},
|
|
338
|
-
icon: order?.business?.logo ||
|
|
338
|
+
icon: order?.business?.logo || 'https://res.cloudinary.com/demo/image/fetch/c_thumb,g_face,r_max/https://res.cloudinary.com/ordering2/image/upload/v1654619525/hzegwosnplvrbtjkpfi6.png',
|
|
339
339
|
level: 2,
|
|
340
340
|
},
|
|
341
341
|
{
|
|
@@ -431,6 +431,7 @@ export const OrderDetailsUI = (props: OrderDetailsParams) => {
|
|
|
431
431
|
handleViewSummaryOrder={handleViewSummaryOrder}
|
|
432
432
|
handleCopyClipboard={handleCopyClipboard}
|
|
433
433
|
handleArrowBack={handleArrowBack}
|
|
434
|
+
isCustomView={props.isCustomView}
|
|
434
435
|
/>
|
|
435
436
|
<OrderDetailsContainer
|
|
436
437
|
keyboardShouldPersistTaps="handled"
|
|
@@ -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 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
|
-
<Table>
|
|
380
|
-
<OText mBottom={4}>
|
|
381
|
-
{t(
|
|
382
|
-
'SUBTOTAL_WITH_DISCOUNT',
|
|
383
|
-
'Subtotal with discount',
|
|
384
|
-
)}
|
|
385
|
-
</OText>
|
|
386
|
-
{order?.tax_type === 1 ? (
|
|
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>
|
|
387
434
|
<OText mBottom={4}>
|
|
388
|
-
{
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
435
|
+
{tax.name || t('INHERIT_FROM_BUSINESS', 'Inherit from business')}
|
|
436
|
+
{`(${verifyDecimals(tax?.rate, parseNumber)}%)`}{' '}
|
|
437
|
+
</OText>
|
|
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 mBottom={4}>
|
|
448
|
+
{fee.name || t('INHERIT_FROM_BUSINESS', 'Inherit from business')}
|
|
449
|
+
({fee?.fixed > 0 && `${parsePrice(fee?.fixed)} + `}{fee.percentage}%){' '}
|
|
392
450
|
</OText>
|
|
393
|
-
|
|
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>
|
|
394
460
|
<OText mBottom={4}>
|
|
395
|
-
{
|
|
396
|
-
|
|
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 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>
|
|
@@ -30,6 +30,7 @@ interface OrderHeader {
|
|
|
30
30
|
logisticOrderStatus?: Array<number>,
|
|
31
31
|
handleViewSummaryOrder?: any;
|
|
32
32
|
handleCopyClipboard?: any
|
|
33
|
+
isCustomView?: any
|
|
33
34
|
}
|
|
34
35
|
|
|
35
36
|
export const OrderHeaderComponent = (props: OrderHeader) => {
|
|
@@ -105,17 +106,17 @@ export const OrderHeaderComponent = (props: OrderHeader) => {
|
|
|
105
106
|
|
|
106
107
|
return (
|
|
107
108
|
<>
|
|
108
|
-
|
|
109
|
-
<
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
(!order?.isLogistic || (!logisticOrderStatus?.includes(order?.status) && !order?.order_group)) && (
|
|
109
|
+
{!props.isCustomView && (
|
|
110
|
+
<Header>
|
|
111
|
+
<OIconButton
|
|
112
|
+
icon={theme.images.general.arrow_left}
|
|
113
|
+
iconStyle={{ width: 20, height: 20 }}
|
|
114
|
+
borderColor={theme.colors.clear}
|
|
115
|
+
style={{ ...styles.icons, justifyContent: 'flex-end' }}
|
|
116
|
+
onClick={() => handleArrowBack()}
|
|
117
|
+
/>
|
|
118
|
+
|
|
119
|
+
{(!order?.isLogistic || (!logisticOrderStatus?.includes(order?.status) && !order?.order_group)) && (
|
|
119
120
|
<Actions>
|
|
120
121
|
{getOrderStatus(order?.status, t)?.value !==
|
|
121
122
|
t('PENDING', 'Pending') && (
|
|
@@ -170,13 +171,80 @@ export const OrderHeaderComponent = (props: OrderHeader) => {
|
|
|
170
171
|
/>
|
|
171
172
|
</Actions>
|
|
172
173
|
)}
|
|
173
|
-
|
|
174
|
+
</Header>
|
|
175
|
+
)}
|
|
174
176
|
<OrderHeader>
|
|
175
|
-
|
|
176
|
-
{
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
177
|
+
{!props.isCustomView ? (
|
|
178
|
+
<OText size={13} style={{ marginBottom: 5 }}>
|
|
179
|
+
{order?.delivery_datetime_utc
|
|
180
|
+
? parseDate(order?.delivery_datetime_utc)
|
|
181
|
+
: parseDate(order?.delivery_datetime, { utc: false })}
|
|
182
|
+
</OText>
|
|
183
|
+
) : (
|
|
184
|
+
<Header style={{ alignItems: 'center' }}>
|
|
185
|
+
<OText size={13} style={{ marginBottom: 5 }}>
|
|
186
|
+
{order?.delivery_datetime_utc
|
|
187
|
+
? parseDate(order?.delivery_datetime_utc)
|
|
188
|
+
: parseDate(order?.delivery_datetime, { utc: false })}
|
|
189
|
+
</OText>
|
|
190
|
+
|
|
191
|
+
{(!order?.isLogistic || (!logisticOrderStatus?.includes(order?.status) && !order?.order_group)) && (
|
|
192
|
+
<Actions>
|
|
193
|
+
{getOrderStatus(order?.status, t)?.value !==
|
|
194
|
+
t('PENDING', 'Pending') && (
|
|
195
|
+
<>
|
|
196
|
+
<OIconButton
|
|
197
|
+
icon={theme.images.general.copy}
|
|
198
|
+
iconStyle={{
|
|
199
|
+
width: 20,
|
|
200
|
+
height: 25,
|
|
201
|
+
top: 2,
|
|
202
|
+
tintColor: theme.colors.backArrow,
|
|
203
|
+
}}
|
|
204
|
+
borderColor={theme.colors.clear}
|
|
205
|
+
style={styles.icons}
|
|
206
|
+
onClick={() => handleCopyClipboard?.()}
|
|
207
|
+
/>
|
|
208
|
+
<OIconButton
|
|
209
|
+
icon={theme.images.general.print}
|
|
210
|
+
iconStyle={{
|
|
211
|
+
width: 25,
|
|
212
|
+
height: 22,
|
|
213
|
+
tintColor: theme.colors.backArrow,
|
|
214
|
+
}}
|
|
215
|
+
borderColor={theme.colors.clear}
|
|
216
|
+
style={styles.icons}
|
|
217
|
+
onClick={() => handleViewSummaryOrder?.()}
|
|
218
|
+
/>
|
|
219
|
+
</>
|
|
220
|
+
)}
|
|
221
|
+
<OIconButton
|
|
222
|
+
icon={theme.images.general.map}
|
|
223
|
+
iconStyle={{
|
|
224
|
+
width: 20,
|
|
225
|
+
height: 20,
|
|
226
|
+
tintColor: theme.colors.backArrow,
|
|
227
|
+
}}
|
|
228
|
+
borderColor={theme.colors.clear}
|
|
229
|
+
style={styles.icons}
|
|
230
|
+
onClick={() => handleOpenMapView()}
|
|
231
|
+
/>
|
|
232
|
+
|
|
233
|
+
<OIconButton
|
|
234
|
+
icon={theme.images.general.messages}
|
|
235
|
+
iconStyle={{
|
|
236
|
+
width: 20,
|
|
237
|
+
height: 20,
|
|
238
|
+
tintColor: theme.colors.backArrow,
|
|
239
|
+
}}
|
|
240
|
+
borderColor={theme.colors.clear}
|
|
241
|
+
style={styles.icons}
|
|
242
|
+
onClick={() => handleOpenMessagesForBusiness()}
|
|
243
|
+
/>
|
|
244
|
+
</Actions>
|
|
245
|
+
)}
|
|
246
|
+
</Header>
|
|
247
|
+
)}
|
|
180
248
|
|
|
181
249
|
<OText numberOfLines={2} size={20} weight="600">
|
|
182
250
|
<>
|
|
@@ -200,6 +268,12 @@ export const OrderHeaderComponent = (props: OrderHeader) => {
|
|
|
200
268
|
<OText size={13} weight='bold'>{`${t('ORDER_TYPE', 'Order Type')}: `}</OText>
|
|
201
269
|
{orderTypes(order.delivery_type)}
|
|
202
270
|
</OText>
|
|
271
|
+
{order?.delivery_option && (
|
|
272
|
+
<OText size={13}>
|
|
273
|
+
<OText size={13} weight='bold'>{`${t('DELIVERY_PREFERENCE', 'Delivery Preference')}: `}</OText>
|
|
274
|
+
{order?.delivery_option?.name}
|
|
275
|
+
</OText>
|
|
276
|
+
)}
|
|
203
277
|
{order?.payment_events?.length > 0 && (
|
|
204
278
|
<View>
|
|
205
279
|
<OText size={13}>
|