ordering-ui-react-native 0.17.98 → 0.17.99-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 +2 -0
- package/themes/business/src/components/AcceptOrRejectOrder/index.tsx +36 -26
- package/themes/business/src/components/BusinessController/index.tsx +0 -1
- 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 +209 -15
- package/themes/business/src/components/OrderDetails/OrderContentComponent.tsx +84 -37
- 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/StoresList/index.tsx +3 -4
- 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 +24 -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/AddressList/index.tsx +5 -8
- 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 +72 -36
- package/themes/original/src/components/BusinessBasicInformation/styles.tsx +10 -12
- 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/BusinessItemAccordion/index.tsx +21 -23
- package/themes/original/src/components/BusinessListingSearch/MaxSectionItem/index.tsx +1 -1
- package/themes/original/src/components/BusinessListingSearch/index.tsx +346 -340
- package/themes/original/src/components/BusinessListingSearch/styles.tsx +0 -18
- 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 +1 -2
- 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 +137 -32
- package/themes/original/src/components/BusinessProductsListing/styles.tsx +2 -3
- package/themes/original/src/components/BusinessReviews/index.tsx +3 -1
- 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/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/Checkout/index.tsx +323 -42
- package/themes/original/src/components/CitiesControl/index.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 +1 -5
- package/themes/original/src/components/GPSButton/index.tsx +6 -4
- 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 +2 -0
- package/themes/original/src/components/GiftCard/RedeemGiftCard/index.tsx +84 -8
- 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/Home/index.tsx +13 -4
- 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/MomentOption/index.tsx +44 -39
- package/themes/original/src/components/MomentSelector/index.tsx +1 -1
- package/themes/original/src/components/MultiCartsPaymethodsAndWallets/index.tsx +161 -49
- package/themes/original/src/components/MultiCheckout/index.tsx +346 -68
- package/themes/original/src/components/MultiCheckout/styles.tsx +3 -1
- package/themes/original/src/components/MultiOrdersDetails/index.tsx +1 -1
- package/themes/original/src/components/MyOrders/index.tsx +12 -1
- package/themes/original/src/components/NavBar/index.tsx +20 -13
- package/themes/original/src/components/NotFoundSource/index.tsx +14 -10
- package/themes/original/src/components/OrderDetails/OrderEta.tsx +76 -0
- package/themes/original/src/components/OrderDetails/OrderHistory.tsx +21 -5
- package/themes/original/src/components/OrderDetails/index.tsx +50 -38
- package/themes/original/src/components/OrderDetails/styles.tsx +0 -1
- 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/OrderSummary/index.tsx +62 -57
- package/themes/original/src/components/OrderTypeSelector/index.tsx +5 -6
- package/themes/original/src/components/OrdersOption/PreviousProductsOrdered/index.tsx +13 -13
- package/themes/original/src/components/OrdersOption/index.tsx +43 -20
- package/themes/original/src/components/OrdersOption/styles.tsx +1 -1
- 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/index.tsx +65 -34
- package/themes/original/src/components/ProductForm/styles.tsx +3 -3
- package/themes/original/src/components/ProductItemAccordion/index.tsx +8 -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/ProfessionalFilter/SingleProfessionalCard/index.tsx +108 -0
- package/themes/original/src/components/ProfessionalFilter/index.tsx +20 -50
- package/themes/original/src/components/ProfessionalProfile/index.tsx +36 -7
- package/themes/original/src/components/Promotions/index.tsx +2 -2
- package/themes/original/src/components/Promotions/styles.tsx +3 -1
- package/themes/original/src/components/ReviewProducts/index.tsx +16 -7
- package/themes/original/src/components/ScheduleAccordion/index.tsx +3 -3
- package/themes/original/src/components/ServiceForm/index.tsx +40 -20
- 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/index.tsx +3 -8
- package/themes/original/src/components/UserDetails/index.tsx +3 -1
- package/themes/original/src/components/UserFormDetails/index.tsx +84 -19
- package/themes/original/src/components/UserFormDetails/styles.tsx +1 -1
- package/themes/original/src/components/UserProfile/index.tsx +7 -25
- 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/Wallets/index.tsx +51 -61
- package/themes/original/src/components/Wallets/styles.tsx +2 -4
- 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 +3 -3
- package/themes/original/src/types/index.tsx +30 -7
- 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,30 +1,26 @@
|
|
|
1
1
|
import React, { useEffect, useState } from 'react'
|
|
2
|
-
import { useLanguage, BusinessSearchList, useOrder, useUtils, showToast, ToastType } from 'ordering-components/native'
|
|
3
|
-
import { ScrollView, StyleSheet, TouchableOpacity,
|
|
2
|
+
import { useLanguage, BusinessSearchList, useOrder, useUtils, useEvent, showToast, ToastType } from 'ordering-components/native'
|
|
3
|
+
import { ScrollView, StyleSheet, TouchableOpacity, View, Dimensions } from 'react-native'
|
|
4
4
|
import { useSafeAreaInsets } from 'react-native-safe-area-context'
|
|
5
5
|
import { useTheme } from 'styled-components/native'
|
|
6
|
-
import { OButton, OModal, OText } from '../shared'
|
|
6
|
+
import { HeaderTitle, OButton, OModal, OText } from '../shared'
|
|
7
7
|
import { SearchBar } from '../SearchBar';
|
|
8
|
-
import { BusinessController } from '../BusinessController'
|
|
9
8
|
import { NotFoundSource } from '../NotFoundSource'
|
|
10
9
|
import { SingleProductCard } from '../SingleProductCard'
|
|
11
10
|
import AntDesignIcon from 'react-native-vector-icons/AntDesign'
|
|
12
11
|
import {
|
|
13
12
|
SearchWrapper,
|
|
14
|
-
WrapHeader,
|
|
15
13
|
ProductsList,
|
|
16
14
|
SingleBusinessSearch,
|
|
17
15
|
BusinessInfo,
|
|
18
16
|
BusinessInfoItem,
|
|
19
17
|
Metadata,
|
|
20
18
|
SingleBusinessContainer,
|
|
21
|
-
LoadMoreBusinessContainer,
|
|
22
19
|
TagsContainer,
|
|
23
20
|
SortContainer,
|
|
24
21
|
BrandContainer,
|
|
25
22
|
BrandItem,
|
|
26
23
|
PriceFilterWrapper,
|
|
27
|
-
OptionTitle,
|
|
28
24
|
BContainer,
|
|
29
25
|
WrapperButtons
|
|
30
26
|
} from './styles'
|
|
@@ -32,10 +28,12 @@ import FastImage from 'react-native-fast-image'
|
|
|
32
28
|
import { convertHoursToMinutes } from '../../utils'
|
|
33
29
|
import { Fade, Placeholder, PlaceholderLine } from 'rn-placeholder'
|
|
34
30
|
import { BusinessSearchParams } from '../../types'
|
|
35
|
-
import { MyOrders } from '../MyOrders'
|
|
36
31
|
import { useIsFocused } from '@react-navigation/native';
|
|
37
32
|
import { MaxSectionItem } from './MaxSectionItem'
|
|
38
|
-
import {
|
|
33
|
+
import { IOScrollView } from 'react-native-intersection-observer'
|
|
34
|
+
|
|
35
|
+
const PIXELS_TO_SCROLL = 1000
|
|
36
|
+
|
|
39
37
|
export const BusinessListingSearchUI = (props: BusinessSearchParams) => {
|
|
40
38
|
const {
|
|
41
39
|
navigation,
|
|
@@ -43,23 +41,21 @@ export const BusinessListingSearchUI = (props: BusinessSearchParams) => {
|
|
|
43
41
|
onBusinessClick,
|
|
44
42
|
handleChangeTermValue,
|
|
45
43
|
termValue,
|
|
46
|
-
paginationProps,
|
|
47
44
|
handleSearchbusinessAndProducts,
|
|
48
45
|
handleChangeFilters,
|
|
49
46
|
filters,
|
|
50
47
|
businessTypes,
|
|
51
48
|
setFilters,
|
|
52
49
|
brandList,
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
handleUpdateProducts,
|
|
56
|
-
brandId
|
|
50
|
+
paginationProps,
|
|
51
|
+
handleUpdateProducts
|
|
57
52
|
} = props
|
|
58
53
|
|
|
59
54
|
const screenHeight = Dimensions.get('window').height;
|
|
60
55
|
const screenWidth = Dimensions.get('window').width;
|
|
61
56
|
const theme = useTheme()
|
|
62
57
|
const [orderState] = useOrder()
|
|
58
|
+
const [events] = useEvent()
|
|
63
59
|
const { top } = useSafeAreaInsets();
|
|
64
60
|
const [, t] = useLanguage()
|
|
65
61
|
const [{ parsePrice, parseDistance, optimizeImage }] = useUtils();
|
|
@@ -77,6 +73,7 @@ export const BusinessListingSearchUI = (props: BusinessSearchParams) => {
|
|
|
77
73
|
]
|
|
78
74
|
|
|
79
75
|
const isChewLayout = theme?.header?.components?.layout?.type?.toLowerCase() === 'chew'
|
|
76
|
+
const hideBrowse = theme?.bar_menu?.components?.browse?.hidden
|
|
80
77
|
|
|
81
78
|
const priceList = [
|
|
82
79
|
{ level: '1', content: '$' },
|
|
@@ -100,6 +97,7 @@ export const BusinessListingSearchUI = (props: BusinessSearchParams) => {
|
|
|
100
97
|
},
|
|
101
98
|
searchInput: {
|
|
102
99
|
fontSize: 12,
|
|
100
|
+
height: 44
|
|
103
101
|
},
|
|
104
102
|
productsContainer: {
|
|
105
103
|
marginTop: 20
|
|
@@ -217,6 +215,25 @@ export const BusinessListingSearchUI = (props: BusinessSearchParams) => {
|
|
|
217
215
|
})
|
|
218
216
|
}
|
|
219
217
|
|
|
218
|
+
const handleScroll = ({ nativeEvent }: any) => {
|
|
219
|
+
const y = nativeEvent.contentOffset.y;
|
|
220
|
+
const height = nativeEvent.contentSize.height;
|
|
221
|
+
const hasMore = !(
|
|
222
|
+
paginationProps.totalPages === paginationProps.currentPage
|
|
223
|
+
);
|
|
224
|
+
|
|
225
|
+
if (y + PIXELS_TO_SCROLL > height && !businessesSearchList.loading && hasMore && businessesSearchList?.businesses?.length > 0) {
|
|
226
|
+
handleSearchbusinessAndProducts();
|
|
227
|
+
}
|
|
228
|
+
};
|
|
229
|
+
|
|
230
|
+
const onChangeTermValue = (query: any) => {
|
|
231
|
+
handleChangeTermValue(query)
|
|
232
|
+
if (query) {
|
|
233
|
+
events.emit('products_searched', query)
|
|
234
|
+
}
|
|
235
|
+
}
|
|
236
|
+
|
|
220
237
|
useEffect(() => {
|
|
221
238
|
if (filters.business_types?.length === 0 && filters.orderBy === 'default' && Object.keys(filters)?.length === 2 && !openFilters) {
|
|
222
239
|
handleSearchbusinessAndProducts(true)
|
|
@@ -233,351 +250,340 @@ export const BusinessListingSearchUI = (props: BusinessSearchParams) => {
|
|
|
233
250
|
}, [isFocused])
|
|
234
251
|
|
|
235
252
|
return (
|
|
236
|
-
<
|
|
237
|
-
|
|
253
|
+
<IOScrollView
|
|
254
|
+
onScroll={(e: any) => handleScroll(e)}
|
|
255
|
+
showsVerticalScrollIndicator={false}
|
|
238
256
|
>
|
|
239
|
-
<
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
<OText size={12} lineHeight={20} color={theme.colors.textThird} mLeft={5}>
|
|
251
|
-
{t('TYPE_AT_LEAST_3_CHARACTERS', 'Type at least 3 characters')}
|
|
252
|
-
</OText>
|
|
253
|
-
{
|
|
254
|
-
noResults && (
|
|
255
|
-
<View>
|
|
256
|
-
<NotFoundSource
|
|
257
|
-
content={t('NOT_FOUND_BUSINESSES', 'No businesses to delivery / pick up at this address, please change filters or change address.')}
|
|
258
|
-
/>
|
|
259
|
-
</View>
|
|
260
|
-
)
|
|
261
|
-
}
|
|
262
|
-
{businessesSearchList.businesses?.length > 0 && termValue?.length === 0 && (
|
|
263
|
-
<MyOrders
|
|
264
|
-
hideOrders
|
|
265
|
-
businessesSearchList={businessesSearchList}
|
|
266
|
-
onNavigationRedirect={onNavigationRedirect}
|
|
267
|
-
BusinessControllerSkeletons={BusinessControllerSkeletons}
|
|
268
|
-
businessPaginationProps={paginationProps}
|
|
269
|
-
franchiseId={brandId}
|
|
270
|
-
hideBackBtn
|
|
271
|
-
titleStyle={{
|
|
272
|
-
paddingHorizontal: 0,
|
|
273
|
-
marginTop: 0,
|
|
274
|
-
marginLeft: 0
|
|
275
|
-
}}
|
|
276
|
-
/>
|
|
277
|
-
)}
|
|
278
|
-
|
|
279
|
-
{businessesSearchList.businesses?.length > 0 && (
|
|
280
|
-
<OptionTitle isBusinessesSearchList={!!businessesSearchList}>
|
|
281
|
-
<OText size={16} lineHeight={24} weight={'500'} color={theme.colors.textNormal} mBottom={10}>
|
|
282
|
-
{t('BUSINESSES', 'Businesses')}
|
|
283
|
-
</OText>
|
|
284
|
-
</OptionTitle>
|
|
285
|
-
)}
|
|
286
|
-
<ScrollView horizontal showsHorizontalScrollIndicator={false}>
|
|
287
|
-
{businessesSearchList.businesses?.length > 0 && businessesSearchList.businesses.map((business: any, i: number) => (
|
|
288
|
-
<View
|
|
289
|
-
key={business.id}
|
|
257
|
+
<View style={{
|
|
258
|
+
width: '100%',
|
|
259
|
+
display: 'flex',
|
|
260
|
+
flexDirection: 'row',
|
|
261
|
+
alignItems: 'center',
|
|
262
|
+
paddingHorizontal: hideBrowse && !isChewLayout ? 40 : 20,
|
|
263
|
+
}}>
|
|
264
|
+
{hideBrowse && !isChewLayout && (
|
|
265
|
+
<OButton
|
|
266
|
+
imgLeftStyle={{ width: 18 }}
|
|
267
|
+
imgRightSrc={null}
|
|
290
268
|
style={{
|
|
291
|
-
|
|
292
|
-
|
|
269
|
+
borderWidth: 0,
|
|
270
|
+
width: 26,
|
|
271
|
+
height: 26,
|
|
272
|
+
backgroundColor: '#FFF',
|
|
273
|
+
borderColor: '#FFF',
|
|
274
|
+
shadowColor: '#FFF',
|
|
275
|
+
paddingLeft: 0,
|
|
276
|
+
paddingRight: 0,
|
|
277
|
+
marginTop: 50,
|
|
293
278
|
}}
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
orderType={orderState?.options?.type}
|
|
302
|
-
/>
|
|
303
|
-
</View>
|
|
304
|
-
))}
|
|
305
|
-
{!businessesSearchList.loading && paginationProps?.totalPages && paginationProps?.currentPage < paginationProps?.totalPages && (
|
|
306
|
-
<LoadMoreBusinessContainer>
|
|
307
|
-
<OButton
|
|
308
|
-
bgColor='transparent'
|
|
309
|
-
borderColor={theme.colors.primary}
|
|
310
|
-
onClick={() => handleSearchbusinessAndProducts()}
|
|
311
|
-
text={t('LOAD_MORE_BUSINESS', 'Load more business')}
|
|
312
|
-
textStyle={{ color: theme.colors.primary }}
|
|
313
|
-
/>
|
|
314
|
-
</LoadMoreBusinessContainer>
|
|
315
|
-
)}
|
|
316
|
-
{businessesSearchList.loading && (
|
|
317
|
-
<BusinessControllerSkeletons paginationProps={paginationProps} />
|
|
279
|
+
onClick={() => props.navigation.goBack()}
|
|
280
|
+
icon={AntDesignIcon}
|
|
281
|
+
iconProps={{
|
|
282
|
+
name: 'arrowleft',
|
|
283
|
+
size: 26
|
|
284
|
+
}}
|
|
285
|
+
/>
|
|
318
286
|
)}
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
{business && parsePrice(business?.delivery_price)}
|
|
344
|
-
</OText>
|
|
345
|
-
</>
|
|
346
|
-
)}
|
|
347
|
-
<OText size={10} mRight={3}>
|
|
348
|
-
{convertHoursToMinutes(orderState?.options?.type === 1 ? business?.delivery_time : business?.pickup_time)}
|
|
349
|
-
</OText>
|
|
350
|
-
<OText size={10}>
|
|
351
|
-
{parseDistance(business?.distance)}
|
|
352
|
-
</OText>
|
|
353
|
-
</Metadata>
|
|
354
|
-
</BusinessInfoItem>
|
|
355
|
-
<OButton
|
|
356
|
-
onClick={() => onBusinessClick(business)}
|
|
357
|
-
textStyle={{ color: theme.colors.primary, fontSize: 10 }}
|
|
358
|
-
text={t('GO_TO_STORE', 'Go to store')}
|
|
359
|
-
bgColor='#F5F9FF'
|
|
360
|
-
borderColor='#fff'
|
|
361
|
-
style={{ borderRadius: 50, paddingLeft: 5, paddingRight: 5, height: 20 }}
|
|
287
|
+
<HeaderTitle ph={20} text={t('SEARCH', 'Search')} />
|
|
288
|
+
<AntDesignIcon name='filter' size={18} style={{ marginLeft: 'auto', marginTop: 55, paddingHorizontal: 20 }} onPress={() => handleOpenfilters()} />
|
|
289
|
+
</View>
|
|
290
|
+
<BContainer
|
|
291
|
+
style={{ paddingHorizontal: isChewLayout ? 20 : 40 }}
|
|
292
|
+
>
|
|
293
|
+
<SearchWrapper>
|
|
294
|
+
<SearchBar
|
|
295
|
+
lazyLoad
|
|
296
|
+
{...(isChewLayout && { height: 55 })}
|
|
297
|
+
inputStyle={{ ...styles.searchInput }}
|
|
298
|
+
placeholder={t('SEARCH_BUSINESSES', 'Search Businesses')}
|
|
299
|
+
onSearch={(val: string) => onChangeTermValue(val)}
|
|
300
|
+
value={termValue}
|
|
301
|
+
/>
|
|
302
|
+
</SearchWrapper>
|
|
303
|
+
<OText size={12} lineHeight={20} color={theme.colors.textThird} mLeft={5}>
|
|
304
|
+
{t('TYPE_AT_LEAST_2_CHARACTERS', 'Type at least 2 characters')}
|
|
305
|
+
</OText>
|
|
306
|
+
{
|
|
307
|
+
noResults && (
|
|
308
|
+
<View>
|
|
309
|
+
<NotFoundSource
|
|
310
|
+
content={t('NOT_FOUND_BUSINESSES', 'No businesses to delivery / pick up at this address, please change filters or change address.')}
|
|
362
311
|
/>
|
|
363
|
-
</
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
312
|
+
</View>
|
|
313
|
+
)
|
|
314
|
+
}
|
|
315
|
+
<ProductsList>
|
|
316
|
+
{businessesSearchList.businesses?.filter((business: any) => business?.categories?.length > 0).map((business: any) => (
|
|
317
|
+
<SingleBusinessSearch key={`card-${business?.id}`}>
|
|
318
|
+
<SingleBusinessContainer>
|
|
319
|
+
<BusinessInfo>
|
|
320
|
+
{(business?.logo || theme.images?.dummies?.businessLogo) && (
|
|
321
|
+
<FastImage
|
|
322
|
+
style={{ height: 48, width: 48 }}
|
|
323
|
+
source={{
|
|
324
|
+
uri: optimizeImage(business?.logo, 'h_120,c_limit'),
|
|
325
|
+
priority: FastImage.priority.normal,
|
|
326
|
+
}}
|
|
327
|
+
resizeMode={FastImage.resizeMode.cover}
|
|
328
|
+
/>
|
|
329
|
+
)}
|
|
330
|
+
</BusinessInfo>
|
|
331
|
+
<BusinessInfoItem>
|
|
332
|
+
<OText size={12}>{business?.name}</OText>
|
|
333
|
+
<Metadata>
|
|
334
|
+
{orderState?.options?.type === 1 && (
|
|
335
|
+
<>
|
|
336
|
+
<OText size={10}>{t('DELIVERY_FEE', 'Delivery fee')}{' '}</OText>
|
|
337
|
+
<OText size={10} mRight={3}>
|
|
338
|
+
{business && parsePrice(business?.delivery_price)}
|
|
339
|
+
</OText>
|
|
340
|
+
</>
|
|
341
|
+
)}
|
|
342
|
+
<OText size={10} mRight={3}>
|
|
343
|
+
{convertHoursToMinutes(orderState?.options?.type === 1 ? business?.delivery_time : business?.pickup_time)}
|
|
344
|
+
</OText>
|
|
345
|
+
<OText size={10}>
|
|
346
|
+
{parseDistance(business?.distance)}
|
|
347
|
+
</OText>
|
|
348
|
+
</Metadata>
|
|
349
|
+
</BusinessInfoItem>
|
|
350
|
+
<OButton
|
|
351
|
+
onClick={() => onBusinessClick(business)}
|
|
352
|
+
textStyle={{ color: theme.colors.primary, fontSize: 10 }}
|
|
353
|
+
text={t('GO_TO_STORE', 'Go to store')}
|
|
354
|
+
style={{
|
|
355
|
+
borderRadius: 23,
|
|
356
|
+
paddingLeft: 10,
|
|
357
|
+
paddingRight: 10,
|
|
358
|
+
height: 23,
|
|
359
|
+
shadowOpacity: 0,
|
|
360
|
+
backgroundColor: theme.colors.primaryContrast,
|
|
361
|
+
borderWidth: 0
|
|
362
|
+
}}
|
|
376
363
|
/>
|
|
377
|
-
|
|
364
|
+
</SingleBusinessContainer>
|
|
365
|
+
<ScrollView horizontal style={styles.productsContainer} contentContainerStyle={{ flexGrow: 1 }}>
|
|
366
|
+
{business?.categories?.map((category: any) => category?.products?.map((product: any, i: number) => (
|
|
367
|
+
<SingleProductCard
|
|
368
|
+
key={product?.id}
|
|
369
|
+
isSoldOut={(product.inventoried && !product.quantity)}
|
|
370
|
+
product={product}
|
|
371
|
+
enableIntersection={false}
|
|
372
|
+
businessId={business?.id}
|
|
373
|
+
onProductClick={(product: any) => onProductClick(business, category?.id, product?.id, product)}
|
|
374
|
+
productAddedToCartLength={0}
|
|
375
|
+
handleUpdateProducts={(productId: number, changes: any) => handleUpdateProducts(productId, category?.id, business?.id, changes)}
|
|
376
|
+
style={{
|
|
377
|
+
width: screenWidth - (category?.products?.length > 1 ? 120 : 80),
|
|
378
|
+
maxWidth: screenWidth - (category?.products?.length > 1 ? 120 : 80),
|
|
379
|
+
marginRight: 20
|
|
380
|
+
}}
|
|
381
|
+
/>
|
|
382
|
+
)))}
|
|
378
383
|
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
<OText
|
|
427
|
-
size={20}
|
|
428
|
-
mBottom={15}
|
|
429
|
-
style={{ marginTop: 10 }}
|
|
430
|
-
>
|
|
431
|
-
{t('FILTER', 'Filter')}
|
|
432
|
-
</OText>
|
|
433
|
-
<SortContainer>
|
|
434
|
-
<OText weight='bold' mBottom={7} size={16}>
|
|
435
|
-
{t('SORT', 'Sort')}
|
|
436
|
-
</OText>
|
|
437
|
-
{sortItems?.filter(item => !(orderState?.options?.type === 1 && item?.value === 'pickup_time') && !(orderState?.options?.type === 2 && item?.value === 'delivery_time'))?.map(item => (
|
|
438
|
-
<TouchableOpacity
|
|
439
|
-
key={item?.value}
|
|
440
|
-
onPress={() => handleChangeFilters('orderBy', item?.value)}
|
|
441
|
-
style={{ marginBottom: 7 }}
|
|
442
|
-
>
|
|
443
|
-
<OText
|
|
444
|
-
weight={filters?.orderBy?.includes(item?.value) ? 'bold' : '500'}
|
|
445
|
-
mBottom={filters?.orderBy?.includes(item?.value) ? 5 : 0}
|
|
446
|
-
>
|
|
447
|
-
{item?.text} {(filters?.orderBy?.includes(item?.value)) && <>{filters?.orderBy?.includes('-') ? <AntDesignIcon name='caretup' /> : <AntDesignIcon name='caretdown' />}</>}
|
|
448
|
-
</OText>
|
|
449
|
-
</TouchableOpacity>
|
|
450
|
-
))}
|
|
451
|
-
</SortContainer>
|
|
452
|
-
<BrandContainer>
|
|
384
|
+
</ScrollView>
|
|
385
|
+
</SingleBusinessSearch>
|
|
386
|
+
))}
|
|
387
|
+
{businessesSearchList?.loading && (
|
|
388
|
+
<>
|
|
389
|
+
{[...Array(3).keys()].map(
|
|
390
|
+
(item, i) => (
|
|
391
|
+
<View key={`skeleton:${i}`} style={{ width: '100%', marginTop: 20 }}>
|
|
392
|
+
<Placeholder key={i} style={{ paddingHorizontal: 5 }} Animation={Fade}>
|
|
393
|
+
<View style={{ flexDirection: 'row' }}>
|
|
394
|
+
<PlaceholderLine
|
|
395
|
+
width={24}
|
|
396
|
+
height={70}
|
|
397
|
+
style={{ marginRight: 10, marginBottom: 10 }}
|
|
398
|
+
/>
|
|
399
|
+
<Placeholder style={{ paddingVertical: 10 }}>
|
|
400
|
+
<PlaceholderLine width={20} style={{ marginBottom: 25 }} />
|
|
401
|
+
<PlaceholderLine width={60} />
|
|
402
|
+
</Placeholder>
|
|
403
|
+
</View>
|
|
404
|
+
</Placeholder>
|
|
405
|
+
<Placeholder style={{ paddingHorizontal: 5, bottom: 10 }} Animation={Fade}>
|
|
406
|
+
<View style={{ flexDirection: 'row-reverse', overflow: 'hidden' }}>
|
|
407
|
+
<PlaceholderLine
|
|
408
|
+
width={24}
|
|
409
|
+
height={70}
|
|
410
|
+
style={{ marginRight: 10, marginBottom: 5 }}
|
|
411
|
+
/>
|
|
412
|
+
<Placeholder style={{ paddingVertical: 10 }}>
|
|
413
|
+
<PlaceholderLine width={60} height={10} />
|
|
414
|
+
<PlaceholderLine width={50} height={10} />
|
|
415
|
+
<PlaceholderLine width={70} height={10} />
|
|
416
|
+
</Placeholder>
|
|
417
|
+
</View>
|
|
418
|
+
</Placeholder>
|
|
419
|
+
</View>
|
|
420
|
+
),
|
|
421
|
+
)}
|
|
422
|
+
</>
|
|
423
|
+
)}
|
|
424
|
+
</ProductsList>
|
|
425
|
+
<OModal
|
|
426
|
+
open={openFilters}
|
|
427
|
+
onCancel={() => handleCloseFilters()}
|
|
428
|
+
onClose={() => handleCloseFilters()}
|
|
429
|
+
>
|
|
430
|
+
<ScrollView style={styles.filterContainer}>
|
|
453
431
|
<OText
|
|
454
|
-
size={
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
style={{ marginBottom: 10 }}
|
|
432
|
+
size={20}
|
|
433
|
+
mBottom={15}
|
|
434
|
+
style={{ marginTop: 10 }}
|
|
458
435
|
>
|
|
459
|
-
{t('
|
|
436
|
+
{t('FILTER', 'Filter')}
|
|
460
437
|
</OText>
|
|
461
|
-
|
|
462
|
-
<
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
438
|
+
<SortContainer>
|
|
439
|
+
<OText weight='bold' mBottom={7} size={16}>
|
|
440
|
+
{t('SORT', 'Sort')}
|
|
441
|
+
</OText>
|
|
442
|
+
{sortItems?.filter(item => !(orderState?.options?.type === 1 && item?.value === 'pickup_time') && !(orderState?.options?.type === 2 && item?.value === 'delivery_time'))?.map(item => (
|
|
443
|
+
<TouchableOpacity
|
|
444
|
+
key={item?.value}
|
|
445
|
+
onPress={() => handleChangeFilters('orderBy', item?.value)}
|
|
446
|
+
style={{ marginBottom: 7 }}
|
|
447
|
+
>
|
|
448
|
+
<OText
|
|
449
|
+
weight={filters?.orderBy?.includes(item?.value) ? 'bold' : '500'}
|
|
450
|
+
mBottom={filters?.orderBy?.includes(item?.value) ? 5 : 0}
|
|
471
451
|
>
|
|
472
|
-
<
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
452
|
+
{item?.text} {(filters?.orderBy?.includes(item?.value)) && <>{filters?.orderBy?.includes('-') ? <AntDesignIcon name='caretup' /> : <AntDesignIcon name='caretdown' />}</>}
|
|
453
|
+
</OText>
|
|
454
|
+
</TouchableOpacity>
|
|
455
|
+
))}
|
|
456
|
+
</SortContainer>
|
|
457
|
+
<BrandContainer>
|
|
458
|
+
<OText
|
|
459
|
+
size={16}
|
|
460
|
+
weight='bold'
|
|
461
|
+
lineHeight={24}
|
|
462
|
+
style={{ marginBottom: 10 }}
|
|
463
|
+
>
|
|
464
|
+
{t('BRANDS', 'Brands')}
|
|
465
|
+
</OText>
|
|
466
|
+
{!brandList?.loading && !brandList?.error && brandList?.brands?.length > 0 && (
|
|
467
|
+
<ScrollView
|
|
468
|
+
style={{ maxHeight: 300, marginBottom: 10 }}
|
|
469
|
+
showsVerticalScrollIndicator={true}
|
|
470
|
+
nestedScrollEnabled={true}
|
|
471
|
+
>
|
|
472
|
+
{brandList?.brands.map((brand: any, i: number) => brand?.enabled && (
|
|
473
|
+
<BrandItem
|
|
474
|
+
key={i}
|
|
475
|
+
onPress={() => handleChangeBrandFilter(brand?.id)}
|
|
476
476
|
>
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
477
|
+
<OText
|
|
478
|
+
size={14}
|
|
479
|
+
weight={'400'}
|
|
480
|
+
lineHeight={24}
|
|
481
|
+
>
|
|
482
|
+
{brand?.name}
|
|
483
|
+
</OText>
|
|
484
|
+
{filters?.franchise_ids?.includes(brand?.id) && (
|
|
485
|
+
<AntDesignIcon
|
|
486
|
+
name='check'
|
|
487
|
+
color={theme.colors.success500}
|
|
488
|
+
size={16}
|
|
489
|
+
/>
|
|
490
|
+
)}
|
|
491
|
+
</BrandItem>
|
|
492
|
+
))}
|
|
493
|
+
</ScrollView>
|
|
494
|
+
)}
|
|
495
|
+
{!brandList?.loading && ((brandList?.brands?.filter((brand: any) => brand?.enabled))?.length === 0) && (
|
|
496
|
+
<OText size={14} weight='400'>{t('NO_RESULTS_FOUND', 'Sorry, no results found')}</OText>
|
|
497
|
+
)}
|
|
498
|
+
</BrandContainer>
|
|
499
|
+
<PriceFilterWrapper>
|
|
500
|
+
<OText
|
|
501
|
+
size={16}
|
|
502
|
+
weight='bold'
|
|
503
|
+
lineHeight={24}
|
|
504
|
+
style={{ marginBottom: 5 }}
|
|
505
|
+
>
|
|
506
|
+
{t('PRICE_RANGE', 'Price range')}
|
|
507
|
+
</OText>
|
|
508
|
+
<View style={styles.priceContainer}>
|
|
509
|
+
{priceList.map((price: any, i: number) => (
|
|
510
|
+
<OButton
|
|
511
|
+
key={i}
|
|
512
|
+
bgColor={(filters?.price_level === price?.level) ? theme.colors.primary : theme.colors.backgroundGray200}
|
|
513
|
+
onClick={() => handleChangePriceRange(price?.level)}
|
|
514
|
+
text={`${price.content} ${(filters?.price_level === price?.level) ? ' X' : ''}`}
|
|
515
|
+
style={styles.priceItem}
|
|
516
|
+
textStyle={{ fontSize: 10, color: (filters?.price_level === price?.level) ? theme.colors.backgroundLight : theme.colors.textNormal }}
|
|
517
|
+
/>
|
|
487
518
|
))}
|
|
488
|
-
</
|
|
519
|
+
</View>
|
|
520
|
+
</PriceFilterWrapper>
|
|
521
|
+
{orderState?.options?.type === 1 && (
|
|
522
|
+
<MaxSectionItem
|
|
523
|
+
filters={filters}
|
|
524
|
+
title={t('MAX_DELIVERY_FEE', 'Max delivery fee')}
|
|
525
|
+
options={maxDeliveryFeeOptions}
|
|
526
|
+
filter='max_delivery_price'
|
|
527
|
+
handleChangeFilters={handleChangeFilters}
|
|
528
|
+
/>
|
|
489
529
|
)}
|
|
490
|
-
{
|
|
491
|
-
<
|
|
530
|
+
{[1, 2].includes(orderState?.options?.type) && (
|
|
531
|
+
<MaxSectionItem
|
|
532
|
+
filters={filters}
|
|
533
|
+
title={orderState?.options?.type === 1 ? t('MAX_DELIVERY_TIME', 'Max delivery time') : t('MAX_PICKUP_TIME', 'Max pickup time')}
|
|
534
|
+
options={maxTimeOptions}
|
|
535
|
+
filter='max_eta'
|
|
536
|
+
handleChangeFilters={handleChangeFilters}
|
|
537
|
+
/>
|
|
492
538
|
)}
|
|
493
|
-
</BrandContainer>
|
|
494
|
-
<PriceFilterWrapper>
|
|
495
|
-
<OText
|
|
496
|
-
size={16}
|
|
497
|
-
weight='bold'
|
|
498
|
-
lineHeight={24}
|
|
499
|
-
style={{ marginBottom: 5 }}
|
|
500
|
-
>
|
|
501
|
-
{t('PRICE_RANGE', 'Price range')}
|
|
502
|
-
</OText>
|
|
503
|
-
<View style={styles.priceContainer}>
|
|
504
|
-
{priceList.map((price: any, i: number) => (
|
|
505
|
-
<OButton
|
|
506
|
-
key={i}
|
|
507
|
-
bgColor={(filters?.price_level === price?.level) ? theme.colors.primary : theme.colors.backgroundGray200}
|
|
508
|
-
onClick={() => handleChangePriceRange(price?.level)}
|
|
509
|
-
text={`${price.content} ${(filters?.price_level === price?.level) ? ' X' : ''}`}
|
|
510
|
-
style={styles.priceItem}
|
|
511
|
-
textStyle={{ fontSize: 10, color: (filters?.price_level === price?.level) ? theme.colors.backgroundLight : theme.colors.textNormal }}
|
|
512
|
-
/>
|
|
513
|
-
))}
|
|
514
|
-
</View>
|
|
515
|
-
</PriceFilterWrapper>
|
|
516
|
-
{orderState?.options?.type === 1 && (
|
|
517
539
|
<MaxSectionItem
|
|
518
540
|
filters={filters}
|
|
519
|
-
title={t('
|
|
520
|
-
options={
|
|
521
|
-
filter='
|
|
541
|
+
title={t('MAX_DISTANCE', 'Max distance')}
|
|
542
|
+
options={maxDistanceOptions}
|
|
543
|
+
filter='max_distance'
|
|
522
544
|
handleChangeFilters={handleChangeFilters}
|
|
523
545
|
/>
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
<
|
|
545
|
-
{
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
onClick={() => handleApplyFilters()}
|
|
566
|
-
/>
|
|
567
|
-
</View>
|
|
568
|
-
<View style={{ width: '50%' }}>
|
|
569
|
-
<OButton
|
|
570
|
-
text={t('CLEAR_FILTERS', 'Clear')}
|
|
571
|
-
bgColor={theme.colors.white}
|
|
572
|
-
borderColor={theme.colors.primary}
|
|
573
|
-
parentStyle={styles.applyButton}
|
|
574
|
-
textStyle={{ color: theme.colors.primary }}
|
|
575
|
-
onClick={() => clearFilters()}
|
|
576
|
-
/>
|
|
577
|
-
</View>
|
|
578
|
-
</WrapperButtons>
|
|
579
|
-
</OModal>
|
|
580
|
-
</BContainer>
|
|
546
|
+
{businessTypes?.length > 0 && (
|
|
547
|
+
<TagsContainer>
|
|
548
|
+
<OText weight='bold' mBottom={7} size={16}>{t('BUSINESS_CATEGORIES', 'Business categories')}</OText>
|
|
549
|
+
<View style={styles.businessTypesContainer}>
|
|
550
|
+
{businessTypes.map((type: any, i: number) => type.enabled && (
|
|
551
|
+
<OButton
|
|
552
|
+
key={type?.id}
|
|
553
|
+
bgColor={(filters?.business_types?.includes(type?.id) || (type?.id === null && filters?.business_types?.length === 0)) ? theme.colors.primary : theme.colors.backgroundGray200}
|
|
554
|
+
onClick={() => handleChangeActiveBusinessType(type)}
|
|
555
|
+
text={`${t(`BUSINESS_TYPE_${type.name.replace(/\s/g, '_').toUpperCase()}`, type.name)} ${filters?.business_types?.includes(type?.id) ? 'X' : ''}`}
|
|
556
|
+
style={styles.categoryStyle}
|
|
557
|
+
textStyle={{ fontSize: 10, color: (filters?.business_types?.includes(type?.id) || (type?.id === null && filters?.business_types?.length === 0)) ? '#fff' : theme.colors.textNormal }}
|
|
558
|
+
/>
|
|
559
|
+
))}
|
|
560
|
+
</View>
|
|
561
|
+
</TagsContainer>
|
|
562
|
+
)}
|
|
563
|
+
</ScrollView>
|
|
564
|
+
<WrapperButtons>
|
|
565
|
+
<View style={{ width: '50%' }}>
|
|
566
|
+
<OButton
|
|
567
|
+
text={t('APPLY', 'Apply')}
|
|
568
|
+
parentStyle={styles.applyButton}
|
|
569
|
+
textStyle={{ color: '#fff' }}
|
|
570
|
+
onClick={() => handleApplyFilters()}
|
|
571
|
+
/>
|
|
572
|
+
</View>
|
|
573
|
+
<View style={{ width: '50%' }}>
|
|
574
|
+
<OButton
|
|
575
|
+
text={t('CLEAR_FILTERS', 'Clear')}
|
|
576
|
+
bgColor={theme.colors.white}
|
|
577
|
+
borderColor={theme.colors.primary}
|
|
578
|
+
parentStyle={styles.applyButton}
|
|
579
|
+
textStyle={{ color: theme.colors.primary }}
|
|
580
|
+
onClick={() => clearFilters()}
|
|
581
|
+
/>
|
|
582
|
+
</View>
|
|
583
|
+
</WrapperButtons>
|
|
584
|
+
</OModal>
|
|
585
|
+
</BContainer>
|
|
586
|
+
</IOScrollView>
|
|
581
587
|
)
|
|
582
588
|
}
|
|
583
589
|
|