ordering-ui-react-native 0.19.2-testing → 0.19.3-release
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +6 -5
- package/src/DeliveryApp.tsx +43 -1
- package/src/components/BusinessInformation/index.tsx +10 -9
- package/src/components/BusinessesListing/index.tsx +1 -1
- package/src/components/VerifyPhone/styles.tsx +1 -2
- package/src/components/shared/OToast.tsx +3 -2
- package/src/utils/index.tsx +2 -2
- package/themes/business/index.tsx +2 -0
- package/themes/business/src/components/AcceptOrRejectOrder/index.tsx +9 -2
- package/themes/business/src/components/BusinessController/index.tsx +19 -17
- package/themes/business/src/components/BusinessProductList/AccordionDropdown.tsx +63 -0
- package/themes/business/src/components/BusinessProductList/IterateCategories.tsx +108 -0
- package/themes/business/src/components/BusinessProductList/ProductList.tsx +196 -0
- package/themes/business/src/components/BusinessProductList/index.tsx +196 -0
- package/themes/business/src/components/BusinessProductList/styles.tsx +10 -0
- package/themes/business/src/components/Chat/index.tsx +41 -13
- package/themes/business/src/components/DriverMap/index.tsx +4 -2
- package/themes/business/src/components/DriverSchedule/index.tsx +5 -5
- package/themes/business/src/components/FloatingButton/index.tsx +34 -31
- package/themes/business/src/components/MapView/index.tsx +11 -7
- package/themes/business/src/components/MessagesOption/index.tsx +22 -94
- package/themes/business/src/components/NewOrderNotification/index.tsx +121 -103
- package/themes/business/src/components/OrderDetails/Delivery.tsx +19 -10
- package/themes/business/src/components/OrderDetails/OrderContentComponent.tsx +88 -51
- package/themes/business/src/components/OrderDetails/OrderHeaderComponent.tsx +26 -6
- package/themes/business/src/components/OrderDetailsLogistic/index.tsx +6 -1
- package/themes/business/src/components/OrderSummary/index.tsx +27 -13
- package/themes/business/src/components/OrdersListManager/index.tsx +7 -2
- package/themes/business/src/components/OrdersListManager/utils.tsx +1 -1
- package/themes/business/src/components/OrdersOption/index.tsx +83 -37
- package/themes/business/src/components/PreviousMessages/FooterMessageComponent.tsx +103 -0
- package/themes/business/src/components/PreviousMessages/index.tsx +97 -55
- package/themes/business/src/components/PreviousOrders/OrderItem.tsx +24 -31
- package/themes/business/src/components/PreviousOrders/OrderList.tsx +93 -0
- package/themes/business/src/components/PreviousOrders/OrdersGroupedItem.tsx +1 -1
- package/themes/business/src/components/PreviousOrders/index.tsx +192 -220
- package/themes/business/src/components/PreviousOrders/styles.tsx +10 -0
- package/themes/business/src/components/ReviewCustomer/index.tsx +2 -0
- package/themes/business/src/components/SearchBar/index.tsx +2 -1
- package/themes/business/src/components/StoresList/index.tsx +5 -3
- package/themes/business/src/components/UserProfileForm/index.tsx +27 -10
- package/themes/business/src/components/WebsocketStatus/index.tsx +171 -0
- package/themes/business/src/components/WebsocketStatus/styles.tsx +28 -0
- package/themes/business/src/types/index.tsx +10 -0
- package/themes/doordash/src/components/BusinessesListing/index.tsx +1 -1
- package/themes/doordash/src/components/LoginForm/index.tsx +1 -2
- package/themes/instacart/src/components/BusinessesListing/index.tsx +1 -1
- package/themes/kiosk/src/components/Checkout/index.tsx +6 -0
- package/themes/kiosk/src/components/LoginForm/index.tsx +124 -96
- 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 +7 -3
- package/themes/original/src/components/AddressForm/index.tsx +2 -2
- package/themes/original/src/components/AddressForm/styles.tsx +1 -1
- package/themes/original/src/components/AddressList/index.tsx +4 -7
- package/themes/original/src/components/AddressList/styles.tsx +4 -4
- package/themes/original/src/components/AppleLogin/index.tsx +4 -4
- package/themes/original/src/components/BusinessBasicInformation/index.tsx +3 -3
- package/themes/original/src/components/BusinessBasicInformation/styles.tsx +1 -1
- package/themes/original/src/components/BusinessController/index.tsx +9 -6
- package/themes/original/src/components/BusinessController/styles.tsx +8 -7
- package/themes/original/src/components/BusinessInformation/index.tsx +35 -3
- package/themes/original/src/components/BusinessInformation/styles.tsx +2 -2
- package/themes/original/src/components/BusinessItemAccordion/index.tsx +11 -7
- package/themes/original/src/components/BusinessListingSearch/BusinessSearchFooter.tsx +317 -0
- package/themes/original/src/components/BusinessListingSearch/BusinessSearchHeader.tsx +96 -0
- package/themes/original/src/components/BusinessListingSearch/MaxSectionItem/index.tsx +1 -1
- package/themes/original/src/components/BusinessListingSearch/index.tsx +56 -361
- package/themes/original/src/components/BusinessListingSearch/styles.tsx +1 -1
- package/themes/original/src/components/BusinessPreorder/index.tsx +3 -4
- package/themes/original/src/components/BusinessProductsCategories/index.tsx +1 -1
- package/themes/original/src/components/BusinessProductsList/index.tsx +2 -2
- package/themes/original/src/components/BusinessProductsList/styles.tsx +0 -3
- package/themes/original/src/components/BusinessProductsListing/index.tsx +43 -19
- package/themes/original/src/components/BusinessProductsListing/styles.tsx +3 -4
- package/themes/original/src/components/BusinessReviews/index.tsx +1 -1
- package/themes/original/src/components/BusinessesListing/Layout/Appointment/index.tsx +1 -1
- package/themes/original/src/components/BusinessesListing/Layout/Appointment/styles.tsx +5 -5
- package/themes/original/src/components/BusinessesListing/Layout/Original/FlatListBusinessListFooter.tsx +69 -0
- package/themes/original/src/components/BusinessesListing/Layout/Original/FlatListBusinessListHeader.tsx +406 -0
- package/themes/original/src/components/BusinessesListing/Layout/Original/FlatListBusinessListing.tsx +76 -0
- package/themes/original/src/components/BusinessesListing/Layout/Original/index.tsx +29 -402
- 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 +27 -8
- package/themes/original/src/components/CartContent/index.tsx +61 -39
- package/themes/original/src/components/CartStoresListing/styles.tsx +2 -2
- package/themes/original/src/components/Checkout/index.tsx +199 -55
- package/themes/original/src/components/Checkout/styles.tsx +17 -0
- package/themes/original/src/components/CitiesControl/styles.tsx +1 -1
- package/themes/original/src/components/DatePicker/index.tsx +17 -0
- package/themes/original/src/components/DatePicker/styles.tsx +20 -0
- package/themes/original/src/components/Favorite/index.tsx +4 -9
- package/themes/original/src/components/Favorite/styles.tsx +0 -2
- package/themes/original/src/components/FloatingButton/styles.tsx +1 -1
- package/themes/original/src/components/GPSButton/index.tsx +1 -1
- package/themes/original/src/components/GiftCard/GiftCardUI/index.tsx +8 -3
- package/themes/original/src/components/GiftCard/PurchaseGiftCard/index.tsx +36 -3
- package/themes/original/src/components/GiftCard/PurchaseGiftCard/styles.tsx +1 -1
- package/themes/original/src/components/GiftCard/RedeemGiftCard/index.tsx +67 -4
- package/themes/original/src/components/GiftCard/RedeemGiftCard/styles.tsx +1 -1
- package/themes/original/src/components/GiftCard/SendGiftCard/index.tsx +2 -2
- package/themes/original/src/components/GiftCard/SendGiftCard/styles.tsx +1 -1
- package/themes/original/src/components/GoogleMap/index.tsx +50 -5
- package/themes/original/src/components/HighestRatedBusinesses/index.tsx +2 -2
- package/themes/original/src/components/HighestRatedBusinesses/styles.tsx +1 -1
- package/themes/original/src/components/Home/index.tsx +1 -1
- package/themes/original/src/components/LastOrder/index.tsx +2 -1
- package/themes/original/src/components/LastOrders/index.tsx +2 -1
- package/themes/original/src/components/LoginForm/Otp/index.tsx +53 -47
- package/themes/original/src/components/LoginForm/index.tsx +6 -1
- package/themes/original/src/components/Messages/index.tsx +9 -4
- package/themes/original/src/components/Messages/styles.tsx +1 -1
- package/themes/original/src/components/MomentOption/index.tsx +4 -4
- package/themes/original/src/components/MomentSelector/index.tsx +1 -1
- package/themes/original/src/components/MultiCart/index.tsx +1 -1
- package/themes/original/src/components/MultiCartsPaymethodsAndWallets/index.tsx +13 -4
- package/themes/original/src/components/MultiCheckout/index.tsx +184 -51
- package/themes/original/src/components/MultiOrdersDetails/index.tsx +1 -1
- package/themes/original/src/components/MyOrders/index.tsx +5 -5
- package/themes/original/src/components/NavBar/index.tsx +3 -1
- package/themes/original/src/components/NetworkError/index.tsx +2 -3
- package/themes/original/src/components/NetworkError/styles.tsx +2 -2
- package/themes/original/src/components/Notifications/index.tsx +4 -8
- package/themes/original/src/components/Notifications/styles.tsx +0 -1
- package/themes/original/src/components/OrderDetails/OrderHistory.tsx +7 -3
- package/themes/original/src/components/OrderDetails/index.tsx +716 -667
- package/themes/original/src/components/OrderDetails/styles.tsx +24 -8
- package/themes/original/src/components/OrderProgress/index.tsx +7 -7
- package/themes/original/src/components/OrderProgress/styles.tsx +1 -1
- package/themes/original/src/components/OrderSummary/index.tsx +5 -3
- package/themes/original/src/components/OrderTypeSelector/index.tsx +5 -6
- package/themes/original/src/components/OrdersOption/PreviousBusinessOrdered/styles.tsx +1 -1
- package/themes/original/src/components/OrdersOption/PreviousProductsOrdered/styles.tsx +1 -1
- package/themes/original/src/components/OrdersOption/index.tsx +4 -3
- package/themes/original/src/components/OrdersOption/styles.tsx +1 -1
- package/themes/original/src/components/PageBanner/index.tsx +3 -0
- package/themes/original/src/components/PaymentOptionStripe/styles.tsx +3 -0
- package/themes/original/src/components/PaymentOptionWallet/index.tsx +56 -56
- package/themes/original/src/components/PaymentOptions/index.tsx +41 -32
- package/themes/original/src/components/PhoneInputNumber/index.tsx +15 -1
- package/themes/original/src/components/ProductForm/ActionButton.tsx +120 -0
- package/themes/original/src/components/ProductForm/ExtraOptions.tsx +56 -0
- package/themes/original/src/components/ProductForm/index.tsx +81 -167
- package/themes/original/src/components/ProductForm/styles.tsx +1 -1
- package/themes/original/src/components/ProductItemAccordion/index.tsx +5 -0
- package/themes/original/src/components/ProductOptionSubOption/index.tsx +120 -79
- package/themes/original/src/components/ProductOptionSubOption/styles.tsx +10 -9
- package/themes/original/src/components/ProfessionalProfile/styles.tsx +3 -3
- package/themes/original/src/components/Promotions/index.tsx +4 -4
- package/themes/original/src/components/Promotions/styles.tsx +0 -2
- package/themes/original/src/components/ReviewDriver/styles.tsx +1 -1
- package/themes/original/src/components/ReviewOrder/styles.tsx +1 -1
- package/themes/original/src/components/ReviewProducts/styles.tsx +1 -1
- package/themes/original/src/components/ServiceForm/index.tsx +2 -2
- package/themes/original/src/components/ServiceForm/styles.tsx +4 -4
- package/themes/original/src/components/SingleOrderCard/index.tsx +4 -3
- package/themes/original/src/components/SingleProductCard/styles.tsx +0 -3
- package/themes/original/src/components/StripeCardsList/index.tsx +53 -7
- package/themes/original/src/components/StripeElementsForm/index.tsx +1 -1
- package/themes/original/src/components/StripeElementsForm/naked.tsx +12 -1
- package/themes/original/src/components/UpsellingProducts/UpsellingContent.tsx +170 -0
- package/themes/original/src/components/UpsellingProducts/UpsellingLayout.tsx +86 -0
- package/themes/original/src/components/UpsellingProducts/index.tsx +15 -199
- package/themes/original/src/components/UpsellingProducts/styles.tsx +19 -0
- package/themes/original/src/components/UserFormDetails/index.tsx +53 -7
- package/themes/original/src/components/UserProfile/index.tsx +1 -1
- package/themes/original/src/components/UserProfileForm/index.tsx +30 -36
- package/themes/original/src/components/UserVerification/index.tsx +55 -50
- package/themes/original/src/components/WalletTransactions/styles.tsx +1 -0
- package/themes/original/src/components/Wallets/index.tsx +8 -9
- package/themes/original/src/components/Wallets/styles.tsx +1 -1
- package/themes/original/src/components/shared/HeaderTitle.tsx +1 -1
- package/themes/original/src/components/shared/OInput.tsx +1 -4
- package/themes/original/src/components/shared/OModal.tsx +12 -14
- package/themes/original/src/layouts/Container.tsx +5 -3
- package/themes/original/src/types/index.tsx +10 -2
- package/themes/original/src/utils/index.tsx +124 -0
- package/themes/uber-eats/src/components/BusinessesListing/index.tsx +1 -1
- package/src/navigators/BottomNavigator.tsx +0 -117
- package/src/navigators/CheckoutNavigator.tsx +0 -66
- package/src/navigators/HomeNavigator.tsx +0 -202
- package/src/navigators/NavigationRef.tsx +0 -7
- package/src/navigators/RootNavigator.tsx +0 -269
- package/src/pages/Account.tsx +0 -34
- package/src/pages/AddressForm.tsx +0 -62
- package/src/pages/AddressList.tsx +0 -24
- package/src/pages/BusinessProductsList.tsx +0 -81
- package/src/pages/BusinessesListing.tsx +0 -43
- package/src/pages/CartList.tsx +0 -49
- package/src/pages/Checkout.tsx +0 -101
- package/src/pages/ForgotPassword.tsx +0 -24
- package/src/pages/Help.tsx +0 -23
- package/src/pages/HelpAccountAndPayment.tsx +0 -23
- package/src/pages/HelpGuide.tsx +0 -23
- package/src/pages/HelpOrder.tsx +0 -23
- package/src/pages/Home.tsx +0 -36
- package/src/pages/IntroductoryTutorial.tsx +0 -170
- package/src/pages/Login.tsx +0 -47
- package/src/pages/MomentOption.tsx +0 -30
- package/src/pages/MultiCheckout.tsx +0 -31
- package/src/pages/MultiOrdersDetails.tsx +0 -27
- package/src/pages/MyOrders.tsx +0 -40
- package/src/pages/NetworkError.tsx +0 -24
- package/src/pages/NotFound.tsx +0 -22
- package/src/pages/OrderDetails.tsx +0 -25
- package/src/pages/ProductDetails.tsx +0 -55
- package/src/pages/Profile.tsx +0 -36
- package/src/pages/ReviewDriver.tsx +0 -30
- package/src/pages/ReviewOrder.tsx +0 -32
- package/src/pages/ReviewProducts.tsx +0 -30
- package/src/pages/Sessions.tsx +0 -22
- package/src/pages/Signup.tsx +0 -53
- package/src/pages/SpinnerLoader.tsx +0 -10
- package/src/pages/Splash.tsx +0 -21
|
@@ -1,13 +1,16 @@
|
|
|
1
1
|
import React, { useState, useEffect, useMemo } from 'react';
|
|
2
|
-
import { View, StyleSheet, BackHandler, Platform, Linking, RefreshControl } from 'react-native';
|
|
2
|
+
import { View, StyleSheet, BackHandler, Platform, Linking, RefreshControl, SafeAreaView } from 'react-native';
|
|
3
3
|
import LinearGradient from 'react-native-linear-gradient';
|
|
4
|
+
import IconAntDesign from 'react-native-vector-icons/AntDesign';
|
|
4
5
|
import { _setStoreData } from '../../providers/StoreUtil';
|
|
5
6
|
import {
|
|
6
7
|
useLanguage,
|
|
7
8
|
OrderDetails as OrderDetailsConTableoller,
|
|
8
9
|
useUtils,
|
|
9
10
|
useOrder,
|
|
10
|
-
useConfig
|
|
11
|
+
useConfig,
|
|
12
|
+
useToast,
|
|
13
|
+
ToastType
|
|
11
14
|
} from 'ordering-components/native';
|
|
12
15
|
import { useTheme } from 'styled-components/native';
|
|
13
16
|
import { showLocation } from 'react-native-map-link';
|
|
@@ -33,14 +36,16 @@ import {
|
|
|
33
36
|
Divider,
|
|
34
37
|
OrderAction,
|
|
35
38
|
PlaceSpotWrapper,
|
|
36
|
-
ProfessionalPhoto
|
|
39
|
+
ProfessionalPhoto,
|
|
40
|
+
TopHeader,
|
|
41
|
+
TopActions
|
|
37
42
|
} from './styles';
|
|
38
43
|
import { OButton, OIcon, OModal, OText } from '../shared';
|
|
39
44
|
import { ProductItemAccordion } from '../ProductItemAccordion';
|
|
40
45
|
import { TouchableOpacity } from 'react-native-gesture-handler';
|
|
41
46
|
import { OrderDetailsParams } from '../../types';
|
|
42
47
|
import { GoogleMap } from '../GoogleMap';
|
|
43
|
-
import { verifyDecimals, getOrderStatus } from '../../utils';
|
|
48
|
+
import { verifyDecimals, getOrderStatus, getOrderStatuPickUp } from '../../utils';
|
|
44
49
|
import { OSRow } from '../OrderSummary/styles';
|
|
45
50
|
import AntIcon from 'react-native-vector-icons/AntDesign'
|
|
46
51
|
import { TaxInformation } from '../TaxInformation';
|
|
@@ -65,7 +70,7 @@ export const OrderDetailsUI = (props: OrderDetailsParams) => {
|
|
|
65
70
|
} = props;
|
|
66
71
|
|
|
67
72
|
const theme = useTheme();
|
|
68
|
-
|
|
73
|
+
const [, { showToast }] = useToast()
|
|
69
74
|
const styles = StyleSheet.create({
|
|
70
75
|
rowDirection: {
|
|
71
76
|
flexDirection: 'row',
|
|
@@ -104,6 +109,10 @@ export const OrderDetailsUI = (props: OrderDetailsParams) => {
|
|
|
104
109
|
borderBottomWidth: 1,
|
|
105
110
|
marginVertical: 10,
|
|
106
111
|
paddingVertical: 5
|
|
112
|
+
},
|
|
113
|
+
wrapperNavbar: {
|
|
114
|
+
paddingHorizontal: 20,
|
|
115
|
+
paddingTop: 0,
|
|
107
116
|
}
|
|
108
117
|
});
|
|
109
118
|
|
|
@@ -117,11 +126,15 @@ export const OrderDetailsUI = (props: OrderDetailsParams) => {
|
|
|
117
126
|
const [isOrderHistory, setIsOrderHistory] = useState(false)
|
|
118
127
|
const [openTaxModal, setOpenTaxModal] = useState<any>({ open: false, tax: null, type: '' })
|
|
119
128
|
const [refreshing] = useState(false);
|
|
129
|
+
const [showTitle, setShowTitle] = useState(false)
|
|
130
|
+
|
|
120
131
|
const { order, businessData } = props.order;
|
|
121
132
|
const mapValidStatuses = [9, 19, 23]
|
|
122
133
|
const placeSpotTypes = [3, 4, 5]
|
|
123
134
|
const directionTypes = [2, 3, 4, 5]
|
|
124
135
|
const activeStatus = [0, 3, 4, 7, 8, 9, 13, 14, 18, 19, 20, 21, 22, 23]
|
|
136
|
+
const reorderStatus = [1, 2, 5, 6, 10, 11, 12]
|
|
137
|
+
const [isPickup, setIsPickup] = useState(order?.delivery_type === 2)
|
|
125
138
|
const enabledPoweredByOrdering = configs?.powered_by_ordering_module?.value
|
|
126
139
|
const isGiftCardOrder = !order?.business_id
|
|
127
140
|
const hideDeliveryDate = theme?.confirmation?.components?.order?.components?.date?.hidden
|
|
@@ -135,6 +148,7 @@ export const OrderDetailsUI = (props: OrderDetailsParams) => {
|
|
|
135
148
|
const hideDriverMessages = theme?.confirmation?.components?.driver?.components?.messages?.hidden
|
|
136
149
|
const hideCustomerPhone = theme?.confirmation?.components?.customer?.components?.phone?.hidden
|
|
137
150
|
const hideCustomerAddress = theme?.confirmation?.components?.customer?.components?.address?.hidden
|
|
151
|
+
const progressBarObjt = isPickup ? getOrderStatuPickUp : getOrderStatus
|
|
138
152
|
const walletName: any = {
|
|
139
153
|
cash: {
|
|
140
154
|
name: t('PAY_WITH_CASH_WALLET', 'Pay with Cash Wallet'),
|
|
@@ -217,6 +231,10 @@ export const OrderDetailsUI = (props: OrderDetailsParams) => {
|
|
|
217
231
|
getOrder()
|
|
218
232
|
}
|
|
219
233
|
|
|
234
|
+
const handleScroll = ({ nativeEvent: { contentOffset } }: any) => {
|
|
235
|
+
setShowTitle(contentOffset.y > 30)
|
|
236
|
+
}
|
|
237
|
+
|
|
220
238
|
useEffect(() => {
|
|
221
239
|
const _businessId = 'businessId:' + businessData?.id
|
|
222
240
|
if (reorderState?.error) {
|
|
@@ -336,158 +354,66 @@ export const OrderDetailsUI = (props: OrderDetailsParams) => {
|
|
|
336
354
|
}
|
|
337
355
|
}, [driverLocation]);
|
|
338
356
|
|
|
357
|
+
useEffect(() => {
|
|
358
|
+
if (props?.order?.error && !props?.order?.loading) {
|
|
359
|
+
showToast(ToastType.Error, props?.order?.error)
|
|
360
|
+
navigation.navigate('BusinessList')
|
|
361
|
+
}
|
|
362
|
+
}, [props?.order?.error, props?.order?.loading])
|
|
363
|
+
|
|
364
|
+
|
|
365
|
+
useEffect(() => {
|
|
366
|
+
if (!order?.delivery_type) return
|
|
367
|
+
setIsPickup(order?.delivery_type === 2)
|
|
368
|
+
}, [order?.delivery_type])
|
|
369
|
+
|
|
339
370
|
return (
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
>
|
|
349
|
-
{(!order || Object.keys(order).length === 0) && (
|
|
350
|
-
<Placeholder style={{ marginTop: 30 }}>
|
|
351
|
-
<Header>
|
|
352
|
-
<OrderInfo>
|
|
353
|
-
<OrderData>
|
|
354
|
-
<PlaceholderLine width={60} height={15} />
|
|
355
|
-
<PlaceholderLine width={60} height={10} />
|
|
356
|
-
<StaturBar>
|
|
357
|
-
<PlaceholderLine height={15} />
|
|
358
|
-
<PlaceholderLine width={40} height={20} />
|
|
359
|
-
</StaturBar>
|
|
360
|
-
</OrderData>
|
|
361
|
-
<View
|
|
362
|
-
style={{
|
|
363
|
-
height: 8,
|
|
364
|
-
backgroundColor: theme.colors.backgroundGray100,
|
|
365
|
-
marginTop: 18,
|
|
366
|
-
marginHorizontal: -40,
|
|
367
|
-
}}
|
|
371
|
+
<>
|
|
372
|
+
<View style={styles.wrapperNavbar}>
|
|
373
|
+
<TopHeader>
|
|
374
|
+
<>
|
|
375
|
+
<TopActions onPress={() => handleArrowBack()}>
|
|
376
|
+
<IconAntDesign
|
|
377
|
+
name='arrowleft'
|
|
378
|
+
size={26}
|
|
368
379
|
/>
|
|
369
|
-
</
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
<View
|
|
381
|
-
style={{
|
|
382
|
-
height: 8,
|
|
383
|
-
backgroundColor: theme.colors.backgroundGray100,
|
|
384
|
-
marginTop: 18,
|
|
385
|
-
marginHorizontal: -40,
|
|
386
|
-
}}
|
|
387
|
-
/>
|
|
388
|
-
<OrderCustomer>
|
|
389
|
-
<PlaceholderLine width={20} height={20} />
|
|
390
|
-
<PlaceholderLine width={70} height={15} />
|
|
391
|
-
<PlaceholderLine width={65} height={10} />
|
|
392
|
-
<PlaceholderLine width={80} height={10} />
|
|
393
|
-
<PlaceholderLine width={70} height={10} />
|
|
394
|
-
<View style={{ marginTop: 10 }}>
|
|
395
|
-
<PlaceholderLine width={60} height={20} />
|
|
396
|
-
<PlaceholderLine width={40} height={10} />
|
|
397
|
-
</View>
|
|
398
|
-
</OrderCustomer>
|
|
399
|
-
</Placeholder>
|
|
400
|
-
)}
|
|
401
|
-
{order && Object.keys(order).length > 0 && (
|
|
402
|
-
<>
|
|
403
|
-
<Header>
|
|
404
|
-
<NavBar
|
|
405
|
-
title={`${t('ORDER', 'Order')} #${order?.id}`}
|
|
406
|
-
titleAlign={'center'}
|
|
407
|
-
onActionLeft={handleArrowBack}
|
|
408
|
-
showCall={false}
|
|
409
|
-
btnStyle={{ paddingLeft: 0 }}
|
|
410
|
-
style={{ marginTop: Platform.OS === 'ios' ? 0 : 20 }}
|
|
411
|
-
titleWrapStyle={{ paddingHorizontal: 0 }}
|
|
412
|
-
titleStyle={{ marginRight: 0, marginLeft: 0 }}
|
|
413
|
-
subTitle={!hideDeliveryDate && <OText size={12} lineHeight={18} color={theme.colors.textNormal}>
|
|
414
|
-
{activeStatus.includes(order?.status) ? (
|
|
415
|
-
<OrderEta order={order} />
|
|
416
|
-
) : (
|
|
417
|
-
parseDate(order?.reporting_data?.at[`status:${order.status}`])
|
|
418
|
-
)}
|
|
419
|
-
</OText>}
|
|
420
|
-
/>
|
|
421
|
-
{enabledPoweredByOrdering && (
|
|
422
|
-
<View style={{ display: 'flex', justifyContent: 'center', alignItems: 'center' }}>
|
|
423
|
-
<OText>
|
|
424
|
-
Powered By Ordering.co
|
|
425
|
-
</OText>
|
|
426
|
-
</View>
|
|
380
|
+
</TopActions>
|
|
381
|
+
{showTitle && (
|
|
382
|
+
<OText
|
|
383
|
+
size={16}
|
|
384
|
+
style={{ flex: 1, textAlign: 'center', right: 15 }}
|
|
385
|
+
weight={Platform.OS === 'ios' ? '600' : 'bold'}
|
|
386
|
+
numberOfLines={2}
|
|
387
|
+
ellipsizeMode='tail'
|
|
388
|
+
>
|
|
389
|
+
{`${t('ORDER', 'Order')} #${order?.id}`}
|
|
390
|
+
</OText>
|
|
427
391
|
)}
|
|
428
|
-
|
|
392
|
+
</>
|
|
393
|
+
</TopHeader>
|
|
394
|
+
</View>
|
|
395
|
+
<OrderDetailsContainer
|
|
396
|
+
keyboardShouldPersistTaps="handled"
|
|
397
|
+
refreshControl={
|
|
398
|
+
<RefreshControl
|
|
399
|
+
refreshing={refreshing}
|
|
400
|
+
onRefresh={() => resfreshOrder()}
|
|
401
|
+
/>
|
|
402
|
+
}
|
|
403
|
+
onScroll={handleScroll}
|
|
404
|
+
>
|
|
405
|
+
|
|
406
|
+
{(!order || Object.keys(order).length === 0) && (
|
|
407
|
+
<Placeholder style={{ marginTop: 30 }}>
|
|
408
|
+
<Header>
|
|
429
409
|
<OrderInfo>
|
|
430
410
|
<OrderData>
|
|
431
|
-
<
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
) && !order.review && !isReviewed && (
|
|
438
|
-
<TouchableOpacity
|
|
439
|
-
activeOpacity={0.7}
|
|
440
|
-
style={{ marginTop: 6, marginRight: 10 }}
|
|
441
|
-
onPress={() => handleClickOrderReview(order)}
|
|
442
|
-
>
|
|
443
|
-
<OText
|
|
444
|
-
size={12}
|
|
445
|
-
lineHeight={15}
|
|
446
|
-
color={theme.colors.primary}
|
|
447
|
-
style={{ textDecorationLine: 'underline' }}
|
|
448
|
-
>
|
|
449
|
-
{t('REVIEW_YOUR_ORDER', 'Review your order')}
|
|
450
|
-
</OText>
|
|
451
|
-
</TouchableOpacity>
|
|
452
|
-
)}
|
|
453
|
-
<TouchableOpacity
|
|
454
|
-
activeOpacity={0.7}
|
|
455
|
-
style={{ marginTop: 6 }}
|
|
456
|
-
onPress={() => setIsOrderHistory(true)}
|
|
457
|
-
>
|
|
458
|
-
<OText
|
|
459
|
-
size={12}
|
|
460
|
-
lineHeight={15}
|
|
461
|
-
color={theme.colors.primary}
|
|
462
|
-
style={{ textDecorationLine: 'underline', textTransform: 'capitalize' }}
|
|
463
|
-
>
|
|
464
|
-
{t('VIEW_DETAILS', 'View Details')}
|
|
465
|
-
</OText>
|
|
466
|
-
</TouchableOpacity>
|
|
467
|
-
</View>
|
|
468
|
-
{!hideDeliveryProgress && (
|
|
469
|
-
<>
|
|
470
|
-
<StaturBar>
|
|
471
|
-
<LinearGradient
|
|
472
|
-
start={{ x: 0.0, y: 0.0 }}
|
|
473
|
-
end={{
|
|
474
|
-
x: getOrderStatus(order?.status)?.percentage || 0,
|
|
475
|
-
y: 0,
|
|
476
|
-
}}
|
|
477
|
-
locations={[0.9999, 0.9999]}
|
|
478
|
-
colors={[theme.colors.primary, theme.colors.backgroundGray100]}
|
|
479
|
-
style={styles.statusBar}
|
|
480
|
-
/>
|
|
481
|
-
</StaturBar>
|
|
482
|
-
<OText
|
|
483
|
-
size={16}
|
|
484
|
-
lineHeight={24}
|
|
485
|
-
weight={'600'}
|
|
486
|
-
color={theme.colors.textNormal}>
|
|
487
|
-
{getOrderStatus(order?.status)?.value}
|
|
488
|
-
</OText>
|
|
489
|
-
</>
|
|
490
|
-
)}
|
|
411
|
+
<PlaceholderLine width={60} height={15} />
|
|
412
|
+
<PlaceholderLine width={60} height={10} />
|
|
413
|
+
<StaturBar>
|
|
414
|
+
<PlaceholderLine height={15} />
|
|
415
|
+
<PlaceholderLine width={40} height={20} />
|
|
416
|
+
</StaturBar>
|
|
491
417
|
</OrderData>
|
|
492
418
|
<View
|
|
493
419
|
style={{
|
|
@@ -498,124 +424,16 @@ export const OrderDetailsUI = (props: OrderDetailsParams) => {
|
|
|
498
424
|
}}
|
|
499
425
|
/>
|
|
500
426
|
</OrderInfo>
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
<OrderContent>
|
|
504
|
-
{!isGiftCardOrder && (
|
|
427
|
+
</Header>
|
|
428
|
+
<OrderContent>
|
|
505
429
|
<OrderBusiness>
|
|
506
|
-
<
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
mBottom={12}>
|
|
512
|
-
{t('FROM', 'From')}
|
|
513
|
-
</OText>
|
|
514
|
-
<View
|
|
515
|
-
style={{
|
|
516
|
-
display: 'flex',
|
|
517
|
-
flexDirection: 'column',
|
|
518
|
-
alignItems: 'flex-start',
|
|
519
|
-
}}>
|
|
520
|
-
<View
|
|
521
|
-
style={{
|
|
522
|
-
flexDirection: 'row',
|
|
523
|
-
alignItems: 'center',
|
|
524
|
-
justifyContent: 'space-between',
|
|
525
|
-
}}>
|
|
526
|
-
<OText
|
|
527
|
-
size={13}
|
|
528
|
-
lineHeight={20}
|
|
529
|
-
color={theme.colors.textNormal}
|
|
530
|
-
style={{ flexGrow: 1, flexBasis: '80%' }}>
|
|
531
|
-
{order?.business?.name}
|
|
532
|
-
</OText>
|
|
533
|
-
<Icons>
|
|
534
|
-
{!!order?.business?.cellphone && !hideBusinessPhone && (
|
|
535
|
-
<TouchableOpacity
|
|
536
|
-
onPress={() => order?.business?.cellphone &&
|
|
537
|
-
Linking.openURL(`tel:${order?.business?.cellphone}`)
|
|
538
|
-
}
|
|
539
|
-
style={{ paddingEnd: 5 }}
|
|
540
|
-
>
|
|
541
|
-
<OIcon
|
|
542
|
-
src={theme.images.general.phone}
|
|
543
|
-
width={16}
|
|
544
|
-
color={theme.colors.disabled}
|
|
545
|
-
/>
|
|
546
|
-
</TouchableOpacity>
|
|
547
|
-
)}
|
|
548
|
-
{!hideBusinessMessages && (
|
|
549
|
-
<TouchableOpacity
|
|
550
|
-
style={{ paddingStart: 5 }}
|
|
551
|
-
onPress={() => handleGoToMessages('business')}>
|
|
552
|
-
<OIcon
|
|
553
|
-
src={theme.images.general.chat}
|
|
554
|
-
width={16}
|
|
555
|
-
color={theme.colors.disabled}
|
|
556
|
-
/>
|
|
557
|
-
</TouchableOpacity>
|
|
558
|
-
)}
|
|
559
|
-
</Icons>
|
|
560
|
-
</View>
|
|
561
|
-
{!hideBusinessEmail && (
|
|
562
|
-
<OText
|
|
563
|
-
size={12}
|
|
564
|
-
lineHeight={18}
|
|
565
|
-
color={theme.colors.textNormal}
|
|
566
|
-
mBottom={2}>
|
|
567
|
-
{order?.business?.email}
|
|
568
|
-
</OText>
|
|
569
|
-
)}
|
|
570
|
-
{!!order?.business?.cellphone && !hideBusinessPhone && (
|
|
571
|
-
<OText
|
|
572
|
-
size={12}
|
|
573
|
-
lineHeight={18}
|
|
574
|
-
color={theme.colors.textNormal}
|
|
575
|
-
mBottom={2}>
|
|
576
|
-
{order?.business?.cellphone}
|
|
577
|
-
</OText>
|
|
578
|
-
)}
|
|
579
|
-
{!hideBusinessAddress && (
|
|
580
|
-
<OText size={12} lineHeight={18} color={theme.colors.textNormal}>
|
|
581
|
-
{order?.business?.address}
|
|
582
|
-
</OText>
|
|
583
|
-
)}
|
|
584
|
-
</View>
|
|
585
|
-
{directionTypes.includes(order?.delivery_type) && (
|
|
586
|
-
<OButton
|
|
587
|
-
text={t('GET_DIRECTIONS', 'Get Directions')}
|
|
588
|
-
imgRightSrc=''
|
|
589
|
-
textStyle={{ color: theme.colors.white }}
|
|
590
|
-
style={{
|
|
591
|
-
alignSelf: 'center',
|
|
592
|
-
borderRadius: 10,
|
|
593
|
-
marginTop: 30
|
|
594
|
-
}}
|
|
595
|
-
onClick={() => showLocation({
|
|
596
|
-
latitude: order?.business?.location?.lat,
|
|
597
|
-
longitude: order?.business?.location?.lng,
|
|
598
|
-
naverCallerName: 'com.reactnativeappstemplate5',
|
|
599
|
-
dialogTitle: t('GET_DIRECTIONS', 'Get Directions'),
|
|
600
|
-
dialogMessage: t('WHAT_APP_WOULD_YOU_USE', 'What app would you like to use?'),
|
|
601
|
-
cancelText: t('CANCEL', 'Cancel'),
|
|
602
|
-
})}
|
|
603
|
-
/>
|
|
604
|
-
)}
|
|
430
|
+
<PlaceholderLine width={30} height={20} />
|
|
431
|
+
<PlaceholderLine width={60} height={15} />
|
|
432
|
+
<PlaceholderLine width={75} height={10} />
|
|
433
|
+
<PlaceholderLine width={40} height={10} />
|
|
434
|
+
<PlaceholderLine width={95} height={10} />
|
|
605
435
|
</OrderBusiness>
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
{!isGiftCardOrder && placeSpotTypes.includes(order?.delivery_type) && (
|
|
609
|
-
<PlaceSpotWrapper>
|
|
610
|
-
<PlaceSpot
|
|
611
|
-
isInputMode
|
|
612
|
-
cart={order}
|
|
613
|
-
spotNumberDefault={order?.spot_number}
|
|
614
|
-
vehicleDefault={order?.vehicle}
|
|
615
|
-
/>
|
|
616
|
-
</PlaceSpotWrapper>
|
|
617
|
-
)}
|
|
618
|
-
|
|
436
|
+
</OrderContent>
|
|
619
437
|
<View
|
|
620
438
|
style={{
|
|
621
439
|
height: 8,
|
|
@@ -625,172 +443,403 @@ export const OrderDetailsUI = (props: OrderDetailsParams) => {
|
|
|
625
443
|
}}
|
|
626
444
|
/>
|
|
627
445
|
<OrderCustomer>
|
|
628
|
-
<
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
{
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
446
|
+
<PlaceholderLine width={20} height={20} />
|
|
447
|
+
<PlaceholderLine width={70} height={15} />
|
|
448
|
+
<PlaceholderLine width={65} height={10} />
|
|
449
|
+
<PlaceholderLine width={80} height={10} />
|
|
450
|
+
<PlaceholderLine width={70} height={10} />
|
|
451
|
+
<View style={{ marginTop: 10 }}>
|
|
452
|
+
<PlaceholderLine width={60} height={20} />
|
|
453
|
+
<PlaceholderLine width={40} height={10} />
|
|
454
|
+
</View>
|
|
455
|
+
</OrderCustomer>
|
|
456
|
+
</Placeholder>
|
|
457
|
+
)}
|
|
458
|
+
{order && Object.keys(order).length > 0 && (
|
|
459
|
+
<>
|
|
460
|
+
<Header>
|
|
461
|
+
<NavBar
|
|
462
|
+
hideArrowLeft
|
|
463
|
+
title={`${t('ORDER', 'Order')} #${order?.id}`}
|
|
464
|
+
titleAlign={'center'}
|
|
465
|
+
showCall={false}
|
|
466
|
+
btnStyle={{ paddingLeft: 0 }}
|
|
467
|
+
style={{ marginTop: Platform.OS === 'ios' ? 0 : 20 }}
|
|
468
|
+
titleWrapStyle={{ paddingHorizontal: 0 }}
|
|
469
|
+
titleStyle={{ marginRight: 0, marginLeft: 0 }}
|
|
470
|
+
subTitle={!hideDeliveryDate && <OText size={12} lineHeight={18} color={theme.colors.textNormal}>
|
|
471
|
+
{activeStatus.includes(order?.status) ? (
|
|
472
|
+
<OrderEta order={order} />
|
|
473
|
+
) : (
|
|
474
|
+
parseDate(order?.reporting_data?.at[`status:${order.status}`])
|
|
475
|
+
)}
|
|
476
|
+
</OText>}
|
|
477
|
+
/>
|
|
478
|
+
{enabledPoweredByOrdering && (
|
|
479
|
+
<View style={{ display: 'flex', justifyContent: 'center', alignItems: 'center' }}>
|
|
480
|
+
<OText>
|
|
481
|
+
Powered By Ordering.co
|
|
482
|
+
</OText>
|
|
483
|
+
</View>
|
|
484
|
+
)}
|
|
485
|
+
{!isGiftCardOrder && (
|
|
486
|
+
<OrderInfo>
|
|
487
|
+
<OrderData>
|
|
488
|
+
<View style={styles.linkWrapper}>
|
|
489
|
+
{
|
|
490
|
+
(
|
|
491
|
+
parseInt(order?.status) === 1 ||
|
|
492
|
+
parseInt(order?.status) === 11 ||
|
|
493
|
+
parseInt(order?.status) === 15
|
|
494
|
+
) && !order.review && !isReviewed && (
|
|
495
|
+
<TouchableOpacity
|
|
496
|
+
activeOpacity={0.7}
|
|
497
|
+
style={{ marginTop: 6, marginRight: 10 }}
|
|
498
|
+
onPress={() => handleClickOrderReview(order)}
|
|
499
|
+
>
|
|
500
|
+
<OText
|
|
501
|
+
size={12}
|
|
502
|
+
lineHeight={15}
|
|
503
|
+
color={theme.colors.primary}
|
|
504
|
+
style={{ textDecorationLine: 'underline' }}
|
|
505
|
+
>
|
|
506
|
+
{t('REVIEW_YOUR_ORDER', 'Review your order')}
|
|
507
|
+
</OText>
|
|
508
|
+
</TouchableOpacity>
|
|
509
|
+
)}
|
|
510
|
+
<TouchableOpacity
|
|
511
|
+
activeOpacity={0.7}
|
|
512
|
+
style={{ marginTop: 6 }}
|
|
513
|
+
onPress={() => setIsOrderHistory(true)}
|
|
514
|
+
>
|
|
515
|
+
<OText
|
|
516
|
+
size={12}
|
|
517
|
+
lineHeight={15}
|
|
518
|
+
color={theme.colors.primary}
|
|
519
|
+
style={{ textDecorationLine: 'underline', textTransform: 'capitalize' }}
|
|
520
|
+
>
|
|
521
|
+
{t('VIEW_DETAILS', 'View Details')}
|
|
522
|
+
</OText>
|
|
523
|
+
</TouchableOpacity>
|
|
524
|
+
</View>
|
|
525
|
+
{!hideDeliveryProgress && (
|
|
526
|
+
<>
|
|
527
|
+
<StaturBar>
|
|
528
|
+
<LinearGradient
|
|
529
|
+
start={{ x: 0.0, y: 0.0 }}
|
|
530
|
+
end={{
|
|
531
|
+
x: progressBarObjt(order?.status)?.percentage || 0,
|
|
532
|
+
y: 0,
|
|
533
|
+
}}
|
|
534
|
+
locations={[0.9999, 0.9999]}
|
|
535
|
+
colors={[theme.colors.primary, theme.colors.backgroundGray100]}
|
|
536
|
+
style={styles.statusBar}
|
|
537
|
+
/>
|
|
538
|
+
</StaturBar>
|
|
539
|
+
<OText
|
|
540
|
+
size={16}
|
|
541
|
+
lineHeight={24}
|
|
542
|
+
weight={'600'}
|
|
543
|
+
color={theme.colors.textNormal}>
|
|
544
|
+
{progressBarObjt(order?.status)?.value}
|
|
545
|
+
</OText>
|
|
546
|
+
</>
|
|
547
|
+
)}
|
|
548
|
+
</OrderData>
|
|
549
|
+
<View
|
|
550
|
+
style={{
|
|
551
|
+
height: 8,
|
|
552
|
+
backgroundColor: theme.colors.backgroundGray100,
|
|
553
|
+
marginTop: 18,
|
|
554
|
+
marginHorizontal: -40,
|
|
555
|
+
}}
|
|
556
|
+
/>
|
|
557
|
+
</OrderInfo>
|
|
558
|
+
)}
|
|
559
|
+
</Header>
|
|
560
|
+
<OrderContent>
|
|
561
|
+
{!isGiftCardOrder && (
|
|
562
|
+
<OrderBusiness>
|
|
638
563
|
<OText
|
|
639
|
-
size={
|
|
640
|
-
lineHeight={
|
|
564
|
+
size={16}
|
|
565
|
+
lineHeight={24}
|
|
566
|
+
weight={'500'}
|
|
641
567
|
color={theme.colors.textNormal}
|
|
642
|
-
mBottom={
|
|
643
|
-
{
|
|
568
|
+
mBottom={12}>
|
|
569
|
+
{t('FROM', 'From')}
|
|
644
570
|
</OText>
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
571
|
+
<View
|
|
572
|
+
style={{
|
|
573
|
+
display: 'flex',
|
|
574
|
+
flexDirection: 'column',
|
|
575
|
+
alignItems: 'flex-start',
|
|
576
|
+
}}>
|
|
577
|
+
<View
|
|
578
|
+
style={{
|
|
579
|
+
flexDirection: 'row',
|
|
580
|
+
alignItems: 'center',
|
|
581
|
+
justifyContent: 'space-between',
|
|
582
|
+
}}>
|
|
583
|
+
<OText
|
|
584
|
+
size={13}
|
|
585
|
+
lineHeight={20}
|
|
586
|
+
color={theme.colors.textNormal}
|
|
587
|
+
style={{ flexGrow: 1, flexBasis: '80%' }}>
|
|
588
|
+
{order?.business?.name}
|
|
589
|
+
</OText>
|
|
590
|
+
<Icons>
|
|
591
|
+
{!!order?.business?.cellphone && !hideBusinessPhone && (
|
|
592
|
+
<TouchableOpacity
|
|
593
|
+
onPress={() => order?.business?.cellphone &&
|
|
594
|
+
Linking.openURL(`tel:${order?.business?.cellphone}`)
|
|
595
|
+
}
|
|
596
|
+
style={{ paddingEnd: 5 }}
|
|
597
|
+
>
|
|
598
|
+
<OIcon
|
|
599
|
+
src={theme.images.general.phone}
|
|
600
|
+
width={16}
|
|
601
|
+
color={theme.colors.disabled}
|
|
602
|
+
/>
|
|
603
|
+
</TouchableOpacity>
|
|
604
|
+
)}
|
|
605
|
+
{!hideBusinessMessages && (
|
|
606
|
+
<TouchableOpacity
|
|
607
|
+
style={{ paddingStart: 5 }}
|
|
608
|
+
onPress={() => handleGoToMessages('business')}>
|
|
609
|
+
<OIcon
|
|
610
|
+
src={theme.images.general.chat}
|
|
611
|
+
width={16}
|
|
612
|
+
color={theme.colors.disabled}
|
|
613
|
+
/>
|
|
614
|
+
</TouchableOpacity>
|
|
615
|
+
)}
|
|
616
|
+
</Icons>
|
|
617
|
+
</View>
|
|
618
|
+
{!hideBusinessEmail && (
|
|
619
|
+
<OText
|
|
620
|
+
size={12}
|
|
621
|
+
lineHeight={18}
|
|
622
|
+
color={theme.colors.textNormal}
|
|
623
|
+
mBottom={2}>
|
|
624
|
+
{order?.business?.email}
|
|
625
|
+
</OText>
|
|
626
|
+
)}
|
|
627
|
+
{!!order?.business?.cellphone && !hideBusinessPhone && (
|
|
628
|
+
<OText
|
|
629
|
+
size={12}
|
|
630
|
+
lineHeight={18}
|
|
631
|
+
color={theme.colors.textNormal}
|
|
632
|
+
mBottom={2}>
|
|
633
|
+
{order?.business?.cellphone}
|
|
634
|
+
</OText>
|
|
635
|
+
)}
|
|
636
|
+
{!hideBusinessAddress && (
|
|
637
|
+
<OText size={12} lineHeight={18} color={theme.colors.textNormal}>
|
|
638
|
+
{order?.business?.address}
|
|
639
|
+
</OText>
|
|
640
|
+
)}
|
|
641
|
+
</View>
|
|
642
|
+
{directionTypes.includes(order?.delivery_type) && (
|
|
643
|
+
<OButton
|
|
644
|
+
text={t('GET_DIRECTIONS', 'Get Directions')}
|
|
645
|
+
imgRightSrc=''
|
|
646
|
+
textStyle={{ color: theme.colors.white }}
|
|
647
|
+
style={{
|
|
648
|
+
alignSelf: 'center',
|
|
649
|
+
borderRadius: 10,
|
|
650
|
+
marginTop: 30
|
|
651
|
+
}}
|
|
652
|
+
onClick={() => showLocation({
|
|
653
|
+
latitude: order?.business?.location?.lat,
|
|
654
|
+
longitude: order?.business?.location?.lng,
|
|
655
|
+
naverCallerName: 'com.reactnativeappstemplate5',
|
|
656
|
+
dialogTitle: t('GET_DIRECTIONS', 'Get Directions'),
|
|
657
|
+
dialogMessage: t('WHAT_APP_WOULD_YOU_USE', 'What app would you like to use?'),
|
|
658
|
+
cancelText: t('CANCEL', 'Cancel'),
|
|
659
|
+
})}
|
|
660
|
+
/>
|
|
653
661
|
)}
|
|
654
|
-
|
|
662
|
+
</OrderBusiness>
|
|
663
|
+
)}
|
|
664
|
+
|
|
665
|
+
{!isGiftCardOrder && placeSpotTypes.includes(order?.delivery_type) && (
|
|
666
|
+
<PlaceSpotWrapper>
|
|
667
|
+
<PlaceSpot
|
|
668
|
+
isInputMode
|
|
669
|
+
cart={order}
|
|
670
|
+
spotNumberDefault={order?.spot_number}
|
|
671
|
+
vehicleDefault={order?.vehicle}
|
|
672
|
+
/>
|
|
673
|
+
</PlaceSpotWrapper>
|
|
674
|
+
)}
|
|
675
|
+
|
|
676
|
+
<View
|
|
677
|
+
style={{
|
|
678
|
+
height: 8,
|
|
679
|
+
backgroundColor: theme.colors.backgroundGray100,
|
|
680
|
+
marginTop: 18,
|
|
681
|
+
marginHorizontal: -40,
|
|
682
|
+
}}
|
|
683
|
+
/>
|
|
684
|
+
<OrderCustomer>
|
|
685
|
+
<OText
|
|
686
|
+
size={16}
|
|
687
|
+
lineHeight={24}
|
|
688
|
+
weight={'500'}
|
|
689
|
+
color={theme.colors.textNormal}
|
|
690
|
+
mBottom={12}>
|
|
691
|
+
{isGiftCardOrder ? t('CUSTOMER', 'Customer') : t('TO', 'To')}
|
|
692
|
+
</OText>
|
|
693
|
+
<Customer>
|
|
694
|
+
<InfoBlock>
|
|
655
695
|
<OText
|
|
656
696
|
size={12}
|
|
657
697
|
lineHeight={18}
|
|
658
698
|
color={theme.colors.textNormal}
|
|
659
699
|
mBottom={2}>
|
|
660
|
-
{
|
|
700
|
+
{order?.customer?.name} {order?.customer?.lastname}
|
|
661
701
|
</OText>
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
{order?.
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
</
|
|
682
|
-
|
|
702
|
+
{!hideCustomerAddress && (
|
|
703
|
+
<OText
|
|
704
|
+
size={12}
|
|
705
|
+
lineHeight={18}
|
|
706
|
+
color={theme.colors.textNormal}
|
|
707
|
+
mBottom={2}>
|
|
708
|
+
{order?.customer?.address}
|
|
709
|
+
</OText>
|
|
710
|
+
)}
|
|
711
|
+
{(!!order?.customer?.cellphone && !hideCustomerPhone) && (
|
|
712
|
+
<OText
|
|
713
|
+
size={12}
|
|
714
|
+
lineHeight={18}
|
|
715
|
+
color={theme.colors.textNormal}
|
|
716
|
+
mBottom={2}>
|
|
717
|
+
{`${!!order?.customer?.country_phone_code ? '+' + order?.customer?.country_phone_code : ''} ${order?.customer?.cellphone}`}
|
|
718
|
+
</OText>
|
|
719
|
+
)}
|
|
720
|
+
</InfoBlock>
|
|
721
|
+
</Customer>
|
|
722
|
+
{!isGiftCardOrder && order?.delivery_option !== undefined && order?.delivery_type === 1 && (
|
|
723
|
+
<View style={{ marginTop: 15 }}>
|
|
724
|
+
<OText size={16} style={{ textAlign: 'left' }} color={theme.colors.textNormal}>
|
|
725
|
+
{t('DELIVERY_PREFERENCE', 'Delivery Preference')}
|
|
726
|
+
</OText>
|
|
727
|
+
<OText size={12} style={{ textAlign: 'left' }} color={theme.colors.textNormal}>
|
|
728
|
+
{order?.delivery_option?.name ? t(order?.delivery_option?.name.toUpperCase().replace(/\s/g, '_')) : t('EITHER_WAY', 'Either way')}
|
|
729
|
+
</OText>
|
|
730
|
+
</View>
|
|
731
|
+
)}
|
|
732
|
+
{!!order?.comment && (
|
|
733
|
+
<View style={{ marginTop: 15 }}>
|
|
734
|
+
<OText size={16} style={{ textAlign: 'left' }} color={theme.colors.textNormal}>
|
|
735
|
+
{t('COMMENT', 'Comment')}
|
|
736
|
+
</OText>
|
|
737
|
+
<OText size={12} style={{ textAlign: 'left' }} color={theme.colors.textNormal}>{order?.comment}</OText>
|
|
738
|
+
</View>
|
|
739
|
+
)}
|
|
740
|
+
{order?.driver && (
|
|
741
|
+
<>
|
|
742
|
+
{order?.driver?.location && mapValidStatuses.includes(parseInt(order?.status)) && (
|
|
743
|
+
<Map>
|
|
744
|
+
<GoogleMap
|
|
745
|
+
location={typeof order?.driver?.location?.location === 'string'
|
|
746
|
+
? {
|
|
747
|
+
lat: parseFloat(driverLocationString[0]),
|
|
748
|
+
lng: parseFloat(driverLocationString[1]),
|
|
749
|
+
} : driverLocation ?? order?.driver?.location
|
|
750
|
+
}
|
|
751
|
+
locations={parsedLocations}
|
|
752
|
+
readOnly
|
|
753
|
+
/>
|
|
754
|
+
</Map>
|
|
755
|
+
)}
|
|
756
|
+
</>
|
|
757
|
+
)}
|
|
758
|
+
</OrderCustomer>
|
|
683
759
|
{order?.driver && (
|
|
684
760
|
<>
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
{order?.driver?.name} {order?.driver?.lastname}
|
|
761
|
+
<View
|
|
762
|
+
style={{
|
|
763
|
+
height: 8,
|
|
764
|
+
backgroundColor: theme.colors.backgroundGray100,
|
|
765
|
+
marginTop: 18,
|
|
766
|
+
marginHorizontal: -40,
|
|
767
|
+
}}
|
|
768
|
+
/>
|
|
769
|
+
<OrderDriver>
|
|
770
|
+
<OText size={16} lineHeight={24} weight={'500'} style={{ marginBottom: 10 }}>{t('YOUR_DRIVER', 'Your Driver')}</OText>
|
|
771
|
+
<Customer>
|
|
772
|
+
<InfoBlock>
|
|
773
|
+
<View
|
|
774
|
+
style={{
|
|
775
|
+
flexDirection: 'row',
|
|
776
|
+
alignItems: 'center',
|
|
777
|
+
justifyContent: 'space-between',
|
|
778
|
+
}}>
|
|
779
|
+
{!hideDriverName && (
|
|
780
|
+
<OText size={12} lineHeight={18} color={theme.colors.textNormal} mBottom={2} style={{ flexGrow: 1, flexBasis: '80%' }}>
|
|
781
|
+
{order?.driver?.name} {order?.driver?.lastname}
|
|
782
|
+
</OText>
|
|
783
|
+
)}
|
|
784
|
+
{!hideDriverMessages && (
|
|
785
|
+
<Icons>
|
|
786
|
+
<TouchableOpacity
|
|
787
|
+
onPress={() => handleGoToMessages('driver')}>
|
|
788
|
+
<OIcon
|
|
789
|
+
src={theme.images.general.chat}
|
|
790
|
+
width={16}
|
|
791
|
+
color={theme.colors.disabled}
|
|
792
|
+
/>
|
|
793
|
+
</TouchableOpacity>
|
|
794
|
+
</Icons>
|
|
795
|
+
)}
|
|
796
|
+
</View>
|
|
797
|
+
{!hideDriverPhone && (
|
|
798
|
+
<OText size={12} lineHeight={18} color={theme.colors.textNormal} mBottom={2}>
|
|
799
|
+
{order?.driver?.cellphone}
|
|
725
800
|
</OText>
|
|
726
801
|
)}
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
<OText color={theme.colors.textNormal} size={14} weight={'500'}>
|
|
769
|
-
{t(
|
|
770
|
-
'ORDER_MESSAGE_HEADER_TEXT',
|
|
771
|
-
'Once business accepts your order, we will send you an email, thank you!',
|
|
772
|
-
)}
|
|
773
|
-
</OText>
|
|
774
|
-
<OrderAction>
|
|
775
|
-
<OButton
|
|
776
|
-
text={t('YOUR_ORDERS', 'Your Orders')}
|
|
777
|
-
textStyle={{ fontSize: 14, color: theme.colors.primary }}
|
|
778
|
-
imgRightSrc={null}
|
|
779
|
-
borderColor={theme.colors.primary}
|
|
780
|
-
bgColor={theme.colors.clear}
|
|
781
|
-
style={{ borderRadius: 7.6, borderWidth: 1, height: 44, shadowOpacity: 0 }}
|
|
782
|
-
parentStyle={{ marginTop: 29, marginEnd: 15 }}
|
|
783
|
-
onClick={() => navigation.navigate('BottomTab', { screen: 'MyOrders' })}
|
|
784
|
-
/>
|
|
785
|
-
{(
|
|
786
|
-
parseInt(order?.status) === 1 ||
|
|
787
|
-
parseInt(order?.status) === 2 ||
|
|
788
|
-
parseInt(order?.status) === 5 ||
|
|
789
|
-
parseInt(order?.status) === 6 ||
|
|
790
|
-
parseInt(order?.status) === 10 ||
|
|
791
|
-
parseInt(order?.status) === 11 ||
|
|
792
|
-
parseInt(order?.status) === 12
|
|
793
|
-
) && (
|
|
802
|
+
</InfoBlock>
|
|
803
|
+
</Customer>
|
|
804
|
+
</OrderDriver>
|
|
805
|
+
</>
|
|
806
|
+
)}
|
|
807
|
+
<View
|
|
808
|
+
style={{
|
|
809
|
+
height: 8,
|
|
810
|
+
backgroundColor: theme.colors.backgroundGray100,
|
|
811
|
+
marginTop: 18,
|
|
812
|
+
marginHorizontal: -40,
|
|
813
|
+
}}
|
|
814
|
+
/>
|
|
815
|
+
<HeaderInfo>
|
|
816
|
+
<OText
|
|
817
|
+
size={24}
|
|
818
|
+
color={theme.colors.textNormal}
|
|
819
|
+
style={{ fontWeight: Platform.OS == 'ios' ? '600' : 'bold', marginBottom: 16 }}>
|
|
820
|
+
{t(
|
|
821
|
+
'YOUR_ORDER_HAS_BEEN_RECEIVED',
|
|
822
|
+
'Your Order has been received',
|
|
823
|
+
)}
|
|
824
|
+
</OText>
|
|
825
|
+
<OText color={theme.colors.textNormal} size={14} weight={'500'}>
|
|
826
|
+
{t(
|
|
827
|
+
'ORDER_MESSAGE_HEADER_TEXT',
|
|
828
|
+
'Once business accepts your order, we will send you an email, thank you!',
|
|
829
|
+
)}
|
|
830
|
+
</OText>
|
|
831
|
+
<OrderAction>
|
|
832
|
+
<OButton
|
|
833
|
+
text={t('YOUR_ORDERS', 'Your Orders')}
|
|
834
|
+
textStyle={{ fontSize: 14, color: theme.colors.primary }}
|
|
835
|
+
imgRightSrc={null}
|
|
836
|
+
borderColor={theme.colors.primary}
|
|
837
|
+
bgColor={theme.colors.clear}
|
|
838
|
+
style={{ borderRadius: 7.6, borderWidth: 1, height: 44, shadowOpacity: 0 }}
|
|
839
|
+
parentStyle={{ marginTop: 29, marginEnd: 15 }}
|
|
840
|
+
onClick={() => navigation.navigate('BottomTab', { screen: 'MyOrders' })}
|
|
841
|
+
/>
|
|
842
|
+
{(reorderStatus?.includes(parseInt(order?.status)) && order?.cart) && !isGiftCardOrder && (
|
|
794
843
|
<OButton
|
|
795
844
|
text={order.id === reorderState?.loading ? t('LOADING', 'Loading..') : t('REORDER', 'Reorder')}
|
|
796
845
|
textStyle={{ fontSize: 14, color: theme.colors.primary }}
|
|
@@ -801,282 +850,282 @@ export const OrderDetailsUI = (props: OrderDetailsParams) => {
|
|
|
801
850
|
onClick={() => handleReorder && handleReorder(order.id)}
|
|
802
851
|
/>
|
|
803
852
|
)}
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
<Table>
|
|
812
|
-
<OText size={12} lineHeight={18} weight={'400'} color={theme.colors.textNormal}>{t('SUBTOTAL', 'Subtotal')}</OText>
|
|
813
|
-
<OText size={12} lineHeight={18} weight={'400'} color={theme.colors.textNormal}>
|
|
814
|
-
{parsePrice(((order?.summary?.subtotal ?? order?.subtotal) + getIncludedTaxes()))}
|
|
815
|
-
</OText>
|
|
816
|
-
</Table>
|
|
817
|
-
{(order?.summary?.discount > 0 ?? order?.discount > 0) && order?.offers?.length === 0 && (
|
|
853
|
+
</OrderAction>
|
|
854
|
+
</HeaderInfo>
|
|
855
|
+
<OrderProducts>
|
|
856
|
+
{sortedProductList}
|
|
857
|
+
</OrderProducts>
|
|
858
|
+
<OrderBill>
|
|
859
|
+
<View style={{ height: 1, backgroundColor: theme.colors.border, marginBottom: 17 }} />
|
|
818
860
|
<Table>
|
|
819
|
-
{
|
|
820
|
-
<OText size={12} lineHeight={18} weight={'400'} color={theme.colors.textNormal}>
|
|
821
|
-
{t('DISCOUNT', 'Discount')}
|
|
822
|
-
<OText size={12} lineHeight={18} weight={'400'} color={theme.colors.textNormal}>{`(${verifyDecimals(
|
|
823
|
-
order?.offer_rate,
|
|
824
|
-
parsePrice,
|
|
825
|
-
)}%)`}</OText>
|
|
826
|
-
</OText>
|
|
827
|
-
) : (
|
|
828
|
-
<OText size={12} lineHeight={18} weight={'400'} color={theme.colors.textNormal}>{t('DISCOUNT', 'Discount')}</OText>
|
|
829
|
-
)}
|
|
861
|
+
<OText size={12} lineHeight={18} weight={'400'} color={theme.colors.textNormal}>{t('SUBTOTAL', 'Subtotal')}</OText>
|
|
830
862
|
<OText size={12} lineHeight={18} weight={'400'} color={theme.colors.textNormal}>
|
|
831
|
-
|
|
863
|
+
{parsePrice(((order?.summary?.subtotal ?? order?.subtotal) + getIncludedTaxes()))}
|
|
832
864
|
</OText>
|
|
833
865
|
</Table>
|
|
834
|
-
|
|
835
|
-
{
|
|
836
|
-
order?.offers?.length > 0 && order?.offers?.filter((offer: any) => offer?.target === 1)?.map((offer: any) => (
|
|
837
|
-
<Table key={offer.id}>
|
|
838
|
-
<OSRow>
|
|
839
|
-
<OText size={12} lineHeight={18} weight={'400'} color={theme.colors.textNormal} numberOfLines={1}>
|
|
840
|
-
{offer.name}
|
|
841
|
-
{offer.rate_type === 1 && (
|
|
842
|
-
<OText size={12} lineHeight={18} weight={'400'} color={theme.colors.textNormal}>{`(${verifyDecimals(offer?.rate, parsePrice)}%)`}</OText>
|
|
843
|
-
)}
|
|
844
|
-
</OText>
|
|
845
|
-
<TouchableOpacity style={{ marginLeft: 5 }} onPress={() => setOpenTaxModal({ open: true, data: offer, type: 'offer_target_1' })}>
|
|
846
|
-
<AntIcon name='infocirlceo' size={16} color={theme.colors.primary} />
|
|
847
|
-
</TouchableOpacity>
|
|
848
|
-
</OSRow>
|
|
849
|
-
<OText size={12} lineHeight={18} weight={'400'} color={theme.colors.textNormal}>- {parsePrice(offer?.summary?.discount)}</OText>
|
|
850
|
-
</Table>
|
|
851
|
-
))
|
|
852
|
-
}
|
|
853
|
-
{!isGiftCardOrder && (
|
|
854
|
-
<Divider />
|
|
855
|
-
)}
|
|
856
|
-
{order?.summary?.subtotal_with_discount > 0 && order?.summary?.discount > 0 && order?.summary?.total >= 0 && (
|
|
857
|
-
<Table>
|
|
858
|
-
<OText size={12} lineHeight={18} weight={'400'} color={theme.colors.textNormal}>{t('SUBTOTAL_WITH_DISCOUNT', 'Subtotal with discount')}</OText>
|
|
859
|
-
{order?.tax_type === 1 ? (
|
|
860
|
-
<OText size={12} lineHeight={18} weight={'400'} color={theme.colors.textNormal}>{parsePrice((order?.summary?.subtotal_with_discount + getIncludedTaxesDiscounts() ?? 0))}</OText>
|
|
861
|
-
) : (
|
|
862
|
-
<OText size={12} lineHeight={18} weight={'400'} color={theme.colors.textNormal}>{parsePrice(order?.summary?.subtotal_with_discount ?? 0)}</OText>
|
|
863
|
-
)}
|
|
864
|
-
</Table>
|
|
865
|
-
)}
|
|
866
|
-
{
|
|
867
|
-
order?.taxes?.length === 0 && order?.tax_type === 2 && (
|
|
866
|
+
{(order?.summary?.discount > 0 ?? order?.discount > 0) && order?.offers?.length === 0 && (
|
|
868
867
|
<Table>
|
|
868
|
+
{order?.offer_type === 1 ? (
|
|
869
|
+
<OText size={12} lineHeight={18} weight={'400'} color={theme.colors.textNormal}>
|
|
870
|
+
{t('DISCOUNT', 'Discount')}
|
|
871
|
+
<OText size={12} lineHeight={18} weight={'400'} color={theme.colors.textNormal}>{`(${verifyDecimals(
|
|
872
|
+
order?.offer_rate,
|
|
873
|
+
parsePrice,
|
|
874
|
+
)}%)`}</OText>
|
|
875
|
+
</OText>
|
|
876
|
+
) : (
|
|
877
|
+
<OText size={12} lineHeight={18} weight={'400'} color={theme.colors.textNormal}>{t('DISCOUNT', 'Discount')}</OText>
|
|
878
|
+
)}
|
|
869
879
|
<OText size={12} lineHeight={18} weight={'400'} color={theme.colors.textNormal}>
|
|
870
|
-
{
|
|
880
|
+
- {parsePrice(order?.summary?.discount || order?.discount)}
|
|
871
881
|
</OText>
|
|
872
|
-
<OText size={12} lineHeight={18} weight={'400'} color={theme.colors.textNormal}>{parsePrice(order?.summary?.tax || 0)}</OText>
|
|
873
882
|
</Table>
|
|
874
|
-
)
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
883
|
+
)}
|
|
884
|
+
{
|
|
885
|
+
order?.offers?.length > 0 && order?.offers?.filter((offer: any) => offer?.target === 1)?.map((offer: any) => (
|
|
886
|
+
<Table key={offer.id}>
|
|
887
|
+
<OSRow>
|
|
888
|
+
<OText size={12} lineHeight={18} weight={'400'} color={theme.colors.textNormal} numberOfLines={1}>
|
|
889
|
+
{offer.name}
|
|
890
|
+
{offer.rate_type === 1 && (
|
|
891
|
+
<OText size={12} lineHeight={18} weight={'400'} color={theme.colors.textNormal}>{`(${verifyDecimals(offer?.rate, parsePrice)}%)`}</OText>
|
|
892
|
+
)}
|
|
893
|
+
</OText>
|
|
894
|
+
<TouchableOpacity style={{ marginLeft: 5 }} onPress={() => setOpenTaxModal({ open: true, data: offer, type: 'offer_target_1' })}>
|
|
895
|
+
<AntIcon name='infocirlceo' size={16} color={theme.colors.primary} />
|
|
896
|
+
</TouchableOpacity>
|
|
897
|
+
</OSRow>
|
|
898
|
+
<OText size={12} lineHeight={18} weight={'400'} color={theme.colors.textNormal}>- {parsePrice(offer?.summary?.discount)}</OText>
|
|
899
|
+
</Table>
|
|
900
|
+
))
|
|
901
|
+
}
|
|
902
|
+
{!isGiftCardOrder && (
|
|
903
|
+
<Divider />
|
|
904
|
+
)}
|
|
905
|
+
{order?.summary?.subtotal_with_discount > 0 && order?.summary?.discount > 0 && order?.summary?.total >= 0 && (
|
|
878
906
|
<Table>
|
|
879
|
-
<OText size={12} lineHeight={18} weight={'400'} color={theme.colors.textNormal}>
|
|
880
|
-
|
|
881
|
-
{
|
|
882
|
-
|
|
883
|
-
|
|
907
|
+
<OText size={12} lineHeight={18} weight={'400'} color={theme.colors.textNormal}>{t('SUBTOTAL_WITH_DISCOUNT', 'Subtotal with discount')}</OText>
|
|
908
|
+
{order?.tax_type === 1 ? (
|
|
909
|
+
<OText size={12} lineHeight={18} weight={'400'} color={theme.colors.textNormal}>{parsePrice((order?.summary?.subtotal_with_discount + getIncludedTaxesDiscounts() ?? 0))}</OText>
|
|
910
|
+
) : (
|
|
911
|
+
<OText size={12} lineHeight={18} weight={'400'} color={theme.colors.textNormal}>{parsePrice(order?.summary?.subtotal_with_discount ?? 0)}</OText>
|
|
912
|
+
)}
|
|
884
913
|
</Table>
|
|
885
|
-
)
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
<OText size={12} lineHeight={18} weight={'400'} color={theme.colors.textNormal} numberOfLines={1}>
|
|
892
|
-
{tax.name || t('INHERIT_FROM_BUSINESS', 'Inherit from business')}
|
|
893
|
-
{`(${verifyDecimals(tax?.rate, parseNumber)}%)`}{' '}
|
|
914
|
+
)}
|
|
915
|
+
{
|
|
916
|
+
order?.taxes?.length === 0 && order?.tax_type === 2 && (
|
|
917
|
+
<Table>
|
|
918
|
+
<OText size={12} lineHeight={18} weight={'400'} color={theme.colors.textNormal}>
|
|
919
|
+
{t('TAX', 'Tax')} {`(${verifyDecimals(order?.tax, parseNumber)}%)`}
|
|
894
920
|
</OText>
|
|
895
|
-
<
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
<Table key={fee.id}>
|
|
906
|
-
<OSRow>
|
|
907
|
-
<OText size={12} lineHeight={18} weight={'400'} color={theme.colors.textNormal} numberOfLines={1}>
|
|
908
|
-
{fee.name || t('INHERIT_FROM_BUSINESS', 'Inherit from business')}
|
|
909
|
-
({fee?.fixed > 0 && `${parsePrice(fee?.fixed)}${fee.percentage > 0 ? ' + ' : ''}`}{fee.percentage > 0 && `${fee.percentage}%`}){' '}
|
|
921
|
+
<OText size={12} lineHeight={18} weight={'400'} color={theme.colors.textNormal}>{parsePrice(order?.summary?.tax || 0)}</OText>
|
|
922
|
+
</Table>
|
|
923
|
+
)
|
|
924
|
+
}
|
|
925
|
+
{
|
|
926
|
+
order?.fees?.length === 0 && (
|
|
927
|
+
<Table>
|
|
928
|
+
<OText size={12} lineHeight={18} weight={'400'} color={theme.colors.textNormal}>
|
|
929
|
+
{t('SERVICE_FEE', 'Service fee')}
|
|
930
|
+
{`(${verifyDecimals(order?.service_fee, parseNumber)}%)`}
|
|
910
931
|
</OText>
|
|
911
|
-
<
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
932
|
+
<OText size={12} lineHeight={18} weight={'400'} color={theme.colors.textNormal}>{parsePrice(order?.summary?.service_fee || 0)}</OText>
|
|
933
|
+
</Table>
|
|
934
|
+
)
|
|
935
|
+
}
|
|
936
|
+
{
|
|
937
|
+
order?.taxes?.length > 0 && order?.taxes?.filter((tax: any) => tax?.type === 2 && tax?.rate !== 0).map((tax: any) => (
|
|
938
|
+
<Table key={tax.id}>
|
|
939
|
+
<OSRow>
|
|
940
|
+
<OText size={12} lineHeight={18} weight={'400'} color={theme.colors.textNormal} numberOfLines={1}>
|
|
941
|
+
{tax.name || t('INHERIT_FROM_BUSINESS', 'Inherit from business')}
|
|
942
|
+
{`(${verifyDecimals(tax?.rate, parseNumber)}%)`}{' '}
|
|
943
|
+
</OText>
|
|
944
|
+
<TouchableOpacity onPress={() => setOpenTaxModal({ open: true, data: tax, type: 'tax' })}>
|
|
945
|
+
<AntIcon name='infocirlceo' size={16} color={theme.colors.primary} />
|
|
946
|
+
</TouchableOpacity>
|
|
947
|
+
</OSRow>
|
|
948
|
+
<OText size={12} lineHeight={18} weight={'400'} color={theme.colors.textNormal}>{parsePrice(tax?.summary?.tax_after_discount ?? tax?.summary?.tax ?? 0)}</OText>
|
|
949
|
+
</Table>
|
|
950
|
+
))
|
|
951
|
+
}
|
|
952
|
+
{
|
|
953
|
+
order?.fees?.length > 0 && order?.fees?.filter((fee: any) => !(fee.fixed === 0 && fee.percentage === 0))?.map((fee: any) => (
|
|
954
|
+
<Table key={fee.id}>
|
|
955
|
+
<OSRow>
|
|
956
|
+
<OText size={12} lineHeight={18} weight={'400'} color={theme.colors.textNormal} numberOfLines={1}>
|
|
957
|
+
{fee.name || t('INHERIT_FROM_BUSINESS', 'Inherit from business')}
|
|
958
|
+
({fee?.fixed > 0 && `${parsePrice(fee?.fixed)}${fee.percentage > 0 ? ' + ' : ''}`}{fee.percentage > 0 && `${fee.percentage}%`}){' '}
|
|
959
|
+
</OText>
|
|
960
|
+
<TouchableOpacity onPress={() => setOpenTaxModal({ open: true, data: fee, type: 'fee' })}>
|
|
961
|
+
<AntIcon name='infocirlceo' size={16} color={theme.colors.primary} />
|
|
962
|
+
</TouchableOpacity>
|
|
963
|
+
</OSRow>
|
|
964
|
+
<OText size={12} lineHeight={18} weight={'400'} color={theme.colors.textNormal}>{parsePrice(fee?.summary?.fixed + (fee?.summary?.percentage_after_discount ?? fee?.summary?.percentage) ?? 0)}</OText>
|
|
965
|
+
</Table>
|
|
966
|
+
))
|
|
967
|
+
}
|
|
968
|
+
{
|
|
969
|
+
order?.offers?.length > 0 && order?.offers?.filter((offer: any) => offer?.target === 3)?.map((offer: any) => (
|
|
970
|
+
<Table key={offer.id}>
|
|
971
|
+
<OSRow>
|
|
972
|
+
<OText size={12} lineHeight={18} weight={'400'} color={theme.colors.textNormal} numberOfLines={1}>
|
|
973
|
+
{offer.name}
|
|
974
|
+
{offer.rate_type === 1 && (
|
|
975
|
+
<OText>{`(${verifyDecimals(offer?.rate, parsePrice)}%)`}</OText>
|
|
976
|
+
)}
|
|
977
|
+
</OText>
|
|
978
|
+
<TouchableOpacity style={{ marginLeft: 5 }} onPress={() => setOpenTaxModal({ open: true, data: offer, type: 'offer_target_3' })}>
|
|
979
|
+
<AntIcon name='infocirlceo' size={16} color={theme.colors.primary} />
|
|
980
|
+
</TouchableOpacity>
|
|
981
|
+
</OSRow>
|
|
982
|
+
<OText size={12} lineHeight={18} weight={'400'} color={theme.colors.textNormal}>- {parsePrice(offer?.summary?.discount)}</OText>
|
|
983
|
+
</Table>
|
|
984
|
+
))
|
|
985
|
+
}
|
|
986
|
+
{typeof order?.summary?.delivery_price === 'number' && (
|
|
987
|
+
<Table>
|
|
988
|
+
<OText size={12} lineHeight={18} weight={'400'} color={theme.colors.textNormal}>{t('DELIVERY_FEE', 'Delivery Fee')}</OText>
|
|
989
|
+
<OText size={12} lineHeight={18} weight={'400'} color={theme.colors.textNormal}>{parsePrice(order?.summary?.delivery_price)}</OText>
|
|
916
990
|
</Table>
|
|
917
|
-
)
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
991
|
+
)}
|
|
992
|
+
{
|
|
993
|
+
order?.offers?.length > 0 && order?.offers?.filter((offer: any) => offer?.target === 2)?.map((offer: any) => (
|
|
994
|
+
<Table key={offer.id}>
|
|
995
|
+
<OSRow>
|
|
996
|
+
<OText size={12} lineHeight={18} weight={'400'} color={theme.colors.textNormal} numberOfLines={1}>
|
|
997
|
+
{offer.name}
|
|
998
|
+
{offer.rate_type === 1 && (
|
|
999
|
+
<OText size={12} lineHeight={18} weight={'400'} color={theme.colors.textNormal}>{`(${verifyDecimals(offer?.rate, parsePrice)}%)`}</OText>
|
|
1000
|
+
)}
|
|
1001
|
+
</OText>
|
|
1002
|
+
<TouchableOpacity style={{ marginLeft: 5 }} onPress={() => setOpenTaxModal({ open: true, data: offer, type: 'offer_target_2' })}>
|
|
1003
|
+
<AntIcon name='infocirlceo' size={16} color={theme.colors.primary} />
|
|
1004
|
+
</TouchableOpacity>
|
|
1005
|
+
</OSRow>
|
|
1006
|
+
<OText size={12} lineHeight={18} weight={'400'} color={theme.colors.textNormal}>- {parsePrice(offer?.summary?.discount)}</OText>
|
|
1007
|
+
</Table>
|
|
1008
|
+
))
|
|
1009
|
+
}
|
|
1010
|
+
{order?.summary?.driver_tip > 0 && (
|
|
1011
|
+
<Table>
|
|
1012
|
+
<OText size={12} lineHeight={18} weight={'400'} color={theme.colors.textNormal}>
|
|
1013
|
+
{t('DRIVER_TIP', 'Driver tip')}
|
|
1014
|
+
{order?.summary?.driver_tip > 0 &&
|
|
1015
|
+
parseInt(configs?.driver_tip_type?.value, 10) === 2 &&
|
|
1016
|
+
!parseInt(configs?.driver_tip_use_custom?.value, 10) &&
|
|
1017
|
+
(
|
|
1018
|
+
`(${verifyDecimals(order?.summary?.driver_tip, parseNumber)}%)`
|
|
927
1019
|
)}
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
<AntIcon name='infocirlceo' size={16} color={theme.colors.primary} />
|
|
931
|
-
</TouchableOpacity>
|
|
932
|
-
</OSRow>
|
|
933
|
-
<OText size={12} lineHeight={18} weight={'400'} color={theme.colors.textNormal}>- {parsePrice(offer?.summary?.discount)}</OText>
|
|
1020
|
+
</OText>
|
|
1021
|
+
<OText size={12} lineHeight={18} weight={'400'} color={theme.colors.textNormal}>{parsePrice(order?.summary?.driver_tip ?? order?.totalDriverTip)}</OText>
|
|
934
1022
|
</Table>
|
|
935
|
-
)
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
)}
|
|
943
|
-
{
|
|
944
|
-
order?.offers?.length > 0 && order?.offers?.filter((offer: any) => offer?.target === 2)?.map((offer: any) => (
|
|
945
|
-
<Table key={offer.id}>
|
|
946
|
-
<OSRow>
|
|
947
|
-
<OText size={12} lineHeight={18} weight={'400'} color={theme.colors.textNormal} numberOfLines={1}>
|
|
948
|
-
{offer.name}
|
|
949
|
-
{offer.rate_type === 1 && (
|
|
950
|
-
<OText size={12} lineHeight={18} weight={'400'} color={theme.colors.textNormal}>{`(${verifyDecimals(offer?.rate, parsePrice)}%)`}</OText>
|
|
951
|
-
)}
|
|
952
|
-
</OText>
|
|
953
|
-
<TouchableOpacity style={{ marginLeft: 5 }} onPress={() => setOpenTaxModal({ open: true, data: offer, type: 'offer_target_2' })}>
|
|
954
|
-
<AntIcon name='infocirlceo' size={16} color={theme.colors.primary} />
|
|
955
|
-
</TouchableOpacity>
|
|
956
|
-
</OSRow>
|
|
957
|
-
<OText size={12} lineHeight={18} weight={'400'} color={theme.colors.textNormal}>- {parsePrice(offer?.summary?.discount)}</OText>
|
|
1023
|
+
)}
|
|
1024
|
+
<Total>
|
|
1025
|
+
<Table>
|
|
1026
|
+
<OText size={14} style={{ fontWeight: 'bold' }} color={theme.colors.textNormal}>{t('TOTAL', 'Total')}</OText>
|
|
1027
|
+
<OText size={14} style={{ fontWeight: 'bold' }} color={theme.colors.textNormal}>
|
|
1028
|
+
{parsePrice(order?.summary?.total ?? order?.total)}
|
|
1029
|
+
</OText>
|
|
958
1030
|
</Table>
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
)}
|
|
971
|
-
</OText>
|
|
972
|
-
<OText size={12} lineHeight={18} weight={'400'} color={theme.colors.textNormal}>{parsePrice(order?.summary?.driver_tip ?? order?.totalDriverTip)}</OText>
|
|
973
|
-
</Table>
|
|
974
|
-
)}
|
|
975
|
-
<Total>
|
|
976
|
-
<Table>
|
|
977
|
-
<OText size={14} style={{ fontWeight: 'bold' }} color={theme.colors.textNormal}>{t('TOTAL', 'Total')}</OText>
|
|
978
|
-
<OText size={14} style={{ fontWeight: 'bold' }} color={theme.colors.textNormal}>
|
|
979
|
-
{parsePrice(order?.summary?.total ?? order?.total)}
|
|
980
|
-
</OText>
|
|
981
|
-
</Table>
|
|
982
|
-
</Total>
|
|
983
|
-
{order?.payment_events?.length > 0 && (
|
|
984
|
-
<View style={{ marginTop: 10 }}>
|
|
985
|
-
<OText size={20} weight='bold' color={theme.colors.textNormal}>{t('PAYMENTS', 'Payments')}</OText>
|
|
986
|
-
<View
|
|
987
|
-
style={{
|
|
988
|
-
width: '100%',
|
|
989
|
-
marginTop: 10
|
|
990
|
-
}}
|
|
991
|
-
>
|
|
992
|
-
{order?.payment_events?.map((event: any) => event.amount > 0 && (
|
|
993
|
-
<View
|
|
994
|
-
key={event.id}
|
|
995
|
-
style={{
|
|
996
|
-
display: 'flex',
|
|
997
|
-
flexDirection: 'row',
|
|
998
|
-
justifyContent: 'space-between',
|
|
999
|
-
alignItems: 'center',
|
|
1000
|
-
marginBottom: 10
|
|
1001
|
-
}}
|
|
1002
|
-
>
|
|
1031
|
+
</Total>
|
|
1032
|
+
{order?.payment_events?.length > 0 && (
|
|
1033
|
+
<View style={{ marginTop: 10 }}>
|
|
1034
|
+
<OText size={20} weight='bold' color={theme.colors.textNormal}>{t('PAYMENTS', 'Payments')}</OText>
|
|
1035
|
+
<View
|
|
1036
|
+
style={{
|
|
1037
|
+
width: '100%',
|
|
1038
|
+
marginTop: 10
|
|
1039
|
+
}}
|
|
1040
|
+
>
|
|
1041
|
+
{order?.payment_events?.map((event: any) => event.amount > 0 && (
|
|
1003
1042
|
<View
|
|
1043
|
+
key={event.id}
|
|
1004
1044
|
style={{
|
|
1005
1045
|
display: 'flex',
|
|
1006
|
-
flexDirection: '
|
|
1046
|
+
flexDirection: 'row',
|
|
1047
|
+
justifyContent: 'space-between',
|
|
1048
|
+
alignItems: 'center',
|
|
1049
|
+
marginBottom: 10
|
|
1007
1050
|
}}
|
|
1008
1051
|
>
|
|
1009
|
-
<
|
|
1010
|
-
{
|
|
1011
|
-
|
|
1012
|
-
:
|
|
1013
|
-
|
|
1014
|
-
|
|
1052
|
+
<View
|
|
1053
|
+
style={{
|
|
1054
|
+
display: 'flex',
|
|
1055
|
+
flexDirection: 'column',
|
|
1056
|
+
}}
|
|
1057
|
+
>
|
|
1058
|
+
<OText>
|
|
1059
|
+
{event?.wallet_event
|
|
1060
|
+
? walletName[event?.wallet_event?.wallet?.type]?.name
|
|
1061
|
+
: t(event?.paymethod?.name.toUpperCase()?.replace(/ /g, '_'), event?.paymethod?.name)}
|
|
1062
|
+
</OText>
|
|
1063
|
+
{/* {event?.data?.charge_id && (
|
|
1015
1064
|
<OText>
|
|
1016
1065
|
{`${t('CODE', 'Code')}: ${event?.data?.charge_id}`}
|
|
1017
1066
|
</OText>
|
|
1018
1067
|
)} */}
|
|
1068
|
+
</View>
|
|
1069
|
+
<OText>
|
|
1070
|
+
-{parsePrice(event.amount, { isTruncable: true })}
|
|
1071
|
+
</OText>
|
|
1019
1072
|
</View>
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
? `${configs.format_number_currency?.value} -${parseNumber(event.amount, { isTruncable: true })}`
|
|
1023
|
-
: `-${parsePrice(event.amount, { isTruncable: true })}`}
|
|
1024
|
-
</OText>
|
|
1025
|
-
</View>
|
|
1026
|
-
))}
|
|
1073
|
+
))}
|
|
1074
|
+
</View>
|
|
1027
1075
|
</View>
|
|
1028
|
-
|
|
1076
|
+
)}
|
|
1077
|
+
</OrderBill>
|
|
1078
|
+
{isGiftCardOrder && order?.products[0]?.gift_card?.status === 'pending' && !isGiftCardSent && (
|
|
1079
|
+
<>
|
|
1080
|
+
<View
|
|
1081
|
+
style={{
|
|
1082
|
+
height: 8,
|
|
1083
|
+
backgroundColor: theme.colors.backgroundGray100,
|
|
1084
|
+
marginTop: 10,
|
|
1085
|
+
marginHorizontal: -40,
|
|
1086
|
+
marginBottom: 20
|
|
1087
|
+
}}
|
|
1088
|
+
/>
|
|
1089
|
+
<SendGiftCard
|
|
1090
|
+
giftCardId={order?.products[0]?.gift_card?.id}
|
|
1091
|
+
setIsGiftCardSent={setIsGiftCardSent}
|
|
1092
|
+
/>
|
|
1093
|
+
</>
|
|
1029
1094
|
)}
|
|
1030
|
-
</
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
</>
|
|
1047
|
-
)}
|
|
1048
|
-
</OrderContent>
|
|
1049
|
-
</>
|
|
1050
|
-
)}
|
|
1051
|
-
<OModal
|
|
1052
|
-
open={openTaxModal.open}
|
|
1053
|
-
onClose={() => setOpenTaxModal({ open: false, data: null, type: '' })}
|
|
1054
|
-
entireModal
|
|
1055
|
-
>
|
|
1056
|
-
<TaxInformation
|
|
1057
|
-
type={openTaxModal.type}
|
|
1058
|
-
data={openTaxModal.data}
|
|
1059
|
-
products={order?.products}
|
|
1060
|
-
/>
|
|
1061
|
-
</OModal>
|
|
1062
|
-
<OModal
|
|
1063
|
-
open={isOrderHistory}
|
|
1064
|
-
onClose={() => setIsOrderHistory(false)}
|
|
1065
|
-
entireModal
|
|
1066
|
-
>
|
|
1067
|
-
<OrderHistory
|
|
1068
|
-
order={order}
|
|
1069
|
-
messages={messages}
|
|
1070
|
-
enableReview={(
|
|
1071
|
-
parseInt(order?.status) === 1 ||
|
|
1072
|
-
parseInt(order?.status) === 11 ||
|
|
1073
|
-
parseInt(order?.status) === 15
|
|
1074
|
-
) && !order.review && !isReviewed}
|
|
1095
|
+
</OrderContent>
|
|
1096
|
+
</>
|
|
1097
|
+
)}
|
|
1098
|
+
<OModal
|
|
1099
|
+
open={openTaxModal.open}
|
|
1100
|
+
onClose={() => setOpenTaxModal({ open: false, data: null, type: '' })}
|
|
1101
|
+
entireModal
|
|
1102
|
+
>
|
|
1103
|
+
<TaxInformation
|
|
1104
|
+
type={openTaxModal.type}
|
|
1105
|
+
data={openTaxModal.data}
|
|
1106
|
+
products={order?.products}
|
|
1107
|
+
/>
|
|
1108
|
+
</OModal>
|
|
1109
|
+
<OModal
|
|
1110
|
+
open={isOrderHistory}
|
|
1075
1111
|
onClose={() => setIsOrderHistory(false)}
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
|
|
1112
|
+
entireModal
|
|
1113
|
+
>
|
|
1114
|
+
<OrderHistory
|
|
1115
|
+
order={order}
|
|
1116
|
+
hideViaText={props.hideViaText}
|
|
1117
|
+
messages={messages}
|
|
1118
|
+
enableReview={(
|
|
1119
|
+
parseInt(order?.status) === 1 ||
|
|
1120
|
+
parseInt(order?.status) === 11 ||
|
|
1121
|
+
parseInt(order?.status) === 15
|
|
1122
|
+
) && !order.review && !isReviewed}
|
|
1123
|
+
onClose={() => setIsOrderHistory(false)}
|
|
1124
|
+
handleTriggerReview={handleTriggerReview}
|
|
1125
|
+
/>
|
|
1126
|
+
</OModal>
|
|
1127
|
+
</OrderDetailsContainer>
|
|
1128
|
+
</>
|
|
1080
1129
|
);
|
|
1081
1130
|
};
|
|
1082
1131
|
|