ordering-ui-react-native 0.16.38 → 0.16.39-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 +7 -5
- package/src/DeliveryApp.tsx +43 -1
- package/src/components/ActiveOrders/index.tsx +61 -63
- package/src/components/ActiveOrders/styles.tsx +8 -14
- package/src/components/BusinessBasicInformation/index.tsx +11 -19
- package/src/components/BusinessInformation/index.tsx +33 -4
- package/src/components/BusinessInformation/styles.tsx +2 -2
- package/src/components/BusinessProductsList/index.tsx +10 -10
- package/src/components/BusinessesListing/index.tsx +1 -1
- package/src/components/Checkout/index.tsx +2 -1
- package/src/components/LanguageSelector/index.tsx +21 -16
- package/src/components/LoginForm/index.tsx +15 -0
- package/src/components/Messages/index.tsx +2 -2
- package/src/components/NotificationSetting/index.tsx +85 -0
- package/src/components/OrderDetails/index.tsx +2 -20
- package/src/components/OrdersOption/index.tsx +54 -56
- package/src/components/PaymentOptions/index.tsx +335 -365
- package/src/components/PaymentOptionsWebView/index.tsx +120 -121
- package/src/components/ReviewDriver/index.tsx +1 -1
- package/src/components/ReviewOrder/index.tsx +1 -1
- package/src/components/ReviewProducts/index.tsx +11 -0
- package/src/components/SignupForm/index.tsx +15 -0
- package/src/components/SingleProductReview/index.tsx +8 -5
- package/src/components/StripeElementsForm/index.tsx +25 -16
- package/src/components/VerifyPhone/styles.tsx +1 -2
- package/src/components/shared/OBottomPopup.tsx +6 -2
- package/src/index.tsx +2 -0
- package/src/pages/BusinessesListing.tsx +7 -6
- package/src/pages/OrderDetails.tsx +1 -1
- package/src/pages/ReviewDriver.tsx +2 -2
- package/src/pages/ReviewOrder.tsx +2 -2
- package/src/types/@fatnlazycat/react-native-recaptcha-v3/index.d.ts +1 -0
- package/src/utils/index.tsx +2 -1
- package/themes/business/src/components/BusinessController/index.tsx +2 -2
- package/themes/business/src/components/Chat/index.tsx +38 -30
- package/themes/business/src/components/DriverMap/index.tsx +7 -5
- package/themes/business/src/components/DriverSchedule/index.tsx +36 -19
- package/themes/business/src/components/LoginForm/index.tsx +111 -74
- package/themes/business/src/components/MapView/index.tsx +12 -1
- package/themes/business/src/components/MessagesOption/index.tsx +11 -1
- package/themes/business/src/components/NewOrderNotification/index.tsx +26 -41
- package/themes/business/src/components/OrderDetails/Business.tsx +1 -1
- package/themes/business/src/components/OrderDetails/OrderContentComponent.tsx +25 -19
- package/themes/business/src/components/OrdersListManager/index.tsx +10 -3
- package/themes/business/src/components/OrdersOption/index.tsx +65 -21
- package/themes/business/src/components/OrdersOption/styles.tsx +5 -1
- package/themes/business/src/components/OrdersOptionBusiness/index.tsx +15 -1
- package/themes/business/src/components/OrdersOptionCity/index.tsx +15 -1
- package/themes/business/src/components/OrdersOptionDate/index.tsx +19 -6
- package/themes/business/src/components/OrdersOptionDelivery/index.tsx +15 -1
- package/themes/business/src/components/OrdersOptionDriver/index.tsx +15 -1
- package/themes/business/src/components/OrdersOptionPaymethod/index.tsx +15 -1
- package/themes/business/src/components/OrdersOptionStatus/index.tsx +10 -1
- package/themes/business/src/components/PreviousMessages/index.tsx +17 -18
- package/themes/business/src/components/PreviousOrders/index.tsx +22 -24
- package/themes/business/src/components/ProductItemAccordion/index.tsx +3 -2
- package/themes/business/src/components/ReviewCustomer/index.tsx +27 -13
- package/themes/business/src/components/ScheduleBlocked/index.tsx +2 -2
- package/themes/business/src/components/UserFormDetails/index.tsx +5 -2
- package/themes/business/src/components/UserProfileForm/index.tsx +2 -0
- package/themes/business/src/components/shared/ODropDown.tsx +42 -8
- package/themes/business/src/components/shared/ODropDownCalendar.tsx +36 -7
- package/themes/business/src/types/index.tsx +15 -9
- package/themes/business/src/utils/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/BusinessesListing/index.tsx +2 -1
- package/themes/kiosk/src/components/Checkout/index.tsx +6 -0
- package/themes/kiosk/src/components/LoginForm/index.tsx +121 -10
- package/themes/kiosk/src/components/LoginForm/styles.tsx +5 -0
- package/themes/kiosk/src/components/NavBar/index.tsx +14 -14
- package/themes/kiosk/src/components/OptionCard/index.tsx +1 -1
- package/themes/kiosk/src/components/OrderTypeCardSelector/index.tsx +8 -10
- package/themes/kiosk/src/components/ProductForm/index.tsx +1 -14
- package/themes/kiosk/src/components/shared/OButton.tsx +5 -18
- package/themes/kiosk/src/types/index.d.ts +2 -0
- package/themes/original/index.tsx +4 -0
- package/themes/original/src/components/AddressDetails/index.tsx +10 -8
- package/themes/original/src/components/AddressForm/index.tsx +157 -140
- package/themes/original/src/components/AddressList/index.tsx +1 -1
- package/themes/original/src/components/AppleLogin/index.tsx +4 -4
- package/themes/original/src/components/BusinessBasicInformation/index.tsx +260 -176
- package/themes/original/src/components/BusinessBasicInformation/styles.tsx +2 -2
- package/themes/original/src/components/BusinessController/index.tsx +216 -113
- package/themes/original/src/components/BusinessController/styles.tsx +1 -8
- package/themes/original/src/components/BusinessItemAccordion/index.tsx +12 -6
- package/themes/original/src/components/BusinessListingSearch/BusinessControllerSkeletons/index.tsx +57 -0
- package/themes/original/src/components/BusinessListingSearch/MaxSectionItem/index.tsx +59 -0
- package/themes/original/src/components/BusinessListingSearch/MaxSectionItem/styles.tsx +13 -0
- package/themes/original/src/components/BusinessListingSearch/index.tsx +109 -139
- package/themes/original/src/components/BusinessListingSearch/styles.tsx +10 -12
- package/themes/original/src/components/BusinessProductsList/SubcategoriesComponent/index.tsx +87 -0
- package/themes/original/src/components/BusinessProductsList/SubcategoriesComponent/styles.tsx +12 -0
- package/themes/original/src/components/BusinessProductsList/index.tsx +59 -60
- package/themes/original/src/components/BusinessProductsList/styles.tsx +0 -3
- package/themes/original/src/components/BusinessProductsListing/index.tsx +179 -104
- package/themes/original/src/components/BusinessProductsListing/styles.tsx +18 -11
- package/themes/original/src/components/BusinessReviews/index.tsx +6 -1
- package/themes/original/src/components/BusinessTypeFilter/index.tsx +3 -2
- package/themes/original/src/components/BusinessesListing/Layout/Appointment/index.tsx +37 -25
- package/themes/original/src/components/BusinessesListing/Layout/Appointment/styles.tsx +5 -4
- package/themes/original/src/components/BusinessesListing/Layout/Original/index.tsx +255 -108
- package/themes/original/src/components/BusinessesListing/Layout/Original/styles.tsx +47 -10
- package/themes/original/src/components/BusinessesListing/index.tsx +95 -7
- package/themes/original/src/components/Cart/index.tsx +54 -16
- package/themes/original/src/components/Cart/styles.tsx +4 -0
- package/themes/original/src/components/CartContent/index.tsx +22 -16
- package/themes/original/src/components/Checkout/index.tsx +110 -116
- package/themes/original/src/components/Checkout/styles.tsx +4 -3
- package/themes/original/src/components/CitiesControl/index.tsx +89 -0
- package/themes/original/src/components/CitiesControl/styles.tsx +17 -0
- package/themes/original/src/components/DriverTips/index.tsx +4 -4
- package/themes/original/src/components/DriverTips/styles.tsx +2 -1
- package/themes/original/src/components/Favorite/index.tsx +1 -0
- package/themes/original/src/components/FavoriteList/index.tsx +32 -2
- package/themes/original/src/components/FloatingButton/styles.tsx +1 -1
- package/themes/original/src/components/GPSButton/index.tsx +20 -19
- package/themes/original/src/components/GPSButton/styles.ts +3 -3
- package/themes/original/src/components/GoogleMap/index.tsx +20 -12
- package/themes/original/src/components/HelpAccountAndPayment/index.tsx +25 -10
- package/themes/original/src/components/HelpAccountAndPayment/styles.tsx +4 -0
- package/themes/original/src/components/HelpGuide/index.tsx +9 -8
- package/themes/original/src/components/HelpOrder/index.tsx +9 -8
- package/themes/original/src/components/LanguageSelector/index.tsx +19 -14
- package/themes/original/src/components/LoginForm/Otp/index.tsx +95 -73
- package/themes/original/src/components/LoginForm/index.tsx +98 -41
- package/themes/original/src/components/LottieAnimation/index.tsx +69 -0
- package/themes/original/src/components/Messages/index.tsx +17 -17
- package/themes/original/src/components/MomentOption/index.tsx +8 -6
- package/themes/original/src/components/MultiCartsPaymethodsAndWallets/index.tsx +92 -92
- package/themes/original/src/components/MultiCheckout/index.tsx +6 -0
- package/themes/original/src/components/MultiOrdersDetails/index.tsx +20 -16
- package/themes/original/src/components/MyOrders/index.tsx +88 -22
- package/themes/original/src/components/NavBar/index.tsx +15 -9
- package/themes/original/src/components/NetworkError/index.tsx +5 -3
- package/themes/original/src/components/NotFoundSource/index.tsx +2 -1
- package/themes/original/src/components/Notifications/index.tsx +148 -0
- package/themes/original/src/components/Notifications/styles.tsx +17 -0
- package/themes/original/src/components/OrderDetails/OrderHistory.tsx +167 -0
- package/themes/original/src/components/OrderDetails/index.tsx +200 -37
- package/themes/original/src/components/OrderDetails/styles.tsx +15 -2
- package/themes/original/src/components/OrderItAgain/index.tsx +75 -0
- package/themes/original/src/components/OrderItAgain/styles.tsx +10 -0
- package/themes/original/src/components/OrderProgress/index.tsx +77 -66
- package/themes/original/src/components/OrderProgress/styles.tsx +5 -0
- package/themes/original/src/components/OrderSummary/index.tsx +3 -36
- package/themes/original/src/components/OrderTypeSelector/index.tsx +85 -36
- package/themes/original/src/components/OrderTypeSelector/styles.tsx +19 -1
- package/themes/original/src/components/OrdersOption/PreviousBusinessOrdered/index.tsx +97 -106
- package/themes/original/src/components/OrdersOption/PreviousProductsOrdered/index.tsx +3 -0
- package/themes/original/src/components/OrdersOption/index.tsx +71 -55
- package/themes/original/src/components/PaymentOptionWallet/index.tsx +56 -56
- package/themes/original/src/components/PaymentOptions/index.tsx +41 -23
- package/themes/original/src/components/PhoneInputNumber/index.tsx +5 -11
- package/themes/original/src/components/PlaceSpot/index.tsx +243 -47
- package/themes/original/src/components/PlaceSpot/styles.tsx +0 -2
- package/themes/original/src/components/PreviousOrders/index.tsx +3 -2
- package/themes/original/src/components/ProductForm/index.tsx +639 -664
- package/themes/original/src/components/ProductForm/styles.tsx +10 -11
- package/themes/original/src/components/ProductItemAccordion/index.tsx +199 -128
- package/themes/original/src/components/ProductOption/index.tsx +1 -1
- package/themes/original/src/components/ProductOptionSubOption/index.tsx +16 -8
- package/themes/original/src/components/ProductOptionSubOption/styles.tsx +0 -1
- package/themes/original/src/components/ProfessionalFilter/index.tsx +2 -1
- package/themes/original/src/components/ProfessionalProfile/index.tsx +26 -14
- package/themes/original/src/components/Promotions/index.tsx +232 -219
- package/themes/original/src/components/Promotions/styles.tsx +7 -2
- package/themes/original/src/components/ReviewDriver/index.tsx +7 -7
- package/themes/original/src/components/ReviewOrder/index.tsx +18 -3
- package/themes/original/src/components/ReviewProducts/index.tsx +2 -2
- package/themes/original/src/components/ReviewTrigger/index.tsx +118 -0
- package/themes/original/src/components/ReviewTrigger/styles.tsx +34 -0
- package/themes/original/src/components/SearchBar/index.tsx +5 -3
- package/themes/original/src/components/ServiceForm/index.tsx +410 -258
- package/themes/original/src/components/SignupForm/index.tsx +184 -127
- package/themes/original/src/components/SingleOrderCard/index.tsx +229 -181
- package/themes/original/src/components/SingleOrderCard/styles.tsx +0 -7
- package/themes/original/src/components/SingleProductCard/index.tsx +198 -112
- package/themes/original/src/components/SingleProductCard/styles.tsx +3 -10
- package/themes/original/src/components/SingleProductReview/index.tsx +38 -5
- package/themes/original/src/components/SingleProductReview/styles.tsx +12 -0
- package/themes/original/src/components/StripeElementsForm/index.tsx +18 -7
- package/themes/original/src/components/UpsellingProducts/index.tsx +15 -5
- package/themes/original/src/components/UserDetails/index.tsx +5 -3
- package/themes/original/src/components/UserFormDetails/index.tsx +6 -48
- package/themes/original/src/components/UserProfile/index.tsx +56 -31
- package/themes/original/src/components/UserProfile/styles.ts +17 -0
- package/themes/original/src/components/UserProfileForm/index.tsx +10 -10
- package/themes/original/src/components/WalletTransactions/index.tsx +76 -0
- package/themes/original/src/components/WalletTransactions/styles.tsx +13 -0
- package/themes/original/src/components/Wallets/index.tsx +176 -164
- package/themes/original/src/components/Wallets/styles.tsx +12 -8
- package/themes/original/src/components/shared/CardAnimation.tsx +47 -0
- package/themes/original/src/components/shared/HeaderTitle.tsx +8 -3
- package/themes/original/src/components/shared/OBottomPopup.tsx +48 -15
- package/themes/original/src/components/shared/OButton.tsx +10 -3
- package/themes/original/src/components/shared/OIcon.tsx +8 -1
- package/themes/original/src/components/shared/OInput.tsx +13 -3
- package/themes/original/src/layouts/Container.tsx +13 -9
- package/themes/original/src/layouts/FloatingBottomContainer.tsx +5 -1
- package/themes/original/src/types/index.tsx +82 -29
- package/themes/original/src/utils/index.tsx +121 -10
- package/themes/uber-eats/src/components/BusinessesListing/index.tsx +1 -1
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React, { useCallback, useEffect, useRef, useState } from 'react';
|
|
2
2
|
import { Fade, Placeholder, PlaceholderLine } from 'rn-placeholder';
|
|
3
|
+
import { IOScrollView } from 'react-native-intersection-observer'
|
|
3
4
|
import Geolocation from '@react-native-community/geolocation'
|
|
4
5
|
import { getTrackingStatus, requestTrackingPermission } from 'react-native-tracking-transparency'
|
|
5
6
|
import {
|
|
@@ -21,6 +22,7 @@ import {
|
|
|
21
22
|
} from 'ordering-components/native';
|
|
22
23
|
import { useTheme } from 'styled-components/native';
|
|
23
24
|
import Ionicons from 'react-native-vector-icons/Ionicons'
|
|
25
|
+
import IconAntDesign from 'react-native-vector-icons/AntDesign';
|
|
24
26
|
|
|
25
27
|
import {
|
|
26
28
|
Search,
|
|
@@ -32,7 +34,7 @@ import {
|
|
|
32
34
|
FeaturedWrapper,
|
|
33
35
|
OrderProgressWrapper,
|
|
34
36
|
FarAwayMessage,
|
|
35
|
-
|
|
37
|
+
SearchBarWrapper,
|
|
36
38
|
MomentWrapper,
|
|
37
39
|
FilterWrapper,
|
|
38
40
|
ServiceWrapper,
|
|
@@ -70,8 +72,8 @@ const BusinessesListingUI = (props: BusinessesListingParams) => {
|
|
|
70
72
|
isGuestUser,
|
|
71
73
|
handleUpdateBusinessList,
|
|
72
74
|
priceLevelSelected,
|
|
73
|
-
|
|
74
|
-
|
|
75
|
+
handleChangePriceLevel,
|
|
76
|
+
businessTypeSelected
|
|
75
77
|
} = props;
|
|
76
78
|
const theme = useTheme();
|
|
77
79
|
const isFocused = useIsFocused();
|
|
@@ -104,8 +106,8 @@ const BusinessesListingUI = (props: BusinessesListingParams) => {
|
|
|
104
106
|
},
|
|
105
107
|
searchInput: {
|
|
106
108
|
fontSize: 12,
|
|
107
|
-
|
|
108
|
-
|
|
109
|
+
paddingLeft: 0,
|
|
110
|
+
paddingRight: 17,
|
|
109
111
|
paddingTop: 7
|
|
110
112
|
},
|
|
111
113
|
iconStyle: {
|
|
@@ -269,7 +271,7 @@ const BusinessesListingUI = (props: BusinessesListingParams) => {
|
|
|
269
271
|
}, [businessesList?.businesses?.length])
|
|
270
272
|
|
|
271
273
|
return (
|
|
272
|
-
<
|
|
274
|
+
<IOScrollView style={styles.container} onScroll={(e) => handleScroll(e)} showsVerticalScrollIndicator={false}
|
|
273
275
|
refreshControl={
|
|
274
276
|
<RefreshControl
|
|
275
277
|
refreshing={refreshing}
|
|
@@ -282,7 +284,7 @@ const BusinessesListingUI = (props: BusinessesListingParams) => {
|
|
|
282
284
|
style={{ paddingTop: top + 20 }}>
|
|
283
285
|
{!auth && (
|
|
284
286
|
<TouchableOpacity onPress={() => navigation?.canGoBack() && navigation.goBack()} style={{ position: 'absolute', marginStart: 40, paddingVertical: 20 }}>
|
|
285
|
-
<
|
|
287
|
+
<IconAntDesign name='arrowleft' size={26} />
|
|
286
288
|
</TouchableOpacity>
|
|
287
289
|
)}
|
|
288
290
|
<Search>
|
|
@@ -319,7 +321,15 @@ const BusinessesListingUI = (props: BusinessesListingParams) => {
|
|
|
319
321
|
</MomentWrapper>
|
|
320
322
|
<View style={styles.wrapperOrderOptions}>
|
|
321
323
|
<WrapMomentOption onPress={() => navigation.navigate('OrderTypes', { configTypes: configTypes, setOrderTypeValue })}>
|
|
322
|
-
<OText
|
|
324
|
+
<OText
|
|
325
|
+
size={12}
|
|
326
|
+
numberOfLines={1}
|
|
327
|
+
ellipsizeMode={'tail'}
|
|
328
|
+
color={theme.colors.textSecondary}
|
|
329
|
+
style={{ textAlign: 'left' }}
|
|
330
|
+
>
|
|
331
|
+
{t(getTypesText(orderTypeValue || orderState?.options?.type || 1), 'Delivery')}
|
|
332
|
+
</OText>
|
|
323
333
|
<OIcon
|
|
324
334
|
src={theme.images.general.arrow_down}
|
|
325
335
|
width={10}
|
|
@@ -327,22 +337,23 @@ const BusinessesListingUI = (props: BusinessesListingParams) => {
|
|
|
327
337
|
/>
|
|
328
338
|
</WrapMomentOption>
|
|
329
339
|
{!businessId && (
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
340
|
+
<SearchBarWrapper>
|
|
341
|
+
<SearchBar
|
|
342
|
+
onSearch={handleChangeSearch}
|
|
343
|
+
searchValue={searchValue}
|
|
344
|
+
lazyLoad
|
|
345
|
+
isCancelXButtonShow={!!searchValue}
|
|
346
|
+
borderStyle={styles.borderStyle}
|
|
347
|
+
onCancel={() => handleChangeSearch('')}
|
|
348
|
+
placeholder={t('SEARCH', 'Search')}
|
|
349
|
+
height={80}
|
|
350
|
+
isAppointment
|
|
351
|
+
isDisabled={!businessTypes || configs?.advanced_business_search_enabled?.value === '1'}
|
|
352
|
+
inputStyle={{ ...styles.searchInput, ...Platform.OS === 'ios' ? {} : { paddingBottom: 4 } }}
|
|
353
|
+
onPress={() => { configs?.advanced_business_search_enabled?.value === '1' && navigation.navigate('BusinessSearch', { businessTypes }) }}
|
|
354
|
+
onSubmitEditing={() => { configs?.advanced_business_search_enabled?.value === '1' && navigation.navigate('BusinessSearch', { businessTypes, defaultTerm: searchValue }) }}
|
|
355
|
+
/>
|
|
356
|
+
</SearchBarWrapper>
|
|
346
357
|
)}
|
|
347
358
|
</View>
|
|
348
359
|
</OrderControlContainer>
|
|
@@ -463,6 +474,7 @@ const BusinessesListingUI = (props: BusinessesListingParams) => {
|
|
|
463
474
|
(business: any, i: number) => (
|
|
464
475
|
<BusinessController
|
|
465
476
|
key={`${business.id}_` + i}
|
|
477
|
+
enableIntersection
|
|
466
478
|
business={business}
|
|
467
479
|
isBusinessOpen={business.open}
|
|
468
480
|
handleCustomClick={handleBusinessClick}
|
|
@@ -534,7 +546,7 @@ const BusinessesListingUI = (props: BusinessesListingParams) => {
|
|
|
534
546
|
</>
|
|
535
547
|
)}
|
|
536
548
|
</ListWrapper>
|
|
537
|
-
</
|
|
549
|
+
</IOScrollView>
|
|
538
550
|
);
|
|
539
551
|
};
|
|
540
552
|
|
|
@@ -43,8 +43,9 @@ export const WrapMomentOption = styled.TouchableOpacity`
|
|
|
43
43
|
font-size: 12px;
|
|
44
44
|
max-width: 240px;
|
|
45
45
|
height: 26px;
|
|
46
|
+
width: 130px;
|
|
46
47
|
align-items: center;
|
|
47
|
-
justify-content:
|
|
48
|
+
justify-content: space-between;
|
|
48
49
|
padding-horizontal: 8px;
|
|
49
50
|
flex-direction: row;
|
|
50
51
|
margin-end: 12px;
|
|
@@ -84,7 +85,7 @@ export const FarAwayMessage = styled.View`
|
|
|
84
85
|
`
|
|
85
86
|
|
|
86
87
|
export const SearchBarWrapper = styled.View`
|
|
87
|
-
width:
|
|
88
|
+
width: 130px;
|
|
88
89
|
`
|
|
89
90
|
|
|
90
91
|
export const MomentWrapper = styled.View`
|
|
@@ -97,10 +98,10 @@ export const FilterWrapper = styled.View`
|
|
|
97
98
|
`
|
|
98
99
|
|
|
99
100
|
export const ServiceWrapper = styled.View`
|
|
100
|
-
padding-
|
|
101
|
+
padding-horizontal: 40px;
|
|
101
102
|
`
|
|
102
103
|
|
|
103
104
|
export const PriceWrapper = styled.View`
|
|
104
|
-
padding-
|
|
105
|
+
padding-horizontal: 40px;
|
|
105
106
|
margin-top: 30px;
|
|
106
107
|
`
|
|
@@ -1,6 +1,7 @@
|
|
|
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'
|
|
4
5
|
import { getTrackingStatus, requestTrackingPermission } from 'react-native-tracking-transparency'
|
|
5
6
|
import {
|
|
6
7
|
View,
|
|
@@ -18,6 +19,7 @@ import {
|
|
|
18
19
|
useOrder,
|
|
19
20
|
useConfig,
|
|
20
21
|
useUtils,
|
|
22
|
+
useOrderingTheme
|
|
21
23
|
} from 'ordering-components/native';
|
|
22
24
|
import { useTheme } from 'styled-components/native';
|
|
23
25
|
import Ionicons from 'react-native-vector-icons/Ionicons'
|
|
@@ -30,13 +32,14 @@ import {
|
|
|
30
32
|
HeaderWrapper,
|
|
31
33
|
ListWrapper,
|
|
32
34
|
FeaturedWrapper,
|
|
33
|
-
OrderProgressWrapper,
|
|
34
35
|
FarAwayMessage,
|
|
35
|
-
AddressInputContainer
|
|
36
|
+
AddressInputContainer,
|
|
37
|
+
PreorderInput,
|
|
38
|
+
OrderTypesContainer,
|
|
39
|
+
BusinessLogosContainer
|
|
36
40
|
} from './styles';
|
|
37
41
|
|
|
38
|
-
import {
|
|
39
|
-
import { OIcon, OText } from '../../../shared';
|
|
42
|
+
import { OIcon, OText, OModal } from '../../../shared';
|
|
40
43
|
import { BusinessesListingParams } from '../../../../types';
|
|
41
44
|
import { NotFoundSource } from '../../../NotFoundSource';
|
|
42
45
|
import { BusinessTypeFilter } from '../../../BusinessTypeFilter';
|
|
@@ -48,6 +51,9 @@ import { HighestRatedBusinesses } from '../../../HighestRatedBusinesses';
|
|
|
48
51
|
import { getTypesText, convertToRadian } from '../../../../utils';
|
|
49
52
|
import { OrderProgress } from '../../../OrderProgress';
|
|
50
53
|
import { useFocusEffect, useIsFocused } from '@react-navigation/native';
|
|
54
|
+
import FastImage from 'react-native-fast-image';
|
|
55
|
+
import IconAntDesign from 'react-native-vector-icons/AntDesign';
|
|
56
|
+
import { CitiesControl } from '../../../CitiesControl'
|
|
51
57
|
|
|
52
58
|
const PIXELS_TO_SCROLL = 2000;
|
|
53
59
|
|
|
@@ -55,21 +61,25 @@ const BusinessesListingUI = (props: BusinessesListingParams) => {
|
|
|
55
61
|
const {
|
|
56
62
|
navigation,
|
|
57
63
|
businessesList,
|
|
58
|
-
searchValue,
|
|
59
64
|
getBusinesses,
|
|
60
65
|
handleChangeBusinessType,
|
|
61
66
|
handleBusinessClick,
|
|
62
67
|
paginationProps,
|
|
63
|
-
handleChangeSearch,
|
|
64
68
|
businessId,
|
|
65
69
|
isGuestUser,
|
|
66
|
-
handleUpdateBusinessList
|
|
70
|
+
handleUpdateBusinessList,
|
|
71
|
+
citiesState,
|
|
72
|
+
actualSlug,
|
|
73
|
+
logosLayout
|
|
67
74
|
} = props;
|
|
68
75
|
const theme = useTheme();
|
|
76
|
+
const [orderingTheme] = useOrderingTheme()
|
|
69
77
|
const isFocused = useIsFocused();
|
|
70
78
|
const appState = useRef(AppState.currentState)
|
|
71
|
-
const
|
|
79
|
+
const isChewLayout = theme?.header?.components?.layout?.type === 'chew'
|
|
80
|
+
const hideCities = theme?.business_listing_view?.components?.cities?.hidden ?? true
|
|
72
81
|
const [refreshing] = useState(false);
|
|
82
|
+
const bgHeader = orderingTheme?.theme?.business_listing_view?.components?.business_hero?.components?.image
|
|
73
83
|
const styles = StyleSheet.create({
|
|
74
84
|
container: {
|
|
75
85
|
marginBottom: 0,
|
|
@@ -113,13 +123,30 @@ const BusinessesListingUI = (props: BusinessesListingParams) => {
|
|
|
113
123
|
backgroundColor: theme.colors.white,
|
|
114
124
|
borderColor: theme.colors.backgroundGray,
|
|
115
125
|
borderWidth: 1,
|
|
116
|
-
}
|
|
126
|
+
},
|
|
127
|
+
buttonCityStyle: {
|
|
128
|
+
backgroundColor: theme.colors.white,
|
|
129
|
+
borderColor: theme.colors.backgroundGray,
|
|
130
|
+
borderRadius: 8,
|
|
131
|
+
marginHorizontal: 40,
|
|
132
|
+
minHeight: 45,
|
|
133
|
+
paddingVertical: 5,
|
|
134
|
+
paddingHorizontal: 20,
|
|
135
|
+
borderWidth: 1,
|
|
136
|
+
justifyContent: 'center'
|
|
137
|
+
},
|
|
138
|
+
businessSkeleton: {
|
|
139
|
+
borderRadius: 8,
|
|
140
|
+
marginRight: 20,
|
|
141
|
+
width: 56,
|
|
142
|
+
height: 56
|
|
143
|
+
},
|
|
117
144
|
});
|
|
118
145
|
|
|
119
146
|
|
|
120
147
|
const [, t] = useLanguage();
|
|
121
148
|
const [{ user, auth }] = useSession();
|
|
122
|
-
const [orderState] = useOrder();
|
|
149
|
+
const [orderState, { changeCityFilter }] = useOrder();
|
|
123
150
|
const [{ configs }] = useConfig();
|
|
124
151
|
const [{ parseDate }] = useUtils();
|
|
125
152
|
|
|
@@ -129,21 +156,14 @@ const BusinessesListingUI = (props: BusinessesListingParams) => {
|
|
|
129
156
|
const [isFarAway, setIsFarAway] = useState(false)
|
|
130
157
|
const [businessTypes, setBusinessTypes] = useState(null)
|
|
131
158
|
const [orderTypeValue, setOrderTypeValue] = useState(orderState?.options.value)
|
|
159
|
+
const [isOpenCities, setIsOpenCities] = useState(false)
|
|
132
160
|
const isPreorderEnabled = (configs?.preorder_status_enabled?.value === '1' || configs?.preorder_status_enabled?.value === 'true') &&
|
|
133
161
|
Number(configs?.max_days_preorder?.value) > 0
|
|
134
162
|
const isPreOrderSetting = configs?.preorder_status_enabled?.value === '1'
|
|
135
163
|
const timerId = useRef<any>(false)
|
|
136
164
|
const [favoriteIds, setFavoriteIds] = useState<any>([])
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
// PanResponder.create({
|
|
140
|
-
// onMoveShouldSetPanResponder: (e, gestureState) => {
|
|
141
|
-
// const { dx, dy } = gestureState;
|
|
142
|
-
// resetInactivityTimeout()
|
|
143
|
-
// return (Math.abs(dx) > 20) || (Math.abs(dy) > 20);
|
|
144
|
-
// },
|
|
145
|
-
// })
|
|
146
|
-
// ).current
|
|
165
|
+
const chewOrderTypes = [{ name: t('DELIVERY', 'Delivery').toUpperCase(), value: 1 }, { name: t('PICKUP', 'Pickup').toUpperCase(), value: 2 }]
|
|
166
|
+
const enabledPoweredByOrdering = configs?.powered_by_ordering_module?.value
|
|
147
167
|
|
|
148
168
|
const handleMomentClick = () => {
|
|
149
169
|
if (isPreorderEnabled) {
|
|
@@ -163,7 +183,7 @@ const BusinessesListingUI = (props: BusinessesListingParams) => {
|
|
|
163
183
|
paginationProps.totalPages === paginationProps.currentPage
|
|
164
184
|
);
|
|
165
185
|
|
|
166
|
-
if (y + PIXELS_TO_SCROLL > height && !businessesList.loading && hasMore) {
|
|
186
|
+
if (y + PIXELS_TO_SCROLL > height && !businessesList.loading && hasMore && businessesList?.businesses?.length > 0) {
|
|
167
187
|
getBusinesses();
|
|
168
188
|
}
|
|
169
189
|
};
|
|
@@ -180,10 +200,17 @@ const BusinessesListingUI = (props: BusinessesListingParams) => {
|
|
|
180
200
|
}
|
|
181
201
|
|
|
182
202
|
const resetInactivityTimeout = () => {
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
203
|
+
if (!logosLayout) {
|
|
204
|
+
clearTimeout(timerId.current)
|
|
205
|
+
timerId.current = setInterval(() => {
|
|
206
|
+
getBusinesses(true)
|
|
207
|
+
}, 120000)
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
const handleChangeCity = (cityId: number | null) => {
|
|
212
|
+
changeCityFilter(orderState?.options?.city_id === cityId ? null : cityId)
|
|
213
|
+
setIsOpenCities(false)
|
|
187
214
|
}
|
|
188
215
|
|
|
189
216
|
useEffect(() => {
|
|
@@ -224,7 +251,9 @@ const BusinessesListingUI = (props: BusinessesListingParams) => {
|
|
|
224
251
|
}
|
|
225
252
|
|
|
226
253
|
useEffect(() => {
|
|
227
|
-
|
|
254
|
+
if (!logosLayout) {
|
|
255
|
+
checkUserLocation()
|
|
256
|
+
}
|
|
228
257
|
}, [orderState?.options?.address?.location])
|
|
229
258
|
|
|
230
259
|
useEffect(() => {
|
|
@@ -251,8 +280,69 @@ const BusinessesListingUI = (props: BusinessesListingParams) => {
|
|
|
251
280
|
setFavoriteIds([...new Set(ids)])
|
|
252
281
|
}, [businessesList?.businesses?.length])
|
|
253
282
|
|
|
283
|
+
useEffect(() => {
|
|
284
|
+
setIsOpenCities(false)
|
|
285
|
+
}, [orderState?.options?.city_id])
|
|
286
|
+
|
|
287
|
+
if (logosLayout) {
|
|
288
|
+
return (
|
|
289
|
+
<BusinessLogosContainer
|
|
290
|
+
horizontal
|
|
291
|
+
showsHorizontalScrollIndicator={false}
|
|
292
|
+
>
|
|
293
|
+
{businessesList?.loading ? (
|
|
294
|
+
<Placeholder Animation={Fade}>
|
|
295
|
+
<View style={{ flexDirection: 'row' }}>
|
|
296
|
+
{[...Array(10).keys()].map(i => (
|
|
297
|
+
<View style={styles.businessSkeleton} key={i}>
|
|
298
|
+
<PlaceholderLine style={{ width: '100%', height: '100%' }} />
|
|
299
|
+
</View>
|
|
300
|
+
))}
|
|
301
|
+
</View>
|
|
302
|
+
</Placeholder>
|
|
303
|
+
) : (
|
|
304
|
+
<>
|
|
305
|
+
{businessesList.businesses
|
|
306
|
+
?.filter(business => business?.open)
|
|
307
|
+
?.map(business => (
|
|
308
|
+
<TouchableOpacity
|
|
309
|
+
key={business?.id}
|
|
310
|
+
onPress={() => handleBusinessClick && handleBusinessClick(business)}
|
|
311
|
+
style={{
|
|
312
|
+
width: 60,
|
|
313
|
+
height: 60,
|
|
314
|
+
borderRadius: 8,
|
|
315
|
+
marginRight: 5
|
|
316
|
+
}}
|
|
317
|
+
>
|
|
318
|
+
<FastImage
|
|
319
|
+
style={{
|
|
320
|
+
width: 56,
|
|
321
|
+
height: 56,
|
|
322
|
+
marginRight: 20,
|
|
323
|
+
borderRadius: 8,
|
|
324
|
+
borderColor: theme.colors.primary,
|
|
325
|
+
borderWidth: business?.slug === actualSlug ? 2 : 0
|
|
326
|
+
}}
|
|
327
|
+
source={{
|
|
328
|
+
uri: business?.logo,
|
|
329
|
+
priority: FastImage.priority.normal,
|
|
330
|
+
}}
|
|
331
|
+
resizeMode={FastImage.resizeMode.cover}
|
|
332
|
+
/>
|
|
333
|
+
</TouchableOpacity>
|
|
334
|
+
))}
|
|
335
|
+
</>
|
|
336
|
+
)}
|
|
337
|
+
</BusinessLogosContainer>
|
|
338
|
+
)
|
|
339
|
+
}
|
|
340
|
+
|
|
254
341
|
return (
|
|
255
|
-
<
|
|
342
|
+
<IOScrollView
|
|
343
|
+
style={styles.container}
|
|
344
|
+
onScroll={(e) => handleScroll(e)}
|
|
345
|
+
showsVerticalScrollIndicator={false}
|
|
256
346
|
refreshControl={
|
|
257
347
|
<RefreshControl
|
|
258
348
|
refreshing={refreshing}
|
|
@@ -260,9 +350,29 @@ const BusinessesListingUI = (props: BusinessesListingParams) => {
|
|
|
260
350
|
/>
|
|
261
351
|
}
|
|
262
352
|
>
|
|
263
|
-
|
|
264
|
-
<
|
|
353
|
+
{enabledPoweredByOrdering && auth && (
|
|
354
|
+
<View style={{ display: 'flex', justifyContent: 'center', alignItems: 'center', top: 20 }}>
|
|
355
|
+
<OText>
|
|
356
|
+
Powered By Ordering.co
|
|
357
|
+
</OText>
|
|
358
|
+
</View>
|
|
359
|
+
)}
|
|
360
|
+
<View style={{
|
|
361
|
+
height: !isPreOrderSetting && isChewLayout ? 150 : isChewLayout ? 200 : isFarAway ? 150 : 100,
|
|
362
|
+
marginTop: Platform.OS == 'ios' ? 0 : 50,
|
|
363
|
+
backgroundColor: isChewLayout ? theme?.colors?.chew : theme.colors?.white
|
|
364
|
+
}}
|
|
365
|
+
>
|
|
366
|
+
{isChewLayout && (
|
|
367
|
+
<View style={{ marginTop: 30, paddingHorizontal: 30, flexDirection: 'row', justifyContent: 'space-between' }}>
|
|
368
|
+
<OText size={24} weight={700} color={theme.colors?.white}>
|
|
369
|
+
{t('WELCOME', 'Welcome')} {user?.name}
|
|
370
|
+
</OText>
|
|
371
|
+
</View>
|
|
372
|
+
)}
|
|
373
|
+
<Search isChewLayout={isChewLayout}>
|
|
265
374
|
<AddressInput
|
|
375
|
+
isChewLayout={isChewLayout}
|
|
266
376
|
onPress={() =>
|
|
267
377
|
auth
|
|
268
378
|
? navigation.navigate('AddressList', { isFromBusinesses: true })
|
|
@@ -272,103 +382,125 @@ const BusinessesListingUI = (props: BusinessesListingParams) => {
|
|
|
272
382
|
isGuestUser: isGuestUser
|
|
273
383
|
})
|
|
274
384
|
}>
|
|
275
|
-
<AddressInputContainer>
|
|
385
|
+
<AddressInputContainer isChewLayout={isChewLayout}>
|
|
276
386
|
<OIcon
|
|
277
387
|
src={theme.images.general.pin}
|
|
278
388
|
color={theme.colors.disabled}
|
|
279
389
|
width={16}
|
|
280
|
-
style={{ marginRight: 10 }}
|
|
390
|
+
style={{ marginRight: isChewLayout ? 0 : 10 }}
|
|
281
391
|
/>
|
|
282
|
-
<OText size={12} numberOfLines={1}>
|
|
392
|
+
<OText size={12} numberOfLines={1} style={{ flex: 1 }}>
|
|
283
393
|
{orderState?.options?.address?.address}
|
|
284
394
|
</OText>
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
395
|
+
{!isChewLayout && (
|
|
396
|
+
<OIcon
|
|
397
|
+
src={theme.images.general.arrow_down}
|
|
398
|
+
width={10}
|
|
399
|
+
style={{ marginStart: 8 }}
|
|
400
|
+
/>
|
|
401
|
+
)}
|
|
290
402
|
</AddressInputContainer>
|
|
291
403
|
</AddressInput>
|
|
292
404
|
</Search>
|
|
293
|
-
{isFarAway && (
|
|
405
|
+
{isFarAway && !isChewLayout && (
|
|
294
406
|
<FarAwayMessage style={styles.farAwayMsg}>
|
|
295
407
|
<Ionicons name='md-warning-outline' style={styles.iconStyle} />
|
|
296
408
|
<OText size={12} numberOfLines={1} ellipsizeMode={'tail'} color={theme.colors.textNormal}>{t('YOU_ARE_FAR_FROM_ADDRESS', 'You are far from this address')}</OText>
|
|
297
409
|
</FarAwayMessage>
|
|
298
410
|
)}
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
411
|
+
{!isChewLayout ? (
|
|
412
|
+
<OrderControlContainer>
|
|
413
|
+
<View style={styles.wrapperOrderOptions}>
|
|
414
|
+
{isPreOrderSetting && (
|
|
415
|
+
<WrapMomentOption
|
|
416
|
+
onPress={() => handleMomentClick()}>
|
|
417
|
+
<OText
|
|
418
|
+
size={12}
|
|
419
|
+
numberOfLines={1}
|
|
420
|
+
ellipsizeMode="tail"
|
|
421
|
+
color={theme.colors.textSecondary}>
|
|
422
|
+
{orderState.options?.moment
|
|
423
|
+
? parseDate(orderState.options?.moment, { outputFormat: configs?.dates_moment_format?.value })
|
|
424
|
+
: t('ASAP_ABBREVIATION', 'ASAP')}
|
|
425
|
+
</OText>
|
|
426
|
+
{isPreorderEnabled && (
|
|
427
|
+
<OIcon
|
|
428
|
+
src={theme.images.general.arrow_down}
|
|
429
|
+
width={10}
|
|
430
|
+
style={{ marginStart: 8 }}
|
|
431
|
+
/>
|
|
432
|
+
)}
|
|
433
|
+
</WrapMomentOption>
|
|
434
|
+
)}
|
|
435
|
+
<WrapMomentOption onPress={() => navigation.navigate('OrderTypes', { configTypes: configTypes, setOrderTypeValue })}>
|
|
436
|
+
<OText size={12} numberOfLines={1} ellipsizeMode={'tail'} color={theme.colors.textSecondary}>{t(getTypesText(orderTypeValue || orderState?.options?.type || 1), 'Delivery')}</OText>
|
|
437
|
+
<OIcon
|
|
438
|
+
src={theme.images.general.arrow_down}
|
|
439
|
+
width={10}
|
|
440
|
+
style={{ marginStart: 8 }}
|
|
441
|
+
/>
|
|
321
442
|
</WrapMomentOption>
|
|
443
|
+
</View>
|
|
444
|
+
</OrderControlContainer>
|
|
445
|
+
) : (
|
|
446
|
+
<>
|
|
447
|
+
{isPreOrderSetting && (
|
|
448
|
+
<View style={{ paddingHorizontal: 30 }}>
|
|
449
|
+
<PreorderInput
|
|
450
|
+
isChewLayout={isChewLayout}
|
|
451
|
+
onPress={() => handleMomentClick()}
|
|
452
|
+
>
|
|
453
|
+
<OText color={theme.colors.textSecondary}>
|
|
454
|
+
{orderState.options?.moment
|
|
455
|
+
? parseDate(orderState.options?.moment, { outputFormat: configs?.dates_moment_format?.value })
|
|
456
|
+
: t('ASAP_ABBREVIATION', 'ASAP')}</OText>
|
|
457
|
+
</PreorderInput>
|
|
458
|
+
</View>
|
|
322
459
|
)}
|
|
323
|
-
|
|
324
|
-
<OText size={12} numberOfLines={1} ellipsizeMode={'tail'} color={theme.colors.textSecondary}>{t(getTypesText(orderTypeValue || orderState?.options?.type || 1), 'Delivery')}</OText>
|
|
325
|
-
<OIcon
|
|
326
|
-
src={theme.images.general.arrow_down}
|
|
327
|
-
width={10}
|
|
328
|
-
style={{ marginStart: 8 }}
|
|
329
|
-
/>
|
|
330
|
-
</WrapMomentOption>
|
|
331
|
-
</View>
|
|
332
|
-
</OrderControlContainer>
|
|
333
|
-
</View>
|
|
334
|
-
<HeaderWrapper
|
|
335
|
-
source={theme.images.general.homeHero}
|
|
336
|
-
style={{ paddingTop: top + 20 }}
|
|
337
|
-
resizeMode='stretch'
|
|
338
|
-
>
|
|
339
|
-
{!auth && (
|
|
340
|
-
<TouchableOpacity onPress={() => navigation?.canGoBack() && navigation.goBack()} style={{ position: 'absolute', marginStart: 40, paddingVertical: 20 }}>
|
|
341
|
-
<OIcon src={theme.images.general.arrow_left} width={20} style={{ tintColor: theme.colors.white }} />
|
|
342
|
-
</TouchableOpacity>
|
|
460
|
+
</>
|
|
343
461
|
)}
|
|
344
|
-
</
|
|
345
|
-
{!
|
|
346
|
-
<
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
462
|
+
</View>
|
|
463
|
+
{!isChewLayout ? (
|
|
464
|
+
<HeaderWrapper
|
|
465
|
+
source={bgHeader ? { uri: bgHeader } : theme.images.backgrounds.business_list_header}
|
|
466
|
+
style={{ paddingTop: top + 20 }}
|
|
467
|
+
resizeMode='cover'
|
|
468
|
+
>
|
|
469
|
+
{!auth && (
|
|
470
|
+
|
|
471
|
+
<TouchableOpacity onPress={() => navigation?.canGoBack() && navigation.goBack()} style={{ position: 'absolute', marginStart: 40, paddingVertical: 20 }}>
|
|
472
|
+
<IconAntDesign name='arrowleft' size={26} />
|
|
473
|
+
</TouchableOpacity>
|
|
474
|
+
)}
|
|
475
|
+
</HeaderWrapper>
|
|
476
|
+
) : (
|
|
477
|
+
<OrderTypesContainer>
|
|
478
|
+
<OrderTypeSelector
|
|
479
|
+
handleChangeBusinessType={handleChangeBusinessType}
|
|
480
|
+
isChewLayout
|
|
481
|
+
chewOrderTypes={chewOrderTypes}
|
|
482
|
+
handleChangeType={setOrderTypeValue}
|
|
483
|
+
/>
|
|
484
|
+
</OrderTypesContainer>
|
|
364
485
|
)}
|
|
365
|
-
<OrderProgressWrapper>
|
|
366
|
-
<OrderProgress
|
|
367
|
-
{...props}
|
|
368
|
-
isFocused={isFocused}
|
|
369
|
-
/>
|
|
370
|
-
</OrderProgressWrapper>
|
|
371
486
|
|
|
487
|
+
{!hideCities && orderTypeValue === 2 && (
|
|
488
|
+
<View style={{ marginTop: 20 }}>
|
|
489
|
+
<TouchableOpacity
|
|
490
|
+
style={styles.buttonCityStyle}
|
|
491
|
+
onPress={() => setIsOpenCities(true)}
|
|
492
|
+
disabled={orderState?.loading}
|
|
493
|
+
>
|
|
494
|
+
<OText size={18} color={theme.colors.backgroundGray} weight='bold' style={{ textAlign: 'center' }}>
|
|
495
|
+
{citiesState?.cities?.find((city: any) => city?.id === orderState?.options?.city_id)?.name || t('FILTER_BY_CITY', 'Filter by city')}
|
|
496
|
+
</OText>
|
|
497
|
+
</TouchableOpacity>
|
|
498
|
+
</View>
|
|
499
|
+
)}
|
|
500
|
+
<OrderProgress
|
|
501
|
+
{...props}
|
|
502
|
+
isFocused={isFocused}
|
|
503
|
+
/>
|
|
372
504
|
{
|
|
373
505
|
!businessId && !props.franchiseId && featuredBusiness && featuredBusiness.length > 0 && (
|
|
374
506
|
<FeaturedWrapper>
|
|
@@ -376,7 +508,9 @@ const BusinessesListingUI = (props: BusinessesListingParams) => {
|
|
|
376
508
|
<ScrollView
|
|
377
509
|
showsHorizontalScrollIndicator={false}
|
|
378
510
|
nestedScrollEnabled
|
|
379
|
-
horizontal
|
|
511
|
+
horizontal
|
|
512
|
+
contentContainerStyle={{ paddingHorizontal: 40 }}
|
|
513
|
+
>
|
|
380
514
|
{featuredBusiness.map((bAry: any, idx) => (
|
|
381
515
|
<View key={'f-listing_' + idx}>
|
|
382
516
|
<BusinessFeaturedController
|
|
@@ -433,6 +567,8 @@ const BusinessesListingUI = (props: BusinessesListingParams) => {
|
|
|
433
567
|
(business: any, i: number) => (
|
|
434
568
|
<BusinessController
|
|
435
569
|
key={`${business.id}_` + i}
|
|
570
|
+
enableIntersection
|
|
571
|
+
isCustomLayout={isChewLayout}
|
|
436
572
|
business={business}
|
|
437
573
|
isBusinessOpen={business.open}
|
|
438
574
|
handleCustomClick={handleBusinessClick}
|
|
@@ -504,7 +640,18 @@ const BusinessesListingUI = (props: BusinessesListingParams) => {
|
|
|
504
640
|
</>
|
|
505
641
|
)}
|
|
506
642
|
</ListWrapper>
|
|
507
|
-
|
|
643
|
+
<OModal
|
|
644
|
+
open={isOpenCities}
|
|
645
|
+
onClose={() => setIsOpenCities(false)}
|
|
646
|
+
title={t('SELECT_A_CITY', 'Select a city')}
|
|
647
|
+
>
|
|
648
|
+
<CitiesControl
|
|
649
|
+
cities={citiesState?.cities}
|
|
650
|
+
onClose={() => setIsOpenCities(false)}
|
|
651
|
+
handleChangeCity={handleChangeCity}
|
|
652
|
+
/>
|
|
653
|
+
</OModal>
|
|
654
|
+
</IOScrollView>
|
|
508
655
|
);
|
|
509
656
|
};
|
|
510
657
|
|