ordering-ui-react-native 0.18.0 → 0.18.1-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 +9 -7
- 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/OrderCreating/index.tsx +0 -20
- package/src/components/PaymentOptionsWebView/index.tsx +29 -8
- package/src/components/PhoneInputNumber/index.tsx +6 -2
- package/src/components/StripeMethodForm/index.tsx +136 -102
- package/src/components/VerifyPhone/styles.tsx +1 -2
- package/src/components/shared/OToast.tsx +3 -2
- package/src/types/index.tsx +5 -0
- package/src/utils/index.tsx +7 -2
- package/themes/business/index.tsx +4 -0
- package/themes/business/src/components/AcceptOrRejectOrder/index.tsx +36 -26
- 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 +163 -123
- package/themes/business/src/components/DriverMap/index.tsx +17 -6
- package/themes/business/src/components/DriverSchedule/index.tsx +45 -8
- package/themes/business/src/components/FloatingButton/index.tsx +34 -31
- package/themes/business/src/components/GoogleMap/index.tsx +58 -57
- package/themes/business/src/components/LoginForm/index.tsx +5 -2
- package/themes/business/src/components/MapView/index.tsx +14 -10
- package/themes/business/src/components/MessagesOption/index.tsx +22 -94
- package/themes/business/src/components/NewOrderNotification/index.tsx +123 -96
- package/themes/business/src/components/NotFoundSource/index.tsx +2 -2
- package/themes/business/src/components/OrderDetails/Business.tsx +1 -1
- package/themes/business/src/components/OrderDetails/Delivery.tsx +205 -12
- package/themes/business/src/components/OrderDetails/OrderContentComponent.tsx +91 -43
- package/themes/business/src/components/OrderDetails/OrderHeaderComponent.tsx +87 -66
- package/themes/business/src/components/OrderDetailsLogistic/index.tsx +200 -0
- package/themes/business/src/components/OrderDetailsLogistic/styles.tsx +5 -0
- package/themes/business/src/components/OrderMessage/index.tsx +19 -18
- package/themes/business/src/components/OrderSummary/index.tsx +114 -123
- 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 +60 -47
- 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 +21 -29
- 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 +198 -221
- package/themes/business/src/components/PreviousOrders/styles.tsx +10 -0
- package/themes/business/src/components/ProductItemAccordion/index.tsx +7 -1
- package/themes/business/src/components/ReviewCustomer/index.tsx +18 -13
- package/themes/business/src/components/SearchBar/index.tsx +2 -1
- package/themes/business/src/components/StoresList/index.tsx +6 -5
- package/themes/business/src/components/UserProfileForm/index.tsx +14 -15
- package/themes/business/src/components/WebsocketStatus/index.tsx +171 -0
- package/themes/business/src/components/WebsocketStatus/styles.tsx +28 -0
- package/themes/business/src/components/shared/OModal.tsx +16 -9
- package/themes/business/src/types/index.tsx +25 -10
- package/themes/business/src/utils/index.tsx +29 -2
- 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/Intro/index.tsx +16 -1
- package/themes/kiosk/src/components/LoginForm/index.tsx +7 -5
- 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/PhoneInputNumber/index.tsx +2 -2
- package/themes/kiosk/src/components/shared/OButton.tsx +5 -18
- package/themes/original/index.tsx +7 -3
- package/themes/original/src/components/AddressDetails/index.tsx +19 -3
- package/themes/original/src/components/AddressForm/index.tsx +33 -15
- package/themes/original/src/components/AddressForm/styles.tsx +1 -1
- package/themes/original/src/components/AddressList/index.tsx +5 -8
- package/themes/original/src/components/AddressList/styles.tsx +4 -4
- package/themes/original/src/components/AnalyticsSegment/index.tsx +193 -10
- package/themes/original/src/components/AppleLogin/index.tsx +4 -4
- package/themes/original/src/components/AppleLogin/styles.tsx +3 -1
- package/themes/original/src/components/BusinessBasicInformation/index.tsx +74 -38
- package/themes/original/src/components/BusinessBasicInformation/styles.tsx +11 -13
- package/themes/original/src/components/BusinessController/index.tsx +35 -44
- package/themes/original/src/components/BusinessController/styles.tsx +12 -5
- package/themes/original/src/components/BusinessFeaturedController/index.tsx +21 -54
- package/themes/original/src/components/BusinessFeaturedController/styles.tsx +8 -0
- package/themes/original/src/components/BusinessInformation/index.tsx +140 -85
- package/themes/original/src/components/BusinessInformation/styles.tsx +2 -2
- package/themes/original/src/components/BusinessItemAccordion/index.tsx +25 -26
- package/themes/original/src/components/BusinessListingSearch/MaxSectionItem/index.tsx +1 -1
- package/themes/original/src/components/BusinessListingSearch/index.tsx +346 -341
- package/themes/original/src/components/BusinessListingSearch/styles.tsx +1 -19
- package/themes/original/src/components/BusinessPreorder/index.tsx +105 -22
- package/themes/original/src/components/BusinessPreorder/styles.tsx +14 -0
- package/themes/original/src/components/BusinessProductsCategories/index.tsx +2 -3
- package/themes/original/src/components/BusinessProductsList/index.tsx +15 -7
- package/themes/original/src/components/BusinessProductsList/styles.tsx +8 -3
- package/themes/original/src/components/BusinessProductsListing/UpsellingRedirect.tsx +1 -1
- package/themes/original/src/components/BusinessProductsListing/index.tsx +162 -39
- package/themes/original/src/components/BusinessProductsListing/styles.tsx +4 -5
- package/themes/original/src/components/BusinessReviews/index.tsx +4 -2
- 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 +37 -404
- 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 +49 -47
- package/themes/original/src/components/CartContent/index.tsx +99 -38
- package/themes/original/src/components/CartContent/styles.tsx +6 -6
- package/themes/original/src/components/CartStoresListing/styles.tsx +2 -2
- package/themes/original/src/components/Checkout/index.tsx +324 -43
- package/themes/original/src/components/Checkout/styles.tsx +17 -0
- package/themes/original/src/components/CitiesControl/index.tsx +1 -1
- package/themes/original/src/components/CitiesControl/styles.tsx +1 -1
- package/themes/original/src/components/CouponControl/index.tsx +10 -3
- 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/DriverTips/index.tsx +12 -4
- package/themes/original/src/components/FacebookLogin/styles.tsx +3 -1
- 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 +7 -5
- package/themes/original/src/components/GiftCard/GiftCardUI/index.tsx +8 -3
- package/themes/original/src/components/GiftCard/PurchaseGiftCard/index.tsx +42 -5
- package/themes/original/src/components/GiftCard/PurchaseGiftCard/styles.tsx +3 -1
- package/themes/original/src/components/GiftCard/RedeemGiftCard/index.tsx +84 -8
- package/themes/original/src/components/GiftCard/RedeemGiftCard/styles.tsx +1 -1
- package/themes/original/src/components/GiftCard/SendGiftCard/styles.tsx +1 -1
- package/themes/original/src/components/GoogleLogin/styles.tsx +1 -1
- package/themes/original/src/components/GoogleMap/index.tsx +63 -7
- package/themes/original/src/components/HighestRatedBusinesses/index.tsx +1 -1
- package/themes/original/src/components/HighestRatedBusinesses/styles.tsx +1 -1
- package/themes/original/src/components/Home/index.tsx +14 -5
- 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 +91 -25
- package/themes/original/src/components/LoginForm/index.tsx +64 -34
- package/themes/original/src/components/LottieAnimation/index.tsx +88 -63
- package/themes/original/src/components/MessageListing/index.tsx +9 -2
- package/themes/original/src/components/Messages/index.tsx +15 -4
- package/themes/original/src/components/Messages/styles.tsx +1 -1
- package/themes/original/src/components/MomentOption/index.tsx +43 -38
- 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 +161 -49
- package/themes/original/src/components/MultiCheckout/index.tsx +348 -70
- package/themes/original/src/components/MultiCheckout/styles.tsx +3 -1
- package/themes/original/src/components/MultiOrdersDetails/index.tsx +2 -2
- package/themes/original/src/components/MyOrders/index.tsx +16 -5
- package/themes/original/src/components/NavBar/index.tsx +20 -13
- package/themes/original/src/components/NetworkError/styles.tsx +2 -2
- package/themes/original/src/components/NotFoundSource/index.tsx +14 -10
- package/themes/original/src/components/Notifications/index.tsx +2 -4
- package/themes/original/src/components/Notifications/styles.tsx +0 -1
- package/themes/original/src/components/OrderDetails/OrderEta.tsx +76 -0
- package/themes/original/src/components/OrderDetails/OrderHistory.tsx +22 -6
- package/themes/original/src/components/OrderDetails/index.tsx +721 -670
- package/themes/original/src/components/OrderDetails/styles.tsx +24 -8
- package/themes/original/src/components/OrderItAgain/index.tsx +3 -1
- package/themes/original/src/components/OrderProgress/index.tsx +34 -25
- package/themes/original/src/components/OrderProgress/styles.tsx +1 -1
- package/themes/original/src/components/OrderSummary/index.tsx +62 -57
- 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/index.tsx +13 -13
- package/themes/original/src/components/OrdersOption/PreviousProductsOrdered/styles.tsx +1 -1
- package/themes/original/src/components/OrdersOption/index.tsx +44 -21
- package/themes/original/src/components/OrdersOption/styles.tsx +2 -2
- package/themes/original/src/components/PageBanner/index.tsx +65 -29
- package/themes/original/src/components/PageBanner/styles.tsx +0 -3
- package/themes/original/src/components/PaymentOptionCard/index.tsx +180 -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 +100 -34
- package/themes/original/src/components/PhoneInputNumber/index.tsx +18 -4
- 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 +106 -170
- package/themes/original/src/components/ProductForm/styles.tsx +3 -3
- package/themes/original/src/components/ProductItemAccordion/index.tsx +13 -6
- package/themes/original/src/components/ProductOptionSubOption/index.tsx +49 -20
- package/themes/original/src/components/ProductOptionSubOption/styles.tsx +10 -9
- package/themes/original/src/components/ProfessionalProfile/index.tsx +35 -6
- package/themes/original/src/components/ProfessionalProfile/styles.tsx +3 -3
- package/themes/original/src/components/Promotions/index.tsx +6 -6
- package/themes/original/src/components/Promotions/styles.tsx +3 -3
- 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/index.tsx +16 -7
- package/themes/original/src/components/ReviewProducts/styles.tsx +1 -1
- package/themes/original/src/components/ScheduleAccordion/index.tsx +3 -3
- package/themes/original/src/components/ServiceForm/index.tsx +36 -24
- package/themes/original/src/components/ServiceForm/styles.tsx +4 -4
- package/themes/original/src/components/SignupForm/index.tsx +27 -16
- package/themes/original/src/components/SingleOrderCard/index.tsx +44 -20
- package/themes/original/src/components/SingleOrderCard/styles.tsx +1 -1
- package/themes/original/src/components/SingleProductCard/index.tsx +13 -10
- package/themes/original/src/components/SingleProductCard/styles.tsx +8 -3
- package/themes/original/src/components/SingleProductReview/styles.tsx +1 -1
- package/themes/original/src/components/StripeCardsList/index.tsx +61 -5
- package/themes/original/src/components/StripeElementsForm/index.tsx +48 -34
- 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 +16 -205
- package/themes/original/src/components/UpsellingProducts/styles.tsx +19 -0
- package/themes/original/src/components/UserDetails/index.tsx +3 -1
- package/themes/original/src/components/UserFormDetails/index.tsx +100 -22
- package/themes/original/src/components/UserFormDetails/styles.tsx +1 -1
- package/themes/original/src/components/UserProfile/index.tsx +8 -26
- package/themes/original/src/components/UserProfileForm/index.tsx +30 -31
- package/themes/original/src/components/UserVerification/index.tsx +55 -50
- package/themes/original/src/components/WalletTransactionItem/index.tsx +2 -2
- package/themes/original/src/components/WalletTransactions/index.tsx +3 -3
- package/themes/original/src/components/WalletTransactions/styles.tsx +1 -0
- package/themes/original/src/components/Wallets/index.tsx +48 -60
- package/themes/original/src/components/Wallets/styles.tsx +3 -4
- package/themes/original/src/components/shared/HeaderTitle.tsx +1 -1
- package/themes/original/src/components/shared/OButton.tsx +3 -3
- package/themes/original/src/components/shared/OInput.tsx +4 -5
- package/themes/original/src/components/shared/OModal.tsx +15 -17
- package/themes/original/src/layouts/Container.tsx +1 -1
- package/themes/original/src/types/index.tsx +28 -6
- package/themes/original/src/utils/index.tsx +180 -13
- 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,6 +1,6 @@
|
|
|
1
1
|
import React, { useState, useCallback } from 'react'
|
|
2
2
|
|
|
3
|
-
import { Platform, StyleSheet, View, TouchableOpacity } from 'react-native';
|
|
3
|
+
import { Platform, StyleSheet, View, TouchableOpacity, ScrollView } from 'react-native';
|
|
4
4
|
|
|
5
5
|
import { OButton, OText, OLink, OModal } from '../shared'
|
|
6
6
|
import {
|
|
@@ -16,18 +16,23 @@ import {
|
|
|
16
16
|
|
|
17
17
|
import { ProductItemAccordion } from '../ProductItemAccordion';
|
|
18
18
|
|
|
19
|
-
import { verifyDecimals } from '../../utils';
|
|
19
|
+
import { verifyDecimals, calculateDistance, transformDistance } from '../../utils';
|
|
20
20
|
|
|
21
21
|
import {
|
|
22
22
|
useLanguage,
|
|
23
23
|
useUtils,
|
|
24
24
|
useConfig,
|
|
25
|
+
useSession
|
|
25
26
|
} from 'ordering-components/native';
|
|
26
27
|
import { useTheme } from 'styled-components/native';
|
|
27
28
|
import { ReviewCustomer } from '../ReviewCustomer'
|
|
28
29
|
|
|
29
30
|
import MaterialIcon from 'react-native-vector-icons/MaterialCommunityIcons'
|
|
30
31
|
|
|
32
|
+
import { DeviceOrientationMethods } from '../../../../../src/hooks/DeviceOrientation'
|
|
33
|
+
|
|
34
|
+
const { useDeviceOrientation } = DeviceOrientationMethods
|
|
35
|
+
|
|
31
36
|
interface OrderContent {
|
|
32
37
|
order: any,
|
|
33
38
|
logisticOrderStatus?: Array<number>,
|
|
@@ -38,14 +43,25 @@ interface OrderContent {
|
|
|
38
43
|
export const OrderContentComponent = (props: OrderContent) => {
|
|
39
44
|
const [, t] = useLanguage();
|
|
40
45
|
const theme = useTheme()
|
|
41
|
-
|
|
46
|
+
const [{ user }] = useSession()
|
|
42
47
|
const { order, logisticOrderStatus, isOrderGroup, lastOrder } = props;
|
|
43
48
|
const [{ parsePrice, parseNumber }] = useUtils();
|
|
44
49
|
const [{ configs }] = useConfig();
|
|
50
|
+
const [orientationState] = useDeviceOrientation();
|
|
51
|
+
const distanceUnit = configs?.distance_unit?.value
|
|
52
|
+
|
|
53
|
+
const WIDTH_SCREEN = orientationState?.dimensions?.width
|
|
54
|
+
|
|
45
55
|
const [openReviewModal, setOpenReviewModal] = useState(false)
|
|
46
56
|
|
|
47
|
-
const [isReadMore, setIsReadMore] = useState(
|
|
48
|
-
|
|
57
|
+
const [isReadMore, setIsReadMore] = useState({
|
|
58
|
+
customerAddress: false,
|
|
59
|
+
businessAddressNotes: false
|
|
60
|
+
})
|
|
61
|
+
const [lengthMore, setLengthMore] = useState({
|
|
62
|
+
customerAddress: false,
|
|
63
|
+
businessAddressNotes: false
|
|
64
|
+
})
|
|
49
65
|
|
|
50
66
|
const pastOrderStatuses = [1, 2, 5, 6, 10, 11, 12, 16, 17]
|
|
51
67
|
|
|
@@ -95,17 +111,25 @@ export const OrderContentComponent = (props: OrderContent) => {
|
|
|
95
111
|
}
|
|
96
112
|
|
|
97
113
|
const containsOnlyNumbers = (str: string) => {
|
|
114
|
+
str = str?.replace('+', '');
|
|
98
115
|
return /^\d+$/.test(str);
|
|
99
116
|
}
|
|
100
117
|
|
|
101
|
-
const onTextLayout = useCallback((e: any) => {
|
|
102
|
-
|
|
103
|
-
|
|
118
|
+
const onTextLayout = useCallback((e: any, item: string) => {
|
|
119
|
+
if (item === 'customerAddress') {
|
|
120
|
+
const customerAddressMore = (e.nativeEvent.lines.length == 2 && e.nativeEvent.lines[1].width > WIDTH_SCREEN * .76) || e.nativeEvent.lines.length > 2
|
|
121
|
+
setLengthMore(prev => ({ ...prev, customerAddress: customerAddressMore }))
|
|
122
|
+
}
|
|
123
|
+
if (item === 'businessAddressNotes') {
|
|
124
|
+
const businessAddressNotesMore = (e.nativeEvent.lines.length == 3 && e.nativeEvent.lines[2].width > WIDTH_SCREEN * .76) || e.nativeEvent.lines.length > 3
|
|
125
|
+
setLengthMore(prev => ({ ...prev, businessAddressNotes: businessAddressNotesMore }))
|
|
126
|
+
}
|
|
127
|
+
}, []);
|
|
104
128
|
|
|
105
129
|
return (
|
|
106
130
|
<OrderContent isOrderGroup={isOrderGroup} lastOrder={lastOrder}>
|
|
107
131
|
{isOrderGroup && (
|
|
108
|
-
<OText size={18}>{t('ORDER', 'Order')} #{
|
|
132
|
+
<OText size={18}>{t('ORDER', 'Order')} #{order?.id}</OText>
|
|
109
133
|
)}
|
|
110
134
|
|
|
111
135
|
{order?.metafields?.length > 0 && (
|
|
@@ -160,7 +184,7 @@ export const OrderContentComponent = (props: OrderContent) => {
|
|
|
160
184
|
<OLink
|
|
161
185
|
PressStyle={styles.linkWithIcons}
|
|
162
186
|
url={`tel:${containsOnlyNumbers(order?.business?.cellphone) ? order?.business?.cellphone : 'invalid'}`}
|
|
163
|
-
shorcut={`${order?.business?.cellphone}`}
|
|
187
|
+
shorcut={`${(!!order?.business?.country_phone_code && !order?.business?.cellphone?.includes('+')) ? '+' + order?.business?.country_phone_code : ''}${order?.business?.cellphone}`}
|
|
164
188
|
TextStyle={styles.textLink}
|
|
165
189
|
/>
|
|
166
190
|
</View>
|
|
@@ -170,8 +194,8 @@ export const OrderContentComponent = (props: OrderContent) => {
|
|
|
170
194
|
<View style={styles.linkWithIcons}>
|
|
171
195
|
<OLink
|
|
172
196
|
PressStyle={styles.linkWithIcons}
|
|
173
|
-
url={`tel:${containsOnlyNumbers(order?.business?.
|
|
174
|
-
shorcut={order?.business?.phone}
|
|
197
|
+
url={`tel:${containsOnlyNumbers(order?.business?.phone) ? order?.business?.phone : 'invalid'}`}
|
|
198
|
+
shorcut={`${(!!order?.business?.country_phone_code && !order?.business?.phone?.includes('+')) ? '+' + order?.business?.country_phone_code : ''}${order?.business?.phone}`}
|
|
175
199
|
TextStyle={styles.textLink}
|
|
176
200
|
/>
|
|
177
201
|
</View>
|
|
@@ -193,19 +217,34 @@ export const OrderContentComponent = (props: OrderContent) => {
|
|
|
193
217
|
/>
|
|
194
218
|
</View>
|
|
195
219
|
)}
|
|
196
|
-
|
|
220
|
+
{!!order?.business?.location && order?.customer?.location && (
|
|
221
|
+
<OText>
|
|
222
|
+
{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)}
|
|
223
|
+
</OText>
|
|
224
|
+
)}
|
|
197
225
|
{!!order?.business?.address_notes && (
|
|
198
|
-
|
|
199
|
-
<
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
226
|
+
<>
|
|
227
|
+
<View style={styles.linkWithIcons}>
|
|
228
|
+
<OLink
|
|
229
|
+
PressStyle={styles.linkWithIcons}
|
|
230
|
+
url={Platform.select({
|
|
231
|
+
ios: `maps:0,0?q=${order?.business?.address_notes}`,
|
|
232
|
+
android: `geo:0,0?q=${order?.business?.address_notes}`,
|
|
233
|
+
})}
|
|
234
|
+
shorcut={order?.business?.address_notes}
|
|
235
|
+
TextStyle={styles.textLink}
|
|
236
|
+
onTextLayout={e => onTextLayout(e, 'businessAddressNotes')}
|
|
237
|
+
numberOfLines={isReadMore.businessAddressNotes ? 20 : 3}
|
|
238
|
+
/>
|
|
239
|
+
</View>
|
|
240
|
+
{lengthMore.businessAddressNotes && (
|
|
241
|
+
<TouchableOpacity
|
|
242
|
+
onPress={() => setIsReadMore({ ...isReadMore, businessAddressNotes: !isReadMore.businessAddressNotes })}
|
|
243
|
+
>
|
|
244
|
+
<OText size={12} color={theme.colors.statusOrderBlue}>{isReadMore.businessAddressNotes ? t('SHOW_LESS', 'Show less') : t('READ_MORE', 'Read more')}</OText>
|
|
245
|
+
</TouchableOpacity>
|
|
246
|
+
)}
|
|
247
|
+
</>
|
|
209
248
|
)}
|
|
210
249
|
</OrderBusiness>
|
|
211
250
|
|
|
@@ -287,7 +326,7 @@ export const OrderContentComponent = (props: OrderContent) => {
|
|
|
287
326
|
<OLink
|
|
288
327
|
PressStyle={styles.linkWithIcons}
|
|
289
328
|
url={`tel:${!!order?.customer?.country_phone_code ? '+' + order?.customer?.country_phone_code : ''} ${containsOnlyNumbers(order?.customer?.cellphone) ? order?.customer?.cellphone : 'invalid'}`}
|
|
290
|
-
shorcut={`${!!order?.customer?.country_phone_code ? '+' + order?.customer?.country_phone_code : ''}
|
|
329
|
+
shorcut={`${!!order?.customer?.country_phone_code ? '+' + order?.customer?.country_phone_code : ''}${order?.customer?.cellphone}`}
|
|
291
330
|
TextStyle={styles.textLink}
|
|
292
331
|
/>
|
|
293
332
|
</View>
|
|
@@ -297,8 +336,8 @@ export const OrderContentComponent = (props: OrderContent) => {
|
|
|
297
336
|
<View style={styles.linkWithIcons}>
|
|
298
337
|
<OLink
|
|
299
338
|
PressStyle={styles.linkWithIcons}
|
|
300
|
-
url={`tel:${containsOnlyNumbers(order?.customer?.phone) ? order?.customer?.phone : 'invalid'}`}
|
|
301
|
-
shorcut={order?.customer?.phone}
|
|
339
|
+
url={`tel:${!!order?.customer?.country_phone_code ? '+' + order?.customer?.country_phone_code : ''} ${containsOnlyNumbers(order?.customer?.phone) ? order?.customer?.phone : 'invalid'}`}
|
|
340
|
+
shorcut={`${!!order?.customer?.country_phone_code ? '+' + order?.customer?.country_phone_code : ''}${order?.customer?.phone}`}
|
|
302
341
|
TextStyle={styles.textLink}
|
|
303
342
|
/>
|
|
304
343
|
</View>
|
|
@@ -313,15 +352,17 @@ export const OrderContentComponent = (props: OrderContent) => {
|
|
|
313
352
|
ios: `maps:0,0?q=${order?.customer?.address}`,
|
|
314
353
|
android: `geo:0,0?q=${order?.customer?.address}`,
|
|
315
354
|
})}
|
|
316
|
-
onTextLayout={onTextLayout}
|
|
317
|
-
numberOfLines={isReadMore ? 20 : 2}
|
|
355
|
+
onTextLayout={e => onTextLayout(e, 'customerAddress')}
|
|
356
|
+
numberOfLines={isReadMore.customerAddress ? 20 : 2}
|
|
318
357
|
shorcut={order?.customer?.address}
|
|
319
358
|
TextStyle={styles.textLink}
|
|
320
359
|
/>
|
|
321
360
|
</View>
|
|
322
|
-
{lengthMore && (
|
|
323
|
-
<TouchableOpacity
|
|
324
|
-
|
|
361
|
+
{lengthMore.customerAddress && (
|
|
362
|
+
<TouchableOpacity
|
|
363
|
+
onPress={() => setIsReadMore({ ...isReadMore, customerAddress: !isReadMore.customerAddress })}
|
|
364
|
+
>
|
|
365
|
+
<OText size={12} color={theme.colors.statusOrderBlue}>{isReadMore.customerAddress ? t('SHOW_LESS', 'Show less') : t('READ_MORE', 'Read more')}</OText>
|
|
325
366
|
</TouchableOpacity>
|
|
326
367
|
)}
|
|
327
368
|
</>
|
|
@@ -334,9 +375,15 @@ export const OrderContentComponent = (props: OrderContent) => {
|
|
|
334
375
|
)}
|
|
335
376
|
|
|
336
377
|
{!!order?.customer?.address_notes && (
|
|
337
|
-
<
|
|
338
|
-
{
|
|
339
|
-
|
|
378
|
+
<ScrollView
|
|
379
|
+
showsVerticalScrollIndicator={false}
|
|
380
|
+
showsHorizontalScrollIndicator={false}
|
|
381
|
+
horizontal
|
|
382
|
+
>
|
|
383
|
+
<OText numberOfLines={1} mBottom={4} ellipsizeMode="tail">
|
|
384
|
+
{order?.customer?.address_notes}
|
|
385
|
+
</OText>
|
|
386
|
+
</ScrollView>
|
|
340
387
|
)}
|
|
341
388
|
|
|
342
389
|
{!!order?.customer?.zipcode && (
|
|
@@ -503,7 +550,7 @@ export const OrderContentComponent = (props: OrderContent) => {
|
|
|
503
550
|
))
|
|
504
551
|
}
|
|
505
552
|
{
|
|
506
|
-
order?.summary?.delivery_price
|
|
553
|
+
typeof order?.summary?.delivery_price === 'number' && (
|
|
507
554
|
<Table>
|
|
508
555
|
<OText mBottom={4}>
|
|
509
556
|
{t('DELIVERY_FEE', 'Delivery Fee')}
|
|
@@ -530,15 +577,14 @@ export const OrderContentComponent = (props: OrderContent) => {
|
|
|
530
577
|
</Table>
|
|
531
578
|
))
|
|
532
579
|
}
|
|
533
|
-
{order?.summary?.driver_tip > 0 && (
|
|
580
|
+
{(order?.summary?.driver_tip > 0 || order?.driver_tip > 0) && (
|
|
534
581
|
<Table>
|
|
535
582
|
<OText mBottom={4}>
|
|
536
583
|
{t('DRIVER_TIP', 'Driver tip')}
|
|
537
|
-
{order?.
|
|
538
|
-
parseInt(configs?.driver_tip_type?.value, 10) === 2 &&
|
|
584
|
+
{order?.driver_tip > 0 && parseInt(configs?.driver_tip_type?.value, 10) === 2 &&
|
|
539
585
|
!parseInt(configs?.driver_tip_use_custom?.value, 10) &&
|
|
540
586
|
(
|
|
541
|
-
`(${verifyDecimals(order?.
|
|
587
|
+
`(${verifyDecimals(order?.driver_tip, parseNumber)}%)`
|
|
542
588
|
)}
|
|
543
589
|
</OText>
|
|
544
590
|
<OText mBottom={4}>{parsePrice(order?.summary?.driver_tip ?? order?.totalDriverTip, { currency: order?.currency })}</OText>
|
|
@@ -591,14 +637,16 @@ export const OrderContentComponent = (props: OrderContent) => {
|
|
|
591
637
|
? walletName[event?.wallet_event?.wallet?.type]?.name
|
|
592
638
|
: t(event?.paymethod?.name?.toUpperCase()?.replace(/ /g, '_'), event?.paymethod?.name)}
|
|
593
639
|
</OText>
|
|
594
|
-
{event?.data?.charge_id && (
|
|
640
|
+
{/* {event?.data?.charge_id && (
|
|
595
641
|
<OText>
|
|
596
642
|
{`${t('CODE', 'Code')}: ${event?.data?.charge_id}`}
|
|
597
643
|
</OText>
|
|
598
|
-
)}
|
|
644
|
+
)} */}
|
|
599
645
|
</View>
|
|
600
646
|
<OText>
|
|
601
|
-
|
|
647
|
+
{(event?.paymethod?.gateway === 'cash' && order?.cash)
|
|
648
|
+
? parsePrice(order?.cash, { currency: order?.currency })
|
|
649
|
+
: `-${parsePrice(event?.amount, { currency: order?.currency })}`}
|
|
602
650
|
</OText>
|
|
603
651
|
</View>
|
|
604
652
|
))}
|
|
@@ -9,12 +9,15 @@ import {
|
|
|
9
9
|
|
|
10
10
|
//Components
|
|
11
11
|
import {
|
|
12
|
+
OIcon,
|
|
12
13
|
OIconButton,
|
|
13
14
|
OText,
|
|
14
15
|
} from '../shared'
|
|
15
16
|
|
|
16
17
|
import { useTheme } from 'styled-components/native';
|
|
17
|
-
import { StyleSheet, View } from 'react-native';
|
|
18
|
+
import { StyleSheet, TouchableOpacity, View } from 'react-native';
|
|
19
|
+
import SimpleLineIcons from 'react-native-vector-icons/SimpleLineIcons'
|
|
20
|
+
import MaterialCommunityIcons from 'react-native-vector-icons/MaterialCommunityIcons'
|
|
18
21
|
|
|
19
22
|
import {
|
|
20
23
|
useLanguage,
|
|
@@ -54,6 +57,19 @@ export const OrderHeaderComponent = (props: OrderHeader) => {
|
|
|
54
57
|
height: 40,
|
|
55
58
|
padding: 10,
|
|
56
59
|
alignItems: 'flex-end',
|
|
60
|
+
color: theme.colors.textGray,
|
|
61
|
+
},
|
|
62
|
+
btnBackArrow: {
|
|
63
|
+
borderWidth: 0,
|
|
64
|
+
width: 32,
|
|
65
|
+
height: 32,
|
|
66
|
+
tintColor: theme.colors.textGray,
|
|
67
|
+
backgroundColor: theme.colors.clear,
|
|
68
|
+
borderColor: theme.colors.clear,
|
|
69
|
+
shadowColor: theme.colors.clear,
|
|
70
|
+
paddingLeft: 0,
|
|
71
|
+
paddingRight: 0,
|
|
72
|
+
marginTop: 10
|
|
57
73
|
},
|
|
58
74
|
})
|
|
59
75
|
|
|
@@ -108,42 +124,32 @@ export const OrderHeaderComponent = (props: OrderHeader) => {
|
|
|
108
124
|
<>
|
|
109
125
|
{!props.isCustomView && (
|
|
110
126
|
<Header>
|
|
111
|
-
<
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
borderColor={theme.colors.clear}
|
|
115
|
-
style={{ ...styles.icons, justifyContent: 'flex-end' }}
|
|
116
|
-
onClick={() => handleArrowBack()}
|
|
117
|
-
/>
|
|
118
|
-
|
|
127
|
+
<TouchableOpacity onPress={() => handleArrowBack()} style={styles.btnBackArrow}>
|
|
128
|
+
<OIcon src={theme.images.general.arrow_left} color={theme.colors.textGray} />
|
|
129
|
+
</TouchableOpacity>
|
|
119
130
|
{(!order?.isLogistic || (!logisticOrderStatus?.includes(order?.status) && !order?.order_group)) && (
|
|
120
131
|
<Actions>
|
|
121
132
|
{getOrderStatus(order?.status, t)?.value !==
|
|
122
133
|
t('PENDING', 'Pending') && (
|
|
123
134
|
<>
|
|
124
|
-
<
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
}}
|
|
143
|
-
borderColor={theme.colors.clear}
|
|
144
|
-
style={styles.icons}
|
|
145
|
-
onClick={() => handleViewSummaryOrder?.()}
|
|
146
|
-
/>
|
|
135
|
+
<TouchableOpacity onPress={() => handleCopyClipboard?.()}>
|
|
136
|
+
<MaterialCommunityIcons
|
|
137
|
+
name='content-copy'
|
|
138
|
+
color={theme.colors.textGray}
|
|
139
|
+
size={20}
|
|
140
|
+
style={styles.icons}
|
|
141
|
+
/>
|
|
142
|
+
</TouchableOpacity>
|
|
143
|
+
{!!handleViewSummaryOrder && (
|
|
144
|
+
<TouchableOpacity onPress={() => handleViewSummaryOrder?.()}>
|
|
145
|
+
<SimpleLineIcons
|
|
146
|
+
name='printer'
|
|
147
|
+
color={theme.colors.textGray}
|
|
148
|
+
size={20}
|
|
149
|
+
style={styles.icons}
|
|
150
|
+
/>
|
|
151
|
+
</TouchableOpacity>
|
|
152
|
+
)}
|
|
147
153
|
</>
|
|
148
154
|
)}
|
|
149
155
|
<OIconButton
|
|
@@ -151,7 +157,7 @@ export const OrderHeaderComponent = (props: OrderHeader) => {
|
|
|
151
157
|
iconStyle={{
|
|
152
158
|
width: 20,
|
|
153
159
|
height: 20,
|
|
154
|
-
tintColor: theme.colors.
|
|
160
|
+
tintColor: theme.colors.textGray,
|
|
155
161
|
}}
|
|
156
162
|
borderColor={theme.colors.clear}
|
|
157
163
|
style={styles.icons}
|
|
@@ -163,7 +169,7 @@ export const OrderHeaderComponent = (props: OrderHeader) => {
|
|
|
163
169
|
iconStyle={{
|
|
164
170
|
width: 20,
|
|
165
171
|
height: 20,
|
|
166
|
-
tintColor: theme.colors.
|
|
172
|
+
tintColor: theme.colors.textGray,
|
|
167
173
|
}}
|
|
168
174
|
borderColor={theme.colors.clear}
|
|
169
175
|
style={styles.icons}
|
|
@@ -193,29 +199,24 @@ export const OrderHeaderComponent = (props: OrderHeader) => {
|
|
|
193
199
|
{getOrderStatus(order?.status, t)?.value !==
|
|
194
200
|
t('PENDING', 'Pending') && (
|
|
195
201
|
<>
|
|
196
|
-
<
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
}}
|
|
215
|
-
borderColor={theme.colors.clear}
|
|
216
|
-
style={styles.icons}
|
|
217
|
-
onClick={() => handleViewSummaryOrder?.()}
|
|
218
|
-
/>
|
|
202
|
+
<TouchableOpacity onPress={() => handleCopyClipboard?.()}>
|
|
203
|
+
<MaterialCommunityIcons
|
|
204
|
+
name='content-copy'
|
|
205
|
+
color={theme.colors.textGray}
|
|
206
|
+
size={20}
|
|
207
|
+
style={styles.icons}
|
|
208
|
+
/>
|
|
209
|
+
</TouchableOpacity>
|
|
210
|
+
{!!handleViewSummaryOrder && (
|
|
211
|
+
<TouchableOpacity onPress={() => handleViewSummaryOrder?.()}>
|
|
212
|
+
<SimpleLineIcons
|
|
213
|
+
name='printer'
|
|
214
|
+
color={theme.colors.textGray}
|
|
215
|
+
size={20}
|
|
216
|
+
style={styles.icons}
|
|
217
|
+
/>
|
|
218
|
+
</TouchableOpacity>
|
|
219
|
+
)}
|
|
219
220
|
</>
|
|
220
221
|
)}
|
|
221
222
|
<OIconButton
|
|
@@ -223,7 +224,7 @@ export const OrderHeaderComponent = (props: OrderHeader) => {
|
|
|
223
224
|
iconStyle={{
|
|
224
225
|
width: 20,
|
|
225
226
|
height: 20,
|
|
226
|
-
tintColor: theme.colors.
|
|
227
|
+
tintColor: theme.colors.textGray,
|
|
227
228
|
}}
|
|
228
229
|
borderColor={theme.colors.clear}
|
|
229
230
|
style={styles.icons}
|
|
@@ -235,7 +236,7 @@ export const OrderHeaderComponent = (props: OrderHeader) => {
|
|
|
235
236
|
iconStyle={{
|
|
236
237
|
width: 20,
|
|
237
238
|
height: 20,
|
|
238
|
-
tintColor: theme.colors.
|
|
239
|
+
tintColor: theme.colors.textGray,
|
|
239
240
|
}}
|
|
240
241
|
borderColor={theme.colors.clear}
|
|
241
242
|
style={styles.icons}
|
|
@@ -262,7 +263,13 @@ export const OrderHeaderComponent = (props: OrderHeader) => {
|
|
|
262
263
|
)}
|
|
263
264
|
</>
|
|
264
265
|
</OText>
|
|
265
|
-
{
|
|
266
|
+
{order?.external_id && (
|
|
267
|
+
<OText size={13}>
|
|
268
|
+
<OText size={13} weight='bold'>{`${t('EXTERNAL_ID', 'External ID :')} `}</OText>
|
|
269
|
+
{order?.external_id}
|
|
270
|
+
</OText>
|
|
271
|
+
)}
|
|
272
|
+
{!order?.isLogistic && !!order?.delivery_type && (!order?.order_group_id || !logisticOrderStatus?.includes(order?.status)) && (
|
|
266
273
|
<>
|
|
267
274
|
<OText size={13}>
|
|
268
275
|
<OText size={13} weight='bold'>{`${t('ORDER_TYPE', 'Order Type')}: `}</OText>
|
|
@@ -274,12 +281,12 @@ export const OrderHeaderComponent = (props: OrderHeader) => {
|
|
|
274
281
|
{t(order?.delivery_option?.name?.toUpperCase()?.replace(/ /g, '_'), order?.delivery_option?.name)}
|
|
275
282
|
</OText>
|
|
276
283
|
)}
|
|
277
|
-
|
|
278
|
-
<
|
|
284
|
+
<OText>
|
|
285
|
+
<OText size={13} weight='bold'>
|
|
286
|
+
{`${t('PAYMENT_METHODS', 'Payment methods')}: `}
|
|
287
|
+
</OText>
|
|
288
|
+
{order?.payment_events?.length > 0 ? (
|
|
279
289
|
<OText size={13}>
|
|
280
|
-
<OText size={13} weight='bold'>
|
|
281
|
-
{`${t('PAYMENT_METHODS', 'Payment methods')}: `}
|
|
282
|
-
</OText>
|
|
283
290
|
{order?.payment_events?.map((event: any, idx: number) => {
|
|
284
291
|
return event?.wallet_event
|
|
285
292
|
? idx < order?.payment_events?.length - 1
|
|
@@ -290,7 +297,21 @@ export const OrderHeaderComponent = (props: OrderHeader) => {
|
|
|
290
297
|
: t(event?.paymethod?.name?.toUpperCase()?.replace(/ /g, '_'), event?.paymethod?.name)
|
|
291
298
|
})}
|
|
292
299
|
</OText>
|
|
293
|
-
|
|
300
|
+
) : (
|
|
301
|
+
<OText size={13}>{t(order?.paymethod?.gateway?.toUpperCase(), order?.paymethod?.name)}</OText>
|
|
302
|
+
)}
|
|
303
|
+
</OText>
|
|
304
|
+
{order?.spot_number && (
|
|
305
|
+
<OText size={13}>
|
|
306
|
+
<OText size={13} weight='bold'>
|
|
307
|
+
{`${order?.delivery_type === 3
|
|
308
|
+
? t('EATIN_SPOT_NUMBER', 'Table number')
|
|
309
|
+
: order?.delivery_type === 5
|
|
310
|
+
? t('DRIVE_THRU_SPOT_NUMBER', 'Drive thru lane')
|
|
311
|
+
: t('CURBSIDE_SPOT_NUMBER', 'Spot number')}: `}
|
|
312
|
+
</OText>
|
|
313
|
+
{order.spot_number}
|
|
314
|
+
</OText>
|
|
294
315
|
)}
|
|
295
316
|
</>
|
|
296
317
|
)}
|