ordering-ui-react-native 0.22.11 → 0.22.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 +6 -7
- package/src/DeliveryApp.tsx +43 -1
- package/src/components/BusinessesListing/index.tsx +1 -1
- package/src/components/Checkout/index.tsx +40 -39
- package/src/components/StripeMethodForm/index.tsx +4 -2
- package/src/components/VerifyPhone/styles.tsx +1 -2
- package/src/context/OfflineActions/index.tsx +236 -0
- package/src/types/index.tsx +2 -1
- package/themes/business/index.tsx +2 -0
- package/themes/business/src/components/AcceptOrRejectOrder/index.tsx +9 -6
- package/themes/business/src/components/AcceptOrRejectOrder/styles.tsx +1 -0
- package/themes/business/src/components/BusinessController/index.tsx +8 -3
- package/themes/business/src/components/BusinessProductList/index.tsx +2 -1
- package/themes/business/src/components/Chat/index.tsx +15 -3
- package/themes/business/src/components/DriverMap/index.tsx +49 -26
- package/themes/business/src/components/FloatingButton/index.tsx +3 -2
- package/themes/business/src/components/GoogleMap/index.tsx +15 -8
- package/themes/business/src/components/LanguageSelector/index.tsx +2 -3
- package/themes/business/src/components/LanguageSelector/lang_country.json +515 -70
- package/themes/business/src/components/LogoutButton/index.tsx +1 -1
- package/themes/business/src/components/MapView/index.tsx +36 -17
- package/themes/business/src/components/NewOrderNotification/index.tsx +40 -27
- package/themes/business/src/components/OrderDetails/Business.tsx +47 -27
- package/themes/business/src/components/OrderDetails/Delivery.tsx +134 -53
- package/themes/business/src/components/OrderDetails/OrderContentComponent.tsx +128 -41
- package/themes/business/src/components/OrderDetails/OrderHeaderComponent.tsx +50 -22
- package/themes/business/src/components/OrderDetails/styles.tsx +39 -3
- package/themes/business/src/components/OrderDetails/usePrinterCommands.tsx +84 -56
- package/themes/business/src/components/OrderDetailsLogistic/index.tsx +3 -2
- package/themes/business/src/components/OrderSummary/index.tsx +21 -17
- package/themes/business/src/components/OrdersListManager/index.tsx +13 -1
- package/themes/business/src/components/OrdersOption/index.tsx +217 -156
- package/themes/business/src/components/PhoneInputNumber/index.tsx +8 -5
- package/themes/business/src/components/PreviousMessages/index.tsx +26 -3
- package/themes/business/src/components/PreviousOrders/OrderItem.tsx +39 -16
- package/themes/business/src/components/PreviousOrders/index.tsx +74 -66
- package/themes/business/src/components/PrinterEdition/MessageAlert.tsx +33 -0
- package/themes/business/src/components/PrinterEdition/index.tsx +431 -0
- package/themes/business/src/components/PrinterEdition/printerList.tsx +23 -0
- package/themes/business/src/components/PrinterEdition/styles.tsx +61 -0
- package/themes/business/src/components/PrinterSettings/index.tsx +162 -173
- package/themes/business/src/components/PrinterSettings/styles.tsx +14 -1
- package/themes/business/src/components/ProductItemAccordion/index.tsx +3 -2
- package/themes/business/src/components/ReviewCustomer/index.tsx +2 -0
- package/themes/business/src/components/StoresList/index.tsx +2 -2
- package/themes/business/src/components/UserProfileForm/index.tsx +16 -17
- package/themes/business/src/components/WebsocketStatus/index.tsx +2 -2
- package/themes/business/src/components/shared/OTextarea.tsx +8 -9
- package/themes/business/src/config/currency.tsx +1010 -0
- package/themes/business/src/layouts/SafeAreaContainer.tsx +35 -19
- package/themes/business/src/types/index.tsx +13 -4
- package/themes/business/src/utils/index.tsx +33 -3
- package/themes/doordash/src/components/BusinessesListing/index.tsx +1 -1
- package/themes/doordash/src/components/LoginForm/index.tsx +1 -2
- package/themes/instacart/src/components/BusinessesListing/index.tsx +1 -1
- package/themes/kiosk/src/components/Checkout/index.tsx +6 -0
- package/themes/kiosk/src/components/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/shared/OButton.tsx +5 -18
- package/themes/original/index.tsx +11 -0
- package/themes/original/src/components/AddressForm/index.tsx +32 -17
- package/themes/original/src/components/AddressList/index.tsx +8 -7
- package/themes/original/src/components/AnalyticsSegment/index.tsx +6 -6
- package/themes/original/src/components/AppleLogin/index.tsx +4 -4
- package/themes/original/src/components/BusinessBasicInformation/index.tsx +5 -8
- package/themes/original/src/components/BusinessController/index.tsx +3 -3
- package/themes/original/src/components/BusinessItemAccordion/index.tsx +13 -5
- package/themes/original/src/components/BusinessListingSearch/BusinessSearchFooter.tsx +103 -92
- package/themes/original/src/components/BusinessListingSearch/BusinessSearchHeader.tsx +8 -6
- package/themes/original/src/components/BusinessListingSearch/index.tsx +1 -2
- package/themes/original/src/components/BusinessPreorder/index.tsx +46 -28
- package/themes/original/src/components/BusinessProductsList/SubcategoriesComponent/index.tsx +73 -70
- package/themes/original/src/components/BusinessProductsList/index.tsx +6 -7
- package/themes/original/src/components/BusinessProductsList/styles.tsx +0 -3
- package/themes/original/src/components/BusinessProductsListing/index.tsx +18 -6
- package/themes/original/src/components/BusinessTypeFilter/index.tsx +9 -8
- package/themes/original/src/components/BusinessesListing/Layout/Appointment/index.tsx +2 -1
- package/themes/original/src/components/BusinessesListing/Layout/Original/styles.tsx +1 -1
- package/themes/original/src/components/BusinessesListing/index.tsx +0 -1
- package/themes/original/src/components/Cart/index.tsx +46 -14
- package/themes/original/src/components/CartContent/index.tsx +2 -4
- package/themes/original/src/components/Checkout/index.tsx +113 -59
- package/themes/original/src/components/CitiesControl/index.tsx +0 -3
- package/themes/original/src/components/CouponControl/index.tsx +1 -3
- package/themes/original/src/components/DriverTips/index.tsx +1 -3
- package/themes/original/src/components/Favorite/index.tsx +1 -5
- package/themes/original/src/components/FavoriteList/index.tsx +0 -1
- package/themes/original/src/components/ForgotPasswordForm/index.tsx +5 -7
- package/themes/original/src/components/GiftCard/GiftCardUI/index.tsx +15 -17
- package/themes/original/src/components/GiftCard/PurchaseGiftCard/index.tsx +3 -7
- package/themes/original/src/components/GiftCard/RedeemGiftCard/index.tsx +24 -32
- package/themes/original/src/components/GiftCard/SendGiftCard/index.tsx +7 -9
- package/themes/original/src/components/GiftCard/VerticalGiftCardOrdersLayout/index.tsx +11 -12
- package/themes/original/src/components/GoogleMap/index.tsx +39 -18
- package/themes/original/src/components/Help/index.tsx +2 -0
- package/themes/original/src/components/HighestRatedBusinesses/index.tsx +1 -1
- package/themes/original/src/components/Home/index.tsx +3 -11
- package/themes/original/src/components/LoginForm/Otp/index.tsx +0 -3
- package/themes/original/src/components/LoginForm/index.tsx +4 -7
- package/themes/original/src/components/MessageListing/index.tsx +2 -1
- package/themes/original/src/components/Messages/index.tsx +27 -19
- package/themes/original/src/components/MomentOption/TimeListItem.tsx +56 -0
- package/themes/original/src/components/MomentOption/index.tsx +80 -51
- package/themes/original/src/components/MomentSelector/index.tsx +5 -2
- package/themes/original/src/components/MultiCartsPaymethodsAndWallets/index.tsx +7 -3
- package/themes/original/src/components/MultiCheckout/index.tsx +55 -27
- package/themes/original/src/components/MultiOrdersDetails/index.tsx +1 -0
- package/themes/original/src/components/MyOrders/index.tsx +2 -2
- package/themes/original/src/components/NavBar/index.tsx +7 -4
- package/themes/original/src/components/NetworkError/index.tsx +0 -5
- package/themes/original/src/components/NotFoundSource/index.tsx +0 -3
- package/themes/original/src/components/OrderDetails/OrderEta.tsx +4 -3
- package/themes/original/src/components/OrderDetails/OrderHistory.tsx +13 -10
- package/themes/original/src/components/OrderDetails/index.tsx +44 -21
- package/themes/original/src/components/OrderDetails/styles.tsx +0 -1
- package/themes/original/src/components/OrderProgress/index.tsx +5 -4
- package/themes/original/src/components/OrderSummary/index.tsx +29 -10
- package/themes/original/src/components/OrderTypeSelector/index.tsx +7 -6
- package/themes/original/src/components/OrdersOption/index.tsx +3 -6
- package/themes/original/src/components/PaymentOptionStripe/index.tsx +0 -5
- package/themes/original/src/components/PaymentOptionWallet/index.tsx +56 -56
- package/themes/original/src/components/PaymentOptions/index.tsx +0 -2
- package/themes/original/src/components/PlaceSpot/index.tsx +1 -3
- package/themes/original/src/components/PreviousOrders/index.tsx +1 -2
- package/themes/original/src/components/ProductForm/ActionButton.tsx +17 -20
- package/themes/original/src/components/ProductForm/index.tsx +107 -102
- package/themes/original/src/components/ProductItemAccordion/index.tsx +50 -43
- package/themes/original/src/components/ProductItemAccordion/styles.tsx +0 -3
- package/themes/original/src/components/ProductOptionSubOption/index.tsx +16 -8
- package/themes/original/src/components/ProfessionalProfile/index.tsx +4 -5
- package/themes/original/src/components/Promotions/index.tsx +6 -9
- package/themes/original/src/components/ReviewDriver/index.tsx +1 -1
- package/themes/original/src/components/ReviewOrder/index.tsx +2 -2
- package/themes/original/src/components/ReviewProducts/index.tsx +1 -1
- package/themes/original/src/components/ReviewTrigger/index.tsx +2 -2
- package/themes/original/src/components/ServiceForm/index.tsx +52 -54
- package/themes/original/src/components/Sessions/index.tsx +3 -3
- package/themes/original/src/components/SignupForm/index.tsx +86 -78
- package/themes/original/src/components/SingleOrderCard/index.tsx +6 -4
- package/themes/original/src/components/SingleProductCard/index.tsx +5 -5
- package/themes/original/src/components/SingleProductCard/styles.tsx +0 -3
- package/themes/original/src/components/StripeCardForm/index.tsx +0 -3
- package/themes/original/src/components/StripeCardsList/index.tsx +10 -3
- package/themes/original/src/components/StripeElementsForm/index.tsx +76 -62
- package/themes/original/src/components/StripeElementsForm/naked.tsx +48 -1
- package/themes/original/src/components/StripeRedirectForm/index.tsx +0 -3
- package/themes/original/src/components/TaxInformation/index.tsx +3 -2
- package/themes/original/src/components/UpsellingProducts/UpsellingContent.tsx +10 -7
- package/themes/original/src/components/UpsellingProducts/UpsellingLayout.tsx +8 -3
- package/themes/original/src/components/UserDetails/index.tsx +17 -16
- package/themes/original/src/components/UserFormDetails/index.tsx +160 -134
- package/themes/original/src/components/UserProfile/index.tsx +9 -1
- package/themes/original/src/components/UserVerification/index.tsx +14 -4
- package/themes/original/src/components/Wallets/index.tsx +6 -3
- package/themes/original/src/components/WebsocketStatus/index.tsx +1 -4
- package/themes/original/src/components/shared/OAlert.tsx +2 -1
- package/themes/original/src/components/shared/OButton.tsx +5 -4
- package/themes/original/src/components/shared/OInput.tsx +4 -8
- package/themes/original/src/components/shared/OModal.tsx +7 -2
- package/themes/original/src/types/index.tsx +5 -1
- package/themes/original/src/utils/index.tsx +30 -1
- package/themes/uber-eats/src/components/BusinessesListing/index.tsx +1 -1
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import React, { useState, useCallback } from 'react'
|
|
2
|
-
|
|
3
2
|
import { Platform, StyleSheet, View, TouchableOpacity, ScrollView } from 'react-native';
|
|
4
3
|
import AntDesignIcon from 'react-native-vector-icons/AntDesign'
|
|
5
4
|
|
|
@@ -13,17 +12,20 @@ import {
|
|
|
13
12
|
OrderBill,
|
|
14
13
|
Total,
|
|
15
14
|
OSRow,
|
|
15
|
+
OrderVehicle,
|
|
16
|
+
OrderSpot,
|
|
16
17
|
} from './styles';
|
|
17
18
|
|
|
18
19
|
import { ProductItemAccordion } from '../ProductItemAccordion';
|
|
19
20
|
|
|
20
|
-
import { verifyDecimals, calculateDistance, transformDistance } from '../../utils';
|
|
21
|
+
import { verifyDecimals, calculateDistance, transformDistance, getCurrenySymbol } from '../../utils';
|
|
21
22
|
|
|
22
23
|
import {
|
|
23
24
|
useLanguage,
|
|
24
25
|
useUtils,
|
|
25
26
|
useConfig,
|
|
26
|
-
useSession
|
|
27
|
+
useSession,
|
|
28
|
+
useApi
|
|
27
29
|
} from 'ordering-components/native';
|
|
28
30
|
import { useTheme } from 'styled-components/native';
|
|
29
31
|
import { ReviewCustomer } from '../ReviewCustomer'
|
|
@@ -44,6 +46,7 @@ interface OrderContent {
|
|
|
44
46
|
export const OrderContentComponent = (props: OrderContent) => {
|
|
45
47
|
const [, t] = useLanguage();
|
|
46
48
|
const theme = useTheme()
|
|
49
|
+
const [ordering] = useApi()
|
|
47
50
|
const [{ user }] = useSession()
|
|
48
51
|
const { order, logisticOrderStatus, isOrderGroup, lastOrder } = props;
|
|
49
52
|
const [{ parsePrice, parseNumber }] = useUtils();
|
|
@@ -66,6 +69,7 @@ export const OrderContentComponent = (props: OrderContent) => {
|
|
|
66
69
|
})
|
|
67
70
|
|
|
68
71
|
const pastOrderStatuses = [1, 2, 5, 6, 10, 11, 12, 16, 17]
|
|
72
|
+
const deliveryTypes = [1, 7]
|
|
69
73
|
|
|
70
74
|
const walletName: any = {
|
|
71
75
|
cash: {
|
|
@@ -97,19 +101,21 @@ export const OrderContentComponent = (props: OrderContent) => {
|
|
|
97
101
|
}
|
|
98
102
|
})
|
|
99
103
|
|
|
100
|
-
const getIncludedTaxes = () => {
|
|
104
|
+
const getIncludedTaxes = (isDeliveryFee?: boolean) => {
|
|
101
105
|
if (!order?.taxes) return 0
|
|
102
106
|
if (order?.taxes?.length === 0) {
|
|
103
107
|
return order.tax_type === 1 ? order?.summary?.tax ?? 0 : 0
|
|
104
108
|
} else {
|
|
105
109
|
return order?.taxes.reduce((taxIncluded: number, tax: any) => {
|
|
106
|
-
return taxIncluded +
|
|
110
|
+
return taxIncluded +
|
|
111
|
+
(((!isDeliveryFee && tax.type === 1 && tax.target === 'product') ||
|
|
112
|
+
(isDeliveryFee && tax.type === 1 && tax.target === 'delivery_fee')) ? tax.summary?.tax : 0)
|
|
107
113
|
}, 0)
|
|
108
114
|
}
|
|
109
115
|
}
|
|
110
116
|
|
|
111
117
|
const getIncludedTaxesDiscounts = () => {
|
|
112
|
-
return order?.taxes?.filter((tax: any) => tax?.type === 1)?.reduce((carry: number, tax: any) => carry + (tax?.summary?.tax_after_discount ?? tax?.summary?.tax), 0)
|
|
118
|
+
return order?.taxes?.filter((tax: any) => tax?.type === 1 && tax?.target === 'product')?.reduce((carry: number, tax: any) => carry + (tax?.summary?.tax_after_discount ?? tax?.summary?.tax), 0)
|
|
113
119
|
}
|
|
114
120
|
|
|
115
121
|
const containsOnlyNumbers = (str: string) => {
|
|
@@ -230,7 +236,7 @@ export const OrderContentComponent = (props: OrderContent) => {
|
|
|
230
236
|
)}
|
|
231
237
|
{!!order?.business?.location && order?.customer?.location && (
|
|
232
238
|
<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
|
|
239
|
+
{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
240
|
</OText>
|
|
235
241
|
)}
|
|
236
242
|
{!!order?.business?.address_notes && (
|
|
@@ -408,16 +414,16 @@ export const OrderContentComponent = (props: OrderContent) => {
|
|
|
408
414
|
{t('ON_BEHALF_OF', 'On behalf of')}{': '} {order?.on_behalf_of}
|
|
409
415
|
</OText>
|
|
410
416
|
)}
|
|
411
|
-
{(order?.delivery_option !== undefined && order?.delivery_type
|
|
417
|
+
{(order?.delivery_option !== undefined && deliveryTypes.includes(order?.delivery_type)) && (
|
|
412
418
|
<View style={{ marginTop: 10 }}>
|
|
413
|
-
{order?.delivery_option !== undefined && order?.delivery_type
|
|
419
|
+
{order?.delivery_option !== undefined && deliveryTypes.includes(order?.delivery_type) && (
|
|
414
420
|
<OText>
|
|
415
|
-
{t(order?.delivery_option?.name?.toUpperCase()?.replace(/ /g, '_'), order?.delivery_option?.name)}
|
|
421
|
+
{t(order?.delivery_option?.name?.toUpperCase?.()?.replace(/ /g, '_'), order?.delivery_option?.name)}
|
|
416
422
|
</OText>
|
|
417
423
|
)}
|
|
418
424
|
</View>
|
|
419
425
|
)}
|
|
420
|
-
{!order?.user_review && pastOrderStatuses.includes(order?.status) && (
|
|
426
|
+
{!order?.user_review && pastOrderStatuses.includes(order?.status) && order?.customer_id && (
|
|
421
427
|
<OButton
|
|
422
428
|
style={styles.btnReview}
|
|
423
429
|
textStyle={{ color: theme.colors.white }}
|
|
@@ -434,9 +440,19 @@ export const OrderContentComponent = (props: OrderContent) => {
|
|
|
434
440
|
</OText>
|
|
435
441
|
|
|
436
442
|
{!!order?.comment && (
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
443
|
+
<>
|
|
444
|
+
<OText>
|
|
445
|
+
{`${t('ORDER_COMMENT', 'Order Comment')}: `}
|
|
446
|
+
</OText>
|
|
447
|
+
<OText
|
|
448
|
+
{...(ordering?.project?.includes('delosi') && {
|
|
449
|
+
color: theme.colors.primary,
|
|
450
|
+
weight: 'bold'
|
|
451
|
+
})}
|
|
452
|
+
>
|
|
453
|
+
{order?.comment}
|
|
454
|
+
</OText>
|
|
455
|
+
</>
|
|
440
456
|
)}
|
|
441
457
|
|
|
442
458
|
{order?.products?.length > 0 &&
|
|
@@ -449,11 +465,11 @@ export const OrderContentComponent = (props: OrderContent) => {
|
|
|
449
465
|
))}
|
|
450
466
|
</OrderProducts>
|
|
451
467
|
|
|
452
|
-
<OrderBill>
|
|
468
|
+
<OrderBill vehicleExists={!!order?.vehicle}>
|
|
453
469
|
<Table>
|
|
454
470
|
<OText mBottom={4}>{t('SUBTOTAL', 'Subtotal')}</OText>
|
|
455
471
|
<OText mBottom={4}>
|
|
456
|
-
{parsePrice(((order?.summary?.subtotal ?? order?.subtotal) + getIncludedTaxes()), { currency: order?.currency })}
|
|
472
|
+
{parsePrice(((order?.summary?.subtotal ?? order?.subtotal) + getIncludedTaxes()), { currency: getCurrenySymbol(order?.currency) })}
|
|
457
473
|
</OText>
|
|
458
474
|
</Table>
|
|
459
475
|
{(order?.summary?.discount > 0 ?? order?.discount > 0) && order?.offers?.length === 0 && (
|
|
@@ -466,7 +482,7 @@ export const OrderContentComponent = (props: OrderContent) => {
|
|
|
466
482
|
) : (
|
|
467
483
|
<OText mBottom={4}>{t('DISCOUNT', theme?.defaultLanguages?.DISCOUNT || 'Discount')}</OText>
|
|
468
484
|
)}
|
|
469
|
-
<OText>- {parsePrice(order?.summary?.discount ?? order?.discount, { currency: order?.currency })}</OText>
|
|
485
|
+
<OText>- {parsePrice(order?.summary?.discount ?? order?.discount, { currency: getCurrenySymbol(order?.currency) })}</OText>
|
|
470
486
|
</Table>
|
|
471
487
|
)}
|
|
472
488
|
{
|
|
@@ -474,13 +490,13 @@ export const OrderContentComponent = (props: OrderContent) => {
|
|
|
474
490
|
<Table key={offer.id}>
|
|
475
491
|
<OSRow>
|
|
476
492
|
<OText mBottom={4}>
|
|
477
|
-
{t(offer.name?.toUpperCase()?.replace(/ /g, '_'), offer.name)}
|
|
493
|
+
{t(offer.name?.toUpperCase?.()?.replace(/ /g, '_'), offer.name)}
|
|
478
494
|
{offer.rate_type === 1 && (
|
|
479
495
|
<OText>{`(${verifyDecimals(offer?.rate, parsePrice)}%)`}</OText>
|
|
480
496
|
)}
|
|
481
497
|
</OText>
|
|
482
498
|
</OSRow>
|
|
483
|
-
<OText mBottom={4}>- {parsePrice(offer?.summary?.discount, { currency: order?.currency })}</OText>
|
|
499
|
+
<OText mBottom={4}>- {parsePrice(offer?.summary?.discount, { currency: getCurrenySymbol(order?.currency) })}</OText>
|
|
484
500
|
</Table>
|
|
485
501
|
))
|
|
486
502
|
}
|
|
@@ -488,9 +504,9 @@ export const OrderContentComponent = (props: OrderContent) => {
|
|
|
488
504
|
<Table>
|
|
489
505
|
<OText mBottom={4}>{t('SUBTOTAL_WITH_DISCOUNT', 'Subtotal with discount')}</OText>
|
|
490
506
|
{order?.tax_type === 1 ? (
|
|
491
|
-
<OText mBottom={4}>{parsePrice((order?.summary?.subtotal_with_discount + getIncludedTaxesDiscounts() ?? 0), { currency: order?.currency })}</OText>
|
|
507
|
+
<OText mBottom={4}>{parsePrice((order?.summary?.subtotal_with_discount + getIncludedTaxesDiscounts() ?? 0), { currency: getCurrenySymbol(order?.currency) })}</OText>
|
|
492
508
|
) : (
|
|
493
|
-
<OText mBottom={4}>{parsePrice(order?.summary?.subtotal_with_discount ?? 0, { currency: order?.currency })}</OText>
|
|
509
|
+
<OText mBottom={4}>{parsePrice(order?.summary?.subtotal_with_discount ?? 0, { currency: getCurrenySymbol(order?.currency) })}</OText>
|
|
494
510
|
)}
|
|
495
511
|
</Table>
|
|
496
512
|
)}
|
|
@@ -500,7 +516,7 @@ export const OrderContentComponent = (props: OrderContent) => {
|
|
|
500
516
|
{t('TAX', 'Tax')} {`(${verifyDecimals(order?.tax, parseNumber)}%)`}
|
|
501
517
|
</OText>
|
|
502
518
|
<OText mBottom={4}>
|
|
503
|
-
{parsePrice(order?.summary?.tax ?? 0, { currency: order?.currency })}
|
|
519
|
+
{parsePrice(order?.summary?.tax ?? 0, { currency: getCurrenySymbol(order?.currency) })}
|
|
504
520
|
</OText>
|
|
505
521
|
</Table>
|
|
506
522
|
)}
|
|
@@ -511,20 +527,20 @@ export const OrderContentComponent = (props: OrderContent) => {
|
|
|
511
527
|
{t('SERVICE_FEE', 'Service fee')}
|
|
512
528
|
{`(${verifyDecimals(order?.service_fee, parseNumber)}%)`}
|
|
513
529
|
</OText>
|
|
514
|
-
<OText mBottom={4}>{parsePrice(order?.summary?.service_fee ?? 0, { currency: order?.currency })}</OText>
|
|
530
|
+
<OText mBottom={4}>{parsePrice(order?.summary?.service_fee ?? 0, { currency: getCurrenySymbol(order?.currency) })}</OText>
|
|
515
531
|
</Table>
|
|
516
532
|
)
|
|
517
533
|
}
|
|
518
534
|
{
|
|
519
|
-
order?.taxes?.length > 0 && order?.taxes?.filter((tax: any) => tax?.type === 2 && tax?.rate !== 0).map((tax: any) => (
|
|
535
|
+
order?.taxes?.length > 0 && order?.taxes?.filter((tax: any) => tax?.type === 2 && tax?.rate !== 0 && tax?.target === 'product').map((tax: any) => (
|
|
520
536
|
<Table key={tax.id}>
|
|
521
537
|
<OSRow>
|
|
522
538
|
<OText mBottom={4}>
|
|
523
|
-
{t(tax?.name?.toUpperCase()?.replace(/ /g, '_'), tax?.name) || t('INHERIT_FROM_BUSINESS', 'Inherit from business')}
|
|
539
|
+
{t(tax?.name?.toUpperCase?.()?.replace(/ /g, '_'), tax?.name) || t('INHERIT_FROM_BUSINESS', 'Inherit from business')}
|
|
524
540
|
{`(${verifyDecimals(tax?.rate, parseNumber)}%)`}{' '}
|
|
525
541
|
</OText>
|
|
526
542
|
</OSRow>
|
|
527
|
-
<OText mBottom={4}>{parsePrice(tax?.summary?.tax_after_discount ?? tax?.summary?.tax ?? 0, { currency: order?.currency })}</OText>
|
|
543
|
+
<OText mBottom={4}>{parsePrice(tax?.summary?.tax_after_discount ?? tax?.summary?.tax ?? 0, { currency: getCurrenySymbol(order?.currency) })}</OText>
|
|
528
544
|
</Table>
|
|
529
545
|
))
|
|
530
546
|
}
|
|
@@ -533,11 +549,11 @@ export const OrderContentComponent = (props: OrderContent) => {
|
|
|
533
549
|
<Table key={fee.id}>
|
|
534
550
|
<OSRow>
|
|
535
551
|
<OText mBottom={4}>
|
|
536
|
-
{t(fee?.name?.toUpperCase()?.replace(/ /g, '_'), fee?.name) || t('INHERIT_FROM_BUSINESS', 'Inherit from business')}
|
|
537
|
-
({fee?.fixed > 0 && `${parsePrice(fee?.fixed, { currency: order?.currency })} + `}{fee.percentage}%){' '}
|
|
552
|
+
{t(fee?.name?.toUpperCase?.()?.replace(/ /g, '_'), fee?.name) || t('INHERIT_FROM_BUSINESS', 'Inherit from business')}
|
|
553
|
+
({fee?.fixed > 0 && `${parsePrice(fee?.fixed, { currency: getCurrenySymbol(order?.currency) })} + `}{fee.percentage}%){' '}
|
|
538
554
|
</OText>
|
|
539
555
|
</OSRow>
|
|
540
|
-
<OText mBottom={4}>{parsePrice(fee?.summary?.fixed + (fee?.summary?.percentage_after_discount ?? fee?.summary?.percentage) ?? 0, { currency: order?.currency })}</OText>
|
|
556
|
+
<OText mBottom={4}>{parsePrice(fee?.summary?.fixed + (fee?.summary?.percentage_after_discount ?? fee?.summary?.percentage) ?? 0, { currency: getCurrenySymbol(order?.currency) })}</OText>
|
|
541
557
|
</Table>
|
|
542
558
|
))
|
|
543
559
|
}
|
|
@@ -546,13 +562,13 @@ export const OrderContentComponent = (props: OrderContent) => {
|
|
|
546
562
|
<Table key={offer.id}>
|
|
547
563
|
<OSRow>
|
|
548
564
|
<OText mBottom={4}>
|
|
549
|
-
{t(offer.name?.toUpperCase()?.replace(/ /g, '_'), offer.name)}
|
|
565
|
+
{t(offer.name?.toUpperCase?.()?.replace(/ /g, '_'), offer.name)}
|
|
550
566
|
{offer.rate_type === 1 && (
|
|
551
567
|
<OText>{`(${verifyDecimals(offer?.rate, parsePrice)}%)`}</OText>
|
|
552
568
|
)}
|
|
553
569
|
</OText>
|
|
554
570
|
</OSRow>
|
|
555
|
-
<OText mBottom={4}>- {parsePrice(offer?.summary?.discount, { currency: order?.currency })}</OText>
|
|
571
|
+
<OText mBottom={4}>- {parsePrice(offer?.summary?.discount, { currency: getCurrenySymbol(order?.currency) })}</OText>
|
|
556
572
|
</Table>
|
|
557
573
|
))
|
|
558
574
|
}
|
|
@@ -564,23 +580,36 @@ export const OrderContentComponent = (props: OrderContent) => {
|
|
|
564
580
|
</OText>
|
|
565
581
|
|
|
566
582
|
<OText mBottom={4}>
|
|
567
|
-
{parsePrice(order?.summary?.delivery_price, { currency: order?.currency })}
|
|
583
|
+
{parsePrice(order?.summary?.delivery_price + getIncludedTaxes(true), { currency: getCurrenySymbol(order?.currency) })}
|
|
568
584
|
</OText>
|
|
569
585
|
</Table>
|
|
570
586
|
)
|
|
571
587
|
}
|
|
588
|
+
{
|
|
589
|
+
order?.taxes?.length > 0 && order?.taxes?.filter((tax: any) => tax?.type === 2 && tax?.rate !== 0 && tax?.target === 'delivery_fee').map((tax: any, i: number) => (
|
|
590
|
+
<Table key={`${tax.description}_${i}`}>
|
|
591
|
+
<OSRow>
|
|
592
|
+
<OText mBottom={4}>
|
|
593
|
+
{tax.name || t('INHERIT_FROM_BUSINESS', 'Inherit from business')}
|
|
594
|
+
{`(${verifyDecimals(tax?.rate, parseNumber)}%)`}
|
|
595
|
+
</OText>
|
|
596
|
+
</OSRow>
|
|
597
|
+
<OText mBottom={4}>{parsePrice(tax?.summary?.tax_after_discount ?? tax?.summary?.tax ?? 0, { currency: getCurrenySymbol(order?.currency) })}</OText>
|
|
598
|
+
</Table>
|
|
599
|
+
))
|
|
600
|
+
}
|
|
572
601
|
{
|
|
573
602
|
order?.offers?.length > 0 && order?.offers?.filter((offer: any) => offer?.target === 2)?.map((offer: any) => (
|
|
574
603
|
<Table key={offer.id}>
|
|
575
604
|
<OSRow>
|
|
576
605
|
<OText mBottom={4}>
|
|
577
|
-
{t(offer.name?.toUpperCase()?.replace(/ /g, '_'), offer.name)}
|
|
606
|
+
{t(offer.name?.toUpperCase?.()?.replace(/ /g, '_'), offer.name)}
|
|
578
607
|
{offer.rate_type === 1 && (
|
|
579
|
-
<OText>{`(${verifyDecimals(offer?.rate, parsePrice)}%)`}</OText>
|
|
608
|
+
<OText>{`(${verifyDecimals(offer?.rate, parsePrice, { currency: getCurrenySymbol(order?.currency) })}%)`}</OText>
|
|
580
609
|
)}
|
|
581
610
|
</OText>
|
|
582
611
|
</OSRow>
|
|
583
|
-
<OText mBottom={4}>- {parsePrice(offer?.summary?.discount, { currency: order?.currency })}</OText>
|
|
612
|
+
<OText mBottom={4}>- {parsePrice(offer?.summary?.discount, { currency: getCurrenySymbol(order?.currency) })}</OText>
|
|
584
613
|
</Table>
|
|
585
614
|
))
|
|
586
615
|
}
|
|
@@ -594,7 +623,7 @@ export const OrderContentComponent = (props: OrderContent) => {
|
|
|
594
623
|
`(${verifyDecimals(order?.driver_tip, parseNumber)}%)`
|
|
595
624
|
)}
|
|
596
625
|
</OText>
|
|
597
|
-
<OText mBottom={4}>{parsePrice(order?.summary?.driver_tip ?? order?.totalDriverTip, { currency: order?.currency })}</OText>
|
|
626
|
+
<OText mBottom={4}>{parsePrice(order?.summary?.driver_tip ?? order?.totalDriverTip, { currency: getCurrenySymbol(order?.currency) })}</OText>
|
|
598
627
|
</Table>
|
|
599
628
|
)}
|
|
600
629
|
|
|
@@ -608,7 +637,7 @@ export const OrderContentComponent = (props: OrderContent) => {
|
|
|
608
637
|
mBottom={4}
|
|
609
638
|
style={styles.textBold}
|
|
610
639
|
color={theme.colors.primary}>
|
|
611
|
-
{parsePrice(order?.summary?.total ?? order?.total, { currency: order?.currency })}
|
|
640
|
+
{parsePrice(order?.summary?.total ?? order?.total, { currency: getCurrenySymbol(order?.currency) })}
|
|
612
641
|
</OText>
|
|
613
642
|
</Table>
|
|
614
643
|
</Total>
|
|
@@ -643,23 +672,81 @@ export const OrderContentComponent = (props: OrderContent) => {
|
|
|
643
672
|
{event?.wallet_event
|
|
644
673
|
? walletName[event?.wallet_event?.wallet?.type]?.name
|
|
645
674
|
: event?.paymethod?.gateway
|
|
646
|
-
? t(event?.paymethod?.gateway?.toUpperCase(), event?.paymethod?.name)
|
|
675
|
+
? t(event?.paymethod?.gateway?.toUpperCase?.(), event?.paymethod?.name)
|
|
647
676
|
: order?.paymethod?.id === event?.paymethod_id
|
|
648
|
-
? t(order?.paymethod?.gateway?.toUpperCase(), order?.paymethod?.name)
|
|
677
|
+
? t(order?.paymethod?.gateway?.toUpperCase?.(), order?.paymethod?.name)
|
|
649
678
|
: ''}
|
|
650
679
|
</OText>
|
|
651
680
|
</View>
|
|
652
681
|
<OText>
|
|
653
682
|
{(event?.paymethod?.gateway === 'cash' && order?.cash)
|
|
654
|
-
? parsePrice(order?.cash, { currency: order?.currency })
|
|
655
|
-
: `-${parsePrice(event?.amount, { currency: order?.currency })}`}
|
|
683
|
+
? parsePrice(order?.cash, { currency: getCurrenySymbol(order?.currency) })
|
|
684
|
+
: `-${parsePrice(event?.amount, { currency: getCurrenySymbol(order?.currency) })}`}
|
|
656
685
|
</OText>
|
|
657
686
|
</View>
|
|
658
687
|
))}
|
|
659
688
|
</View>
|
|
660
689
|
</View>
|
|
661
690
|
)}
|
|
691
|
+
|
|
662
692
|
</OrderBill >
|
|
693
|
+
|
|
694
|
+
{!!order?.spot_number && (
|
|
695
|
+
<OrderSpot vehicleExists={!!order?.vehicle}>
|
|
696
|
+
<Table>
|
|
697
|
+
<OText style={{ marginBottom: 5 }}>
|
|
698
|
+
{t('SPOT_NUMBER', 'Spot number')}
|
|
699
|
+
</OText>
|
|
700
|
+
<OText style={{ marginBottom: 5 }}>
|
|
701
|
+
{order?.spot_number}
|
|
702
|
+
</OText>
|
|
703
|
+
</Table>
|
|
704
|
+
</OrderSpot>
|
|
705
|
+
)}
|
|
706
|
+
|
|
707
|
+
{!!order?.vehicle && (
|
|
708
|
+
<OrderVehicle>
|
|
709
|
+
<OText
|
|
710
|
+
style={{ marginBottom: 5 }}
|
|
711
|
+
size={16}
|
|
712
|
+
weight="600"
|
|
713
|
+
color={theme.colors.textGray}>
|
|
714
|
+
{t('VEHICLE', 'Vehicle')}
|
|
715
|
+
</OText>
|
|
716
|
+
<Table>
|
|
717
|
+
<OText style={{ marginBottom: 5 }}>
|
|
718
|
+
{t('CAR_REGISTRATION', 'Car registration')}
|
|
719
|
+
</OText>
|
|
720
|
+
<OText style={{ marginBottom: 5 }}>
|
|
721
|
+
{order?.vehicle?.car_registration}
|
|
722
|
+
</OText>
|
|
723
|
+
</Table>
|
|
724
|
+
<Table>
|
|
725
|
+
<OText style={{ marginBottom: 5 }}>
|
|
726
|
+
{t('COLOR', 'Color')}
|
|
727
|
+
</OText>
|
|
728
|
+
<OText style={{ marginBottom: 5 }}>
|
|
729
|
+
{order?.vehicle?.color}
|
|
730
|
+
</OText>
|
|
731
|
+
</Table>
|
|
732
|
+
<Table>
|
|
733
|
+
<OText style={{ marginBottom: 5 }}>
|
|
734
|
+
{t('MODEL', 'Model')}
|
|
735
|
+
</OText>
|
|
736
|
+
<OText style={{ marginBottom: 5 }}>
|
|
737
|
+
{order?.vehicle?.model}
|
|
738
|
+
</OText>
|
|
739
|
+
</Table>
|
|
740
|
+
<Table>
|
|
741
|
+
<OText style={{ marginBottom: 5 }}>
|
|
742
|
+
{t('TYPE', 'Type')}
|
|
743
|
+
</OText>
|
|
744
|
+
<OText style={{ marginBottom: 5 }}>
|
|
745
|
+
{order?.vehicle?.type}
|
|
746
|
+
</OText>
|
|
747
|
+
</Table>
|
|
748
|
+
</OrderVehicle>
|
|
749
|
+
)}
|
|
663
750
|
<OModal
|
|
664
751
|
open={openReviewModal}
|
|
665
752
|
onClose={() => setOpenReviewModal(false)}
|
|
@@ -3,7 +3,9 @@ import React from 'react';
|
|
|
3
3
|
//Styles
|
|
4
4
|
import {
|
|
5
5
|
Actions,
|
|
6
|
+
Dot,
|
|
6
7
|
Header,
|
|
8
|
+
Messages,
|
|
7
9
|
OrderHeader,
|
|
8
10
|
} from './styles';
|
|
9
11
|
|
|
@@ -22,6 +24,8 @@ import MaterialCommunityIcons from 'react-native-vector-icons/MaterialCommunityI
|
|
|
22
24
|
import {
|
|
23
25
|
useLanguage,
|
|
24
26
|
useUtils,
|
|
27
|
+
useConfig,
|
|
28
|
+
useSession
|
|
25
29
|
} from 'ordering-components/native';
|
|
26
30
|
|
|
27
31
|
interface OrderHeader {
|
|
@@ -34,6 +38,8 @@ interface OrderHeader {
|
|
|
34
38
|
handleViewSummaryOrder?: any;
|
|
35
39
|
handleCopyClipboard?: any
|
|
36
40
|
isCustomView?: any
|
|
41
|
+
messages?: any
|
|
42
|
+
messagesReadList?: any
|
|
37
43
|
}
|
|
38
44
|
|
|
39
45
|
export const OrderHeaderComponent = (props: OrderHeader) => {
|
|
@@ -45,12 +51,21 @@ export const OrderHeaderComponent = (props: OrderHeader) => {
|
|
|
45
51
|
getOrderStatus,
|
|
46
52
|
logisticOrderStatus,
|
|
47
53
|
handleViewSummaryOrder,
|
|
48
|
-
handleCopyClipboard
|
|
54
|
+
handleCopyClipboard,
|
|
55
|
+
messages,
|
|
56
|
+
messagesReadList
|
|
49
57
|
} = props
|
|
50
58
|
const theme = useTheme();
|
|
51
59
|
const [, t] = useLanguage();
|
|
60
|
+
const [configState] = useConfig()
|
|
61
|
+
const [{ user }] = useSession()
|
|
52
62
|
const [{ parseDate, parsePrice }] = useUtils();
|
|
53
63
|
const paymethodsLength = order?.payment_events?.filter((item: any) => item.event === 'payment')?.length
|
|
64
|
+
const showExternalId = configState?.configs?.change_order_id?.value === '1'
|
|
65
|
+
const messagesReadIds = messagesReadList?.map((message: any) => message?.order_message_id)
|
|
66
|
+
|
|
67
|
+
const filteredMessages = messagesReadList?.length > 0 ? messages?.messages?.filter((message: any) => !messagesReadIds?.includes(message?.id)) : messages?.messages
|
|
68
|
+
const cateringTypes = [7, 8]
|
|
54
69
|
|
|
55
70
|
const styles = StyleSheet.create({
|
|
56
71
|
icons: {
|
|
@@ -88,6 +103,11 @@ export const OrderHeaderComponent = (props: OrderHeader) => {
|
|
|
88
103
|
19: theme.colors.statusOrderBlue,
|
|
89
104
|
20: theme.colors.statusOrderBlue,
|
|
90
105
|
21: theme.colors.statusOrderBlue,
|
|
106
|
+
22: theme.colors.statusOrderBlue,
|
|
107
|
+
23: theme.colors.statusOrderBlue,
|
|
108
|
+
24: theme.colors.statusOrderBlue,
|
|
109
|
+
25: theme.colors.statusOrderBlue,
|
|
110
|
+
26: theme.colors.statusOrderBlue,
|
|
91
111
|
//GREEN
|
|
92
112
|
1: theme.colors.statusOrderGreen,
|
|
93
113
|
11: theme.colors.statusOrderGreen,
|
|
@@ -135,12 +155,13 @@ export const OrderHeaderComponent = (props: OrderHeader) => {
|
|
|
135
155
|
}
|
|
136
156
|
|
|
137
157
|
const deliveryDate = () => {
|
|
138
|
-
const dateString = order?.delivery_datetime_utc
|
|
158
|
+
const dateString = order?.delivery_datetime_utc ?? order?.delivery_datetime
|
|
139
159
|
const currentDate = new Date();
|
|
140
|
-
const receivedDate: any = new Date(
|
|
160
|
+
const receivedDate: any = new Date(order?.delivery_datetime);
|
|
161
|
+
|
|
141
162
|
const formattedDate = receivedDate <= currentDate
|
|
142
|
-
? `${t('ASAP_ABBREVIATION', 'ASAP')}(${parseDate(
|
|
143
|
-
: parseDate(
|
|
163
|
+
? `${t('ASAP_ABBREVIATION', 'ASAP')}(${parseDate(dateString, { utc: !!order?.delivery_datetime_utc })})`
|
|
164
|
+
: parseDate(dateString, { utc: !!order?.delivery_datetime_utc })
|
|
144
165
|
return formattedDate
|
|
145
166
|
}
|
|
146
167
|
|
|
@@ -187,18 +208,20 @@ export const OrderHeaderComponent = (props: OrderHeader) => {
|
|
|
187
208
|
style={styles.icons}
|
|
188
209
|
onClick={() => handleOpenMapView()}
|
|
189
210
|
/>
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
211
|
+
<Messages>
|
|
212
|
+
{filteredMessages?.filter((message: any) => message?.author_id !== user?.id && !message?.read)?.length > 0 && <Dot />}
|
|
213
|
+
<OIconButton
|
|
214
|
+
icon={theme.images.general.messages}
|
|
215
|
+
iconStyle={{
|
|
216
|
+
width: 20,
|
|
217
|
+
height: 20,
|
|
218
|
+
tintColor: theme.colors.textGray,
|
|
219
|
+
}}
|
|
220
|
+
borderColor={theme.colors.clear}
|
|
221
|
+
style={styles.icons}
|
|
222
|
+
onClick={() => handleOpenMessagesForBusiness()}
|
|
223
|
+
/>
|
|
224
|
+
</Messages>
|
|
202
225
|
</Actions>
|
|
203
226
|
)}
|
|
204
227
|
</Header>
|
|
@@ -206,12 +229,18 @@ export const OrderHeaderComponent = (props: OrderHeader) => {
|
|
|
206
229
|
<OrderHeader>
|
|
207
230
|
{!props.isCustomView ? (
|
|
208
231
|
<OText size={13} style={{ marginBottom: 5 }}>
|
|
209
|
-
|
|
232
|
+
<>
|
|
233
|
+
{cateringTypes.includes(order?.delivery_type) ? `${t('CREATED_AT', 'Created at')}: ${parseDate(order?.created_at)}\n` : ''}
|
|
234
|
+
{cateringTypes.includes(order?.delivery_type) ? `${t('PLACED_TO', 'Placed to')}: ` : ''}{deliveryDate()}
|
|
235
|
+
</>
|
|
210
236
|
</OText>
|
|
211
237
|
) : (
|
|
212
238
|
<Header style={{ alignItems: 'center' }}>
|
|
213
239
|
<OText size={13} style={{ marginBottom: 5 }}>
|
|
214
|
-
|
|
240
|
+
<>
|
|
241
|
+
{cateringTypes.includes(order?.delivery_type) ? `${t('CREATED_AT', 'Created at')}: ${parseDate(order?.created_at)}\n` : ''}
|
|
242
|
+
{cateringTypes.includes(order?.delivery_type) ? `${t('PLACED_TO', 'Placed to')}: ` : ''}{deliveryDate()}
|
|
243
|
+
</>
|
|
215
244
|
</OText>
|
|
216
245
|
|
|
217
246
|
{(!order?.isLogistic || (!logisticOrderStatus?.includes(order?.status) && !order?.order_group)) && (
|
|
@@ -250,7 +279,6 @@ export const OrderHeaderComponent = (props: OrderHeader) => {
|
|
|
250
279
|
style={styles.icons}
|
|
251
280
|
onClick={() => handleOpenMapView()}
|
|
252
281
|
/>
|
|
253
|
-
|
|
254
282
|
<OIconButton
|
|
255
283
|
icon={theme.images.general.messages}
|
|
256
284
|
iconStyle={{
|
|
@@ -269,7 +297,7 @@ export const OrderHeaderComponent = (props: OrderHeader) => {
|
|
|
269
297
|
|
|
270
298
|
<OText numberOfLines={2} size={20} weight="600">
|
|
271
299
|
<>
|
|
272
|
-
{`${t('INVOICE_ORDER_NO', 'Order No.')} ${order?.id} `}
|
|
300
|
+
{`${t('INVOICE_ORDER_NO', 'Order No.')} ${showExternalId ? order?.external_id || order?.id : order?.id} `}
|
|
273
301
|
{!order?.isLogistic && (!order?.order_group_id || !logisticOrderStatus?.includes(order?.status)) && (
|
|
274
302
|
<>
|
|
275
303
|
{t('IS', 'is')}{' '}
|
|
@@ -283,7 +311,7 @@ export const OrderHeaderComponent = (props: OrderHeader) => {
|
|
|
283
311
|
)}
|
|
284
312
|
</>
|
|
285
313
|
</OText>
|
|
286
|
-
{order?.external_id && (
|
|
314
|
+
{order?.external_id && !showExternalId && (
|
|
287
315
|
<OText size={13}>
|
|
288
316
|
<OText size={13} weight='bold'>{`${t('EXTERNAL_ID', 'External ID :')} `}</OText>
|
|
289
317
|
{order?.external_id}
|
|
@@ -25,13 +25,13 @@ export const Logo = styled.View`
|
|
|
25
25
|
|
|
26
26
|
export const OrderContent = styled.View`
|
|
27
27
|
flex: 1;
|
|
28
|
-
${(props
|
|
28
|
+
${(props: any) => props.isOrderGroup && css`
|
|
29
29
|
border-color: rgba(0, 0, 0, 0.2);
|
|
30
30
|
border-width: 1px;
|
|
31
31
|
padding: 10px;
|
|
32
32
|
`
|
|
33
33
|
}
|
|
34
|
-
${(props
|
|
34
|
+
${(props: any) => props.lastOrder && css`
|
|
35
35
|
margin-bottom: 50px;
|
|
36
36
|
`}
|
|
37
37
|
`;
|
|
@@ -68,7 +68,28 @@ export const Table = styled.View`
|
|
|
68
68
|
|
|
69
69
|
export const OrderBill = styled.View`
|
|
70
70
|
padding-vertical: 20px;
|
|
71
|
-
|
|
71
|
+
${(props: any) => !props.vehicleExists && css`
|
|
72
|
+
padding-bottom: 50px;
|
|
73
|
+
`
|
|
74
|
+
}
|
|
75
|
+
flex: 1;
|
|
76
|
+
`;
|
|
77
|
+
|
|
78
|
+
export const OrderVehicle = styled.View`
|
|
79
|
+
border-top-width: 1px;
|
|
80
|
+
border-top-color: ${(props: any) => props.theme.colors.borderTops};
|
|
81
|
+
padding-vertical: 20px;
|
|
82
|
+
padding-bottom: 50px;
|
|
83
|
+
flex: 1;
|
|
84
|
+
`;
|
|
85
|
+
|
|
86
|
+
export const OrderSpot = styled.View`
|
|
87
|
+
border-top-width: 1px;
|
|
88
|
+
border-top-color: ${(props: any) => props.theme.colors.borderTops};
|
|
89
|
+
padding-vertical: 20px;
|
|
90
|
+
${(props: any) => !props.vehicleExists && css`
|
|
91
|
+
padding-bottom: 50px;
|
|
92
|
+
`}
|
|
72
93
|
flex: 1;
|
|
73
94
|
`;
|
|
74
95
|
|
|
@@ -98,3 +119,18 @@ export const OSRow = styled.View`
|
|
|
98
119
|
width: 70%;
|
|
99
120
|
flex-wrap: wrap;
|
|
100
121
|
`
|
|
122
|
+
|
|
123
|
+
export const Messages = styled.View`
|
|
124
|
+
position: relative;
|
|
125
|
+
`;
|
|
126
|
+
|
|
127
|
+
export const Dot = styled.View`
|
|
128
|
+
position: absolute;
|
|
129
|
+
width: 8px;
|
|
130
|
+
height: 8px;
|
|
131
|
+
border-radius: 4px;
|
|
132
|
+
background-color: ${(props: any) => props.theme.colors.red};
|
|
133
|
+
top: 10px;
|
|
134
|
+
right: 10px;
|
|
135
|
+
z-index: 99;
|
|
136
|
+
`;
|