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,59 +1,29 @@
|
|
|
1
1
|
import React, { useCallback, useEffect, useRef, useState } from 'react';
|
|
2
2
|
import { Fade, Placeholder, PlaceholderLine } from 'rn-placeholder';
|
|
3
3
|
import Geolocation from '@react-native-community/geolocation'
|
|
4
|
-
import { IOScrollView } from 'react-native-intersection-observer'
|
|
5
4
|
import { getTrackingStatus, requestTrackingPermission } from 'react-native-tracking-transparency'
|
|
6
5
|
import {
|
|
7
6
|
View,
|
|
8
7
|
StyleSheet,
|
|
9
|
-
ScrollView,
|
|
10
8
|
Platform,
|
|
11
9
|
TouchableOpacity,
|
|
12
|
-
RefreshControl,
|
|
13
|
-
AppState
|
|
14
10
|
} from 'react-native';
|
|
11
|
+
|
|
15
12
|
import {
|
|
16
13
|
BusinessList as BusinessesListingController,
|
|
17
|
-
useLanguage,
|
|
18
|
-
useSession,
|
|
19
14
|
useOrder,
|
|
20
15
|
useConfig,
|
|
21
|
-
useUtils
|
|
22
16
|
} from 'ordering-components/native';
|
|
23
17
|
import { useTheme } from 'styled-components/native';
|
|
24
|
-
import Ionicons from 'react-native-vector-icons/Ionicons'
|
|
25
18
|
|
|
26
19
|
import {
|
|
27
|
-
Search,
|
|
28
|
-
OrderControlContainer,
|
|
29
|
-
AddressInput,
|
|
30
|
-
WrapMomentOption,
|
|
31
|
-
HeaderWrapper,
|
|
32
|
-
ListWrapper,
|
|
33
|
-
FeaturedWrapper,
|
|
34
|
-
FarAwayMessage,
|
|
35
|
-
AddressInputContainer,
|
|
36
|
-
PreorderInput,
|
|
37
|
-
OrderTypesContainer,
|
|
38
20
|
BusinessLogosContainer
|
|
39
21
|
} from './styles';
|
|
40
22
|
|
|
41
|
-
import { OIcon, OText, OModal } from '../../../shared';
|
|
42
23
|
import { BusinessesListingParams } from '../../../../types';
|
|
43
|
-
import {
|
|
44
|
-
import { BusinessTypeFilter } from '../../../BusinessTypeFilter';
|
|
45
|
-
import { BusinessController } from '../../../BusinessController';
|
|
46
|
-
import { OrderTypeSelector } from '../../../OrderTypeSelector';
|
|
47
|
-
import { useSafeAreaInsets } from 'react-native-safe-area-context';
|
|
48
|
-
import { BusinessFeaturedController } from '../../../BusinessFeaturedController';
|
|
49
|
-
import { HighestRatedBusinesses } from '../../../HighestRatedBusinesses';
|
|
50
|
-
import { getTypesText } from '../../../../utils';
|
|
51
|
-
import { OrderProgress } from '../../../OrderProgress';
|
|
52
|
-
import { useFocusEffect, useIsFocused } from '@react-navigation/native';
|
|
24
|
+
import { useFocusEffect } from '@react-navigation/native';
|
|
53
25
|
import FastImage from 'react-native-fast-image';
|
|
54
|
-
import
|
|
55
|
-
import { PageBanner } from '../../../PageBanner'
|
|
56
|
-
import { CitiesControl } from '../../../CitiesControl'
|
|
26
|
+
import { FlatListBusinessListing } from './FlatListBusinessListing'
|
|
57
27
|
|
|
58
28
|
const PIXELS_TO_SCROLL = 2000;
|
|
59
29
|
|
|
@@ -62,36 +32,19 @@ const BusinessesListingUI = (props: BusinessesListingParams) => {
|
|
|
62
32
|
navigation,
|
|
63
33
|
businessesList,
|
|
64
34
|
getBusinesses,
|
|
65
|
-
handleChangeBusinessType,
|
|
66
35
|
handleBusinessClick,
|
|
67
36
|
paginationProps,
|
|
68
|
-
businessId,
|
|
69
|
-
isGuestUser,
|
|
70
|
-
handleUpdateBusinessList,
|
|
71
37
|
citiesState,
|
|
72
38
|
actualSlug,
|
|
73
39
|
logosLayout
|
|
74
40
|
} = props;
|
|
75
41
|
const theme = useTheme();
|
|
76
|
-
const isFocused = useIsFocused();
|
|
77
42
|
|
|
78
|
-
const [, t] = useLanguage();
|
|
79
|
-
const [{ user, auth }] = useSession();
|
|
80
43
|
const [orderState, { changeCityFilter }] = useOrder();
|
|
81
44
|
const [{ configs }] = useConfig();
|
|
82
|
-
const [{ parseDate }] = useUtils();
|
|
83
45
|
|
|
84
|
-
const appState = useRef(AppState.currentState)
|
|
85
46
|
const isChewLayout = theme?.header?.components?.layout?.type?.toLowerCase() === 'chew'
|
|
86
|
-
const [refreshing] = useState(false);
|
|
87
47
|
const allCitiesDisabled = citiesState?.cities?.every((city: any) => !city.enabled)
|
|
88
|
-
const hideCities = (theme?.business_listing_view?.components?.cities?.hidden || orderState?.options?.type !== 2 || allCitiesDisabled) ?? true
|
|
89
|
-
const hideHero = theme?.business_listing_view?.components?.business_hero?.hidden
|
|
90
|
-
const hidePreviousOrders = theme?.business_listing_view?.components?.previous_orders_block?.hidden
|
|
91
|
-
const hideHighestBusiness = theme?.business_listing_view?.components?.highest_rated_business_block?.hidden
|
|
92
|
-
const isAllCategoriesHidden = theme?.business_listing_view?.components?.categories?.hidden
|
|
93
|
-
const bgHeader = theme?.business_listing_view?.components?.business_hero?.components?.image
|
|
94
|
-
const bgHeaderHeight = theme?.business_listing_view?.components?.business_hero?.components?.style?.height
|
|
95
48
|
|
|
96
49
|
const styles = StyleSheet.create({
|
|
97
50
|
container: {
|
|
@@ -141,7 +94,7 @@ const BusinessesListingUI = (props: BusinessesListingParams) => {
|
|
|
141
94
|
backgroundColor: theme.colors.white,
|
|
142
95
|
borderColor: theme.colors.backgroundGray,
|
|
143
96
|
borderRadius: 8,
|
|
144
|
-
marginHorizontal:
|
|
97
|
+
marginHorizontal: 20,
|
|
145
98
|
minHeight: 45,
|
|
146
99
|
paddingVertical: 5,
|
|
147
100
|
paddingHorizontal: 20,
|
|
@@ -156,32 +109,14 @@ const BusinessesListingUI = (props: BusinessesListingParams) => {
|
|
|
156
109
|
},
|
|
157
110
|
});
|
|
158
111
|
|
|
159
|
-
const { top } = useSafeAreaInsets();
|
|
160
|
-
|
|
161
112
|
const [featuredBusiness, setFeaturedBusinesses] = useState(Array);
|
|
162
113
|
const [isFarAway, setIsFarAway] = useState(false)
|
|
163
|
-
const [businessTypes, setBusinessTypes] = useState(null)
|
|
164
114
|
const [orderTypeValue, setOrderTypeValue] = useState(orderState?.options?.value)
|
|
165
115
|
const [isOpenCities, setIsOpenCities] = useState(false)
|
|
166
|
-
const isPreorderEnabled = (configs?.preorder_status_enabled?.value === '1' || configs?.preorder_status_enabled?.value === 'true') &&
|
|
167
|
-
Number(configs?.max_days_preorder?.value) > 0
|
|
168
|
-
const isPreOrderSetting = configs?.preorder_status_enabled?.value === '1'
|
|
169
116
|
const timerId = useRef<any>(false)
|
|
170
117
|
const [favoriteIds, setFavoriteIds] = useState<any>([])
|
|
171
|
-
const chewOrderTypes = [{ name: t('DELIVERY', 'Delivery').toUpperCase(), value: 1 }, { name: t('PICKUP', 'Pickup').toUpperCase(), value: 2 }]
|
|
172
118
|
const enabledPoweredByOrdering = configs?.powered_by_ordering_module?.value
|
|
173
119
|
|
|
174
|
-
const handleMomentClick = () => {
|
|
175
|
-
if (isPreorderEnabled) {
|
|
176
|
-
navigation.navigate('MomentOption')
|
|
177
|
-
}
|
|
178
|
-
}
|
|
179
|
-
|
|
180
|
-
const configTypes =
|
|
181
|
-
configs?.order_types_allowed?.value
|
|
182
|
-
.split('|')
|
|
183
|
-
.map((value: any) => Number(value)) || [];
|
|
184
|
-
|
|
185
120
|
const handleScroll = ({ nativeEvent }: any) => {
|
|
186
121
|
const y = nativeEvent.contentOffset.y;
|
|
187
122
|
const height = nativeEvent.contentSize.height;
|
|
@@ -355,347 +290,39 @@ const BusinessesListingUI = (props: BusinessesListingParams) => {
|
|
|
355
290
|
}
|
|
356
291
|
|
|
357
292
|
return (
|
|
358
|
-
<
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
}
|
|
368
|
-
|
|
369
|
-
{
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
height: !isPreOrderSetting && isChewLayout ? 150 : isChewLayout ? 200 : isFarAway ? 150 : 100,
|
|
378
|
-
marginTop: Platform.OS == 'ios' ? 0 : 50,
|
|
379
|
-
backgroundColor: isChewLayout ? theme?.colors?.chew : theme.colors?.white
|
|
380
|
-
}}
|
|
381
|
-
>
|
|
382
|
-
{isChewLayout && (
|
|
383
|
-
<View style={{ marginTop: 30, paddingHorizontal: 30, flexDirection: 'row', justifyContent: 'space-between' }}>
|
|
384
|
-
<OText size={24} weight={700} color={theme.colors?.white}>
|
|
385
|
-
{t('WELCOME', 'Welcome')} {user?.name}
|
|
386
|
-
</OText>
|
|
387
|
-
</View>
|
|
388
|
-
)}
|
|
389
|
-
<Search isChewLayout={isChewLayout}>
|
|
390
|
-
<AddressInput
|
|
391
|
-
isChewLayout={isChewLayout}
|
|
392
|
-
onPress={() =>
|
|
393
|
-
auth
|
|
394
|
-
? navigation.navigate('AddressList', { isFromBusinesses: true })
|
|
395
|
-
: navigation.navigate('AddressForm', {
|
|
396
|
-
address: orderState.options?.address,
|
|
397
|
-
isFromBusinesses: true,
|
|
398
|
-
isGuestUser: isGuestUser
|
|
399
|
-
})
|
|
400
|
-
}>
|
|
401
|
-
<AddressInputContainer isChewLayout={isChewLayout}>
|
|
402
|
-
<OIcon
|
|
403
|
-
src={theme.images.general.pin}
|
|
404
|
-
color={theme.colors.disabled}
|
|
405
|
-
width={16}
|
|
406
|
-
style={{ marginRight: isChewLayout ? 0 : 10 }}
|
|
407
|
-
/>
|
|
408
|
-
<OText size={12} numberOfLines={1} style={{ flex: 1 }}>
|
|
409
|
-
{orderState?.options?.address?.address || t('WHAT_IS_YOUR_ADDRESS', 'What\'s your address?')}
|
|
410
|
-
</OText>
|
|
411
|
-
{!isChewLayout && (
|
|
412
|
-
<OIcon
|
|
413
|
-
src={theme.images.general.arrow_down}
|
|
414
|
-
width={10}
|
|
415
|
-
style={{ marginStart: 8 }}
|
|
416
|
-
/>
|
|
417
|
-
)}
|
|
418
|
-
</AddressInputContainer>
|
|
419
|
-
</AddressInput>
|
|
420
|
-
</Search>
|
|
421
|
-
{isFarAway && !isChewLayout && (
|
|
422
|
-
<FarAwayMessage style={styles.farAwayMsg}>
|
|
423
|
-
<Ionicons name='md-warning-outline' style={styles.iconStyle} />
|
|
424
|
-
<OText size={12} numberOfLines={1} ellipsizeMode={'tail'} color={theme.colors.textNormal}>{t('YOU_ARE_FAR_FROM_ADDRESS', 'You are far from this address')}</OText>
|
|
425
|
-
</FarAwayMessage>
|
|
426
|
-
)}
|
|
427
|
-
{!isChewLayout ? (
|
|
428
|
-
<OrderControlContainer>
|
|
429
|
-
<View style={styles.wrapperOrderOptions}>
|
|
430
|
-
{isPreOrderSetting && (
|
|
431
|
-
<WrapMomentOption
|
|
432
|
-
onPress={() => handleMomentClick()}>
|
|
433
|
-
<OText
|
|
434
|
-
size={12}
|
|
435
|
-
numberOfLines={1}
|
|
436
|
-
ellipsizeMode="tail"
|
|
437
|
-
color={theme.colors.textSecondary}>
|
|
438
|
-
{orderState.options?.moment
|
|
439
|
-
? parseDate(orderState.options?.moment, { outputFormat: configs?.dates_moment_format?.value })
|
|
440
|
-
: t('ASAP_ABBREVIATION', 'ASAP')}
|
|
441
|
-
</OText>
|
|
442
|
-
{isPreorderEnabled && (
|
|
443
|
-
<OIcon
|
|
444
|
-
src={theme.images.general.arrow_down}
|
|
445
|
-
width={10}
|
|
446
|
-
style={{ marginStart: 8 }}
|
|
447
|
-
/>
|
|
448
|
-
)}
|
|
449
|
-
</WrapMomentOption>
|
|
450
|
-
)}
|
|
451
|
-
<WrapMomentOption onPress={() => navigation.navigate('OrderTypes', { configTypes: configTypes, setOrderTypeValue })}>
|
|
452
|
-
<OText size={12} numberOfLines={1} ellipsizeMode={'tail'} color={theme.colors.textSecondary}>{t(getTypesText(orderTypeValue || orderState?.options?.type || 1), 'Delivery')}</OText>
|
|
453
|
-
<OIcon
|
|
454
|
-
src={theme.images.general.arrow_down}
|
|
455
|
-
width={10}
|
|
456
|
-
style={{ marginStart: 8 }}
|
|
457
|
-
/>
|
|
458
|
-
</WrapMomentOption>
|
|
459
|
-
</View>
|
|
460
|
-
</OrderControlContainer>
|
|
461
|
-
) : (
|
|
462
|
-
<>
|
|
463
|
-
{isPreOrderSetting && (
|
|
464
|
-
<View style={{ paddingHorizontal: 30 }}>
|
|
465
|
-
<PreorderInput
|
|
466
|
-
isChewLayout={isChewLayout}
|
|
467
|
-
onPress={() => handleMomentClick()}
|
|
468
|
-
>
|
|
469
|
-
<OText color={theme.colors.textSecondary}>
|
|
470
|
-
{orderState.options?.moment
|
|
471
|
-
? parseDate(orderState.options?.moment, { outputFormat: configs?.dates_moment_format?.value })
|
|
472
|
-
: t('ASAP_ABBREVIATION', 'ASAP')}</OText>
|
|
473
|
-
</PreorderInput>
|
|
474
|
-
</View>
|
|
475
|
-
)}
|
|
476
|
-
</>
|
|
477
|
-
)}
|
|
478
|
-
</View>
|
|
479
|
-
{!isChewLayout ? (
|
|
480
|
-
<>
|
|
481
|
-
{!hideHero ? (
|
|
482
|
-
<HeaderWrapper
|
|
483
|
-
source={bgHeader ? { uri: bgHeader } : theme.images.backgrounds.business_list_header}
|
|
484
|
-
style={{ paddingTop: top + 20 }}
|
|
485
|
-
resizeMode='cover'
|
|
486
|
-
bgHeaderHeight={bgHeaderHeight}
|
|
487
|
-
>
|
|
488
|
-
{!auth && (
|
|
489
|
-
<TouchableOpacity onPress={() => navigation?.canGoBack() && navigation.goBack()} style={{ position: 'absolute', marginStart: 40, paddingVertical: 20 }}>
|
|
490
|
-
<OIcon src={theme.images.general.arrow_left} color={theme.colors.textNormal} />
|
|
491
|
-
</TouchableOpacity>
|
|
492
|
-
)}
|
|
493
|
-
</HeaderWrapper>
|
|
494
|
-
) : (
|
|
495
|
-
<>
|
|
496
|
-
{!auth && (
|
|
497
|
-
<TouchableOpacity onPress={() => navigation?.canGoBack() && navigation.goBack()} style={{ position: 'absolute', marginStart: 40, paddingVertical: 20 }}>
|
|
498
|
-
<OIcon src={theme.images.general.arrow_left} color={theme.colors.textNormal} />
|
|
499
|
-
</TouchableOpacity>
|
|
500
|
-
)}
|
|
501
|
-
</>
|
|
502
|
-
)}
|
|
503
|
-
</>
|
|
504
|
-
) : (
|
|
505
|
-
<OrderTypesContainer>
|
|
506
|
-
<OrderTypeSelector
|
|
507
|
-
handleChangeBusinessType={handleChangeBusinessType}
|
|
508
|
-
isChewLayout
|
|
509
|
-
chewOrderTypes={chewOrderTypes}
|
|
510
|
-
handleChangeType={setOrderTypeValue}
|
|
511
|
-
/>
|
|
512
|
-
</OrderTypesContainer>
|
|
513
|
-
)}
|
|
514
|
-
|
|
515
|
-
{!hideCities && orderTypeValue === 2 && (
|
|
516
|
-
<View style={{ marginTop: 20 }}>
|
|
517
|
-
<TouchableOpacity
|
|
518
|
-
style={styles.buttonCityStyle}
|
|
519
|
-
onPress={() => setIsOpenCities(true)}
|
|
520
|
-
disabled={orderState?.loading}
|
|
521
|
-
>
|
|
522
|
-
<OText size={18} color={theme.colors.backgroundGray} weight='bold' style={{ textAlign: 'center' }}>
|
|
523
|
-
{citiesState?.cities?.find((city: any) => city?.id === orderState?.options?.city_id)?.name || t('FILTER_BY_CITY', 'Filter by city')}
|
|
524
|
-
</OText>
|
|
525
|
-
</TouchableOpacity>
|
|
526
|
-
</View>
|
|
527
|
-
)}
|
|
528
|
-
{!hidePreviousOrders && (
|
|
529
|
-
<OrderProgress
|
|
530
|
-
{...props}
|
|
531
|
-
isFocused={isFocused}
|
|
532
|
-
/>
|
|
533
|
-
)}
|
|
534
|
-
{
|
|
535
|
-
!businessId && !props.franchiseId && featuredBusiness && featuredBusiness.length > 0 && (
|
|
536
|
-
<FeaturedWrapper>
|
|
537
|
-
<OText size={16} style={{ marginLeft: 40 }} weight={Platform.OS === 'ios' ? '600' : 'bold'}>{t('BUSINESS_FEATURE', 'Featured business')}</OText>
|
|
538
|
-
<ScrollView
|
|
539
|
-
showsHorizontalScrollIndicator={false}
|
|
540
|
-
nestedScrollEnabled
|
|
541
|
-
horizontal
|
|
542
|
-
contentContainerStyle={{ paddingHorizontal: 40 }}
|
|
543
|
-
>
|
|
544
|
-
{featuredBusiness.map((bAry: any, idx) => (
|
|
545
|
-
<View key={'f-listing_' + idx}>
|
|
546
|
-
<BusinessFeaturedController
|
|
547
|
-
business={bAry[0]}
|
|
548
|
-
isBusinessOpen={bAry[0]?.open}
|
|
549
|
-
handleCustomClick={handleBusinessClick}
|
|
550
|
-
orderType={orderState?.options?.type}
|
|
551
|
-
/>
|
|
552
|
-
{bAry.length > 1 && (
|
|
553
|
-
<BusinessFeaturedController
|
|
554
|
-
business={bAry[1]}
|
|
555
|
-
isBusinessOpen={bAry[1]?.open}
|
|
556
|
-
handleCustomClick={handleBusinessClick}
|
|
557
|
-
orderType={orderState?.options?.type}
|
|
558
|
-
/>
|
|
559
|
-
)}
|
|
560
|
-
</View>
|
|
561
|
-
))}
|
|
562
|
-
</ScrollView>
|
|
563
|
-
</FeaturedWrapper>
|
|
564
|
-
)
|
|
565
|
-
}
|
|
566
|
-
{!isChewLayout && !hideHighestBusiness && (
|
|
567
|
-
<>
|
|
568
|
-
<View style={{ height: 8, backgroundColor: theme.colors.backgroundGray100 }} />
|
|
569
|
-
{
|
|
570
|
-
!businessId && !props.franchiseId && (
|
|
571
|
-
<HighestRatedBusinesses
|
|
572
|
-
onBusinessClick={handleBusinessClick}
|
|
573
|
-
navigation={navigation}
|
|
574
|
-
favoriteIds={favoriteIds}
|
|
575
|
-
setFavoriteIds={setFavoriteIds}
|
|
576
|
-
/>
|
|
577
|
-
)
|
|
578
|
-
}
|
|
579
|
-
</>
|
|
580
|
-
)}
|
|
581
|
-
|
|
582
|
-
<PageBanner position='app_business_listing' navigation={navigation} />
|
|
583
|
-
|
|
584
|
-
<View style={{ height: 8, backgroundColor: theme.colors.backgroundGray100 }} />
|
|
585
|
-
<ListWrapper style={{ paddingHorizontal: isChewLayout ? 20 : 40 }}>
|
|
586
|
-
{!businessId && !isAllCategoriesHidden && (
|
|
587
|
-
<BusinessTypeFilter
|
|
588
|
-
images={props.images}
|
|
589
|
-
businessTypes={props.businessTypes}
|
|
590
|
-
defaultBusinessType={props.defaultBusinessType}
|
|
591
|
-
handleChangeBusinessType={handleChangeBusinessType}
|
|
592
|
-
setBusinessTypes={setBusinessTypes}
|
|
593
|
-
/>
|
|
594
|
-
)}
|
|
595
|
-
{!businessesList.loading && businessesList.businesses.length === 0 && businessesList?.fetched && (
|
|
596
|
-
<NotFoundSource
|
|
597
|
-
content={t(
|
|
598
|
-
'NOT_FOUND_BUSINESSES',
|
|
599
|
-
'No businesses to delivery / pick up at this address, please change filters or change address.',
|
|
600
|
-
)}
|
|
601
|
-
/>
|
|
602
|
-
)}
|
|
603
|
-
{businessesList.businesses?.map(
|
|
604
|
-
(business: any, i: number) => (
|
|
605
|
-
<BusinessController
|
|
606
|
-
key={`${business.id}_` + i}
|
|
607
|
-
enableIntersection
|
|
608
|
-
business={business}
|
|
609
|
-
isBusinessOpen={business.open}
|
|
610
|
-
handleCustomClick={handleBusinessClick}
|
|
611
|
-
orderType={orderState?.options?.type}
|
|
612
|
-
navigation={navigation}
|
|
613
|
-
businessHeader={business?.header}
|
|
614
|
-
businessFeatured={business?.featured}
|
|
615
|
-
businessLogo={business?.logo}
|
|
616
|
-
businessReviews={business?.reviews}
|
|
617
|
-
businessDeliveryPrice={business?.delivery_price}
|
|
618
|
-
businessDeliveryTime={business?.delivery_time}
|
|
619
|
-
businessPickupTime={business?.pickup_time}
|
|
620
|
-
businessDistance={business?.distance}
|
|
621
|
-
handleUpdateBusinessList={handleUpdateBusinessList}
|
|
622
|
-
favoriteIds={favoriteIds}
|
|
623
|
-
setFavoriteIds={setFavoriteIds}
|
|
624
|
-
/>
|
|
625
|
-
)
|
|
626
|
-
)}
|
|
627
|
-
{(businessesList.loading || !businessesList?.fetched) && (
|
|
628
|
-
<>
|
|
629
|
-
{[
|
|
630
|
-
...Array(
|
|
631
|
-
paginationProps.nextPageItems
|
|
632
|
-
? paginationProps.nextPageItems
|
|
633
|
-
: 8,
|
|
634
|
-
).keys(),
|
|
635
|
-
].map((item, i) => (
|
|
636
|
-
<Placeholder
|
|
637
|
-
Animation={Fade}
|
|
638
|
-
key={i}
|
|
639
|
-
style={{ marginBottom: 20 }}>
|
|
640
|
-
<View style={{ width: '100%' }}>
|
|
641
|
-
<PlaceholderLine
|
|
642
|
-
height={200}
|
|
643
|
-
style={{ marginBottom: 20, borderRadius: 25 }}
|
|
644
|
-
/>
|
|
645
|
-
<View style={{ paddingHorizontal: 10 }}>
|
|
646
|
-
<View
|
|
647
|
-
style={{
|
|
648
|
-
flexDirection: 'row',
|
|
649
|
-
justifyContent: 'space-between',
|
|
650
|
-
}}>
|
|
651
|
-
<PlaceholderLine
|
|
652
|
-
height={25}
|
|
653
|
-
width={40}
|
|
654
|
-
style={{ marginBottom: 10 }}
|
|
655
|
-
/>
|
|
656
|
-
<PlaceholderLine
|
|
657
|
-
height={25}
|
|
658
|
-
width={20}
|
|
659
|
-
style={{ marginBottom: 10 }}
|
|
660
|
-
/>
|
|
661
|
-
</View>
|
|
662
|
-
<PlaceholderLine
|
|
663
|
-
height={20}
|
|
664
|
-
width={30}
|
|
665
|
-
style={{ marginBottom: 10 }}
|
|
666
|
-
/>
|
|
667
|
-
<PlaceholderLine
|
|
668
|
-
height={20}
|
|
669
|
-
width={80}
|
|
670
|
-
style={{ marginBottom: 10 }}
|
|
671
|
-
/>
|
|
672
|
-
</View>
|
|
673
|
-
</View>
|
|
674
|
-
</Placeholder>
|
|
675
|
-
))}
|
|
676
|
-
</>
|
|
677
|
-
)}
|
|
678
|
-
</ListWrapper>
|
|
679
|
-
<OModal
|
|
680
|
-
open={isOpenCities}
|
|
681
|
-
onClose={() => setIsOpenCities(false)}
|
|
682
|
-
title={t('SELECT_A_CITY', 'Select a city')}
|
|
683
|
-
>
|
|
684
|
-
<CitiesControl
|
|
685
|
-
cities={citiesState?.cities}
|
|
686
|
-
onClose={() => setIsOpenCities(false)}
|
|
687
|
-
handleChangeCity={handleChangeCity}
|
|
688
|
-
/>
|
|
689
|
-
</OModal>
|
|
690
|
-
</IOScrollView>
|
|
293
|
+
<FlatListBusinessListing
|
|
294
|
+
{...props}
|
|
295
|
+
navigation={navigation}
|
|
296
|
+
businessesList={businessesList}
|
|
297
|
+
enabledPoweredByOrdering={enabledPoweredByOrdering}
|
|
298
|
+
orderTypeValue={orderTypeValue}
|
|
299
|
+
allCitiesDisabled={allCitiesDisabled}
|
|
300
|
+
featuredBusiness={featuredBusiness}
|
|
301
|
+
favoriteIds={favoriteIds}
|
|
302
|
+
isFarAway={isFarAway}
|
|
303
|
+
isOpenCities={isOpenCities}
|
|
304
|
+
isChewLayout={isChewLayout}
|
|
305
|
+
handleScroll={handleScroll}
|
|
306
|
+
setIsOpenCities={setIsOpenCities}
|
|
307
|
+
setFavoriteIds={setFavoriteIds}
|
|
308
|
+
handleOnRefresh={handleOnRefresh}
|
|
309
|
+
setOrderTypeValue={setOrderTypeValue}
|
|
310
|
+
handleChangeCity={handleChangeCity}
|
|
311
|
+
/>
|
|
691
312
|
);
|
|
692
313
|
};
|
|
693
314
|
|
|
694
315
|
export const BusinessesListing = (props: BusinessesListingParams) => {
|
|
316
|
+
|
|
695
317
|
const BusinessesListingProps = {
|
|
696
318
|
...props,
|
|
697
319
|
isForceSearch: Platform.OS === 'ios',
|
|
698
320
|
UIComponent: BusinessesListingUI,
|
|
321
|
+
paginationSettings: {
|
|
322
|
+
initialPage: 1,
|
|
323
|
+
pageSize: 50,
|
|
324
|
+
controlType: 'infinity'
|
|
325
|
+
}
|
|
699
326
|
};
|
|
700
327
|
|
|
701
328
|
return <BusinessesListingController {...BusinessesListingProps} />;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React, { useEffect, useState } from 'react';
|
|
1
|
+
import React, { useEffect, useState, useRef } from 'react';
|
|
2
2
|
import {
|
|
3
3
|
Cart as CartController,
|
|
4
4
|
useOrder,
|
|
@@ -52,7 +52,11 @@ const CartUI = (props: any) => {
|
|
|
52
52
|
preorderMaximumDays,
|
|
53
53
|
preorderMinimumDays,
|
|
54
54
|
cateringTypes,
|
|
55
|
-
isFromUpselling
|
|
55
|
+
isFromUpselling,
|
|
56
|
+
cartsOpened,
|
|
57
|
+
setCartsOpened,
|
|
58
|
+
changeActiveState,
|
|
59
|
+
isActive
|
|
56
60
|
} = props
|
|
57
61
|
|
|
58
62
|
const theme = useTheme();
|
|
@@ -62,7 +66,7 @@ const CartUI = (props: any) => {
|
|
|
62
66
|
const [{ configs }] = useConfig();
|
|
63
67
|
const [{ parsePrice, parseNumber, parseDate }] = useUtils()
|
|
64
68
|
const [validationFields] = useValidationFields()
|
|
65
|
-
|
|
69
|
+
const commentRef = useRef()
|
|
66
70
|
const [openUpselling, setOpenUpselling] = useState(false)
|
|
67
71
|
const [openChangeStore, setOpenChangeStore] = useState(false)
|
|
68
72
|
const [canOpenUpselling, setCanOpenUpselling] = useState(false)
|
|
@@ -109,7 +113,7 @@ const CartUI = (props: any) => {
|
|
|
109
113
|
}
|
|
110
114
|
}
|
|
111
115
|
|
|
112
|
-
const handleUpsellingPage = (individualCart
|
|
116
|
+
const handleUpsellingPage = (individualCart: any) => {
|
|
113
117
|
const isProductCartParam = !!individualCart?.products?.length
|
|
114
118
|
setOpenUpselling(false)
|
|
115
119
|
setCanOpenUpselling(false)
|
|
@@ -117,7 +121,7 @@ const CartUI = (props: any) => {
|
|
|
117
121
|
const cartsAvailable: any = Object.values(orderState?.carts)
|
|
118
122
|
?.filter((_cart: any) => _cart?.valid && _cart?.status !== 2 && _cart?.products?.length)
|
|
119
123
|
?.filter((_c: any) => !isProductCartParam ? _c.uuid !== individualCart?.uuid : _c)
|
|
120
|
-
if (cartsAvailable.length === 1 || !isMultiCheckout) {
|
|
124
|
+
if (cartsAvailable.length === 1 || !isMultiCheckout || !cart?.business_id) {
|
|
121
125
|
const cart = isMultiCheckout ? cartsAvailable[0] : individualCart
|
|
122
126
|
onNavigationRedirect('CheckoutNavigator', {
|
|
123
127
|
screen: 'CheckoutPage',
|
|
@@ -192,6 +196,14 @@ const CartUI = (props: any) => {
|
|
|
192
196
|
return acc = acc
|
|
193
197
|
}, cart?.subtotal)
|
|
194
198
|
|
|
199
|
+
const handleClickCheckout = () => {
|
|
200
|
+
if (cart?.business_id) {
|
|
201
|
+
setOpenUpselling(true)
|
|
202
|
+
} else {
|
|
203
|
+
handleUpsellingPage(cart)
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
|
|
195
207
|
useEffect(() => {
|
|
196
208
|
const limitDays = parseInt(preorderMaximumDays ?? configs?.max_days_preorder?.value, 10)
|
|
197
209
|
const currentDate = new Date()
|
|
@@ -228,10 +240,15 @@ const CartUI = (props: any) => {
|
|
|
228
240
|
handleCartOpen={handleCartOpen}
|
|
229
241
|
onNavigationRedirect={props.onNavigationRedirect}
|
|
230
242
|
handleChangeStore={() => setOpenChangeStore(true)}
|
|
231
|
-
handleClickCheckout={() =>
|
|
243
|
+
handleClickCheckout={() => handleClickCheckout()}
|
|
232
244
|
checkoutButtonDisabled={(openUpselling && !canOpenUpselling) || subtotalWithTaxes < cart?.minimum || !cart?.valid_address}
|
|
233
245
|
isMultiCheckout={isMultiCheckout}
|
|
234
246
|
isFromUpselling={isFromUpselling}
|
|
247
|
+
cartsOpened={cartsOpened}
|
|
248
|
+
setCartsOpened={setCartsOpened}
|
|
249
|
+
changeActiveState={changeActiveState}
|
|
250
|
+
isActive={isActive}
|
|
251
|
+
isGiftCart={!cart?.business_id}
|
|
235
252
|
>
|
|
236
253
|
{cart?.products?.length > 0 && cart?.products.map((product: any, i: number) => (
|
|
237
254
|
<ProductItemAccordion
|
|
@@ -423,6 +440,7 @@ const CartUI = (props: any) => {
|
|
|
423
440
|
cart?.status !== 2 &&
|
|
424
441
|
validationFields?.fields?.checkout?.driver_tip?.enabled &&
|
|
425
442
|
driverTipsOptions && driverTipsOptions?.length > 0 &&
|
|
443
|
+
cart?.business_id &&
|
|
426
444
|
(
|
|
427
445
|
<DriverTipsContainer>
|
|
428
446
|
<OText size={14} lineHeight={20} color={theme.colors.textNormal}>
|
|
@@ -489,6 +507,7 @@ const CartUI = (props: any) => {
|
|
|
489
507
|
marginTop: 10,
|
|
490
508
|
borderRadius: 7.6
|
|
491
509
|
}}
|
|
510
|
+
forwardRef={commentRef}
|
|
492
511
|
multiline
|
|
493
512
|
/>
|
|
494
513
|
{commentState?.loading && (
|
|
@@ -521,7 +540,7 @@ const CartUI = (props: any) => {
|
|
|
521
540
|
/>
|
|
522
541
|
</View>
|
|
523
542
|
)}
|
|
524
|
-
{!isMultiCheckout && (
|
|
543
|
+
{(!isMultiCheckout || !cart?.business_id) && (
|
|
525
544
|
<>
|
|
526
545
|
{cart?.valid_products ? (
|
|
527
546
|
<CheckoutAction>
|
|
@@ -538,7 +557,7 @@ const CartUI = (props: any) => {
|
|
|
538
557
|
borderColor={theme.colors.primary}
|
|
539
558
|
imgRightSrc={null}
|
|
540
559
|
textStyle={{ color: '#fff', textAlign: 'center', flex: 1 }}
|
|
541
|
-
onClick={() =>
|
|
560
|
+
onClick={() => handleClickCheckout()}
|
|
542
561
|
style={{ width: '100%', flexDirection: 'row', justifyContent: 'center', borderRadius: 7.6, shadowOpacity: 0 }}
|
|
543
562
|
/>
|
|
544
563
|
</CheckoutAction>
|