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,36 +1,25 @@
|
|
|
1
1
|
import React, { useEffect, useState } from 'react'
|
|
2
2
|
import { useLanguage, BusinessSearchList, useOrder, useUtils, useEvent, showToast, ToastType } from 'ordering-components/native'
|
|
3
|
-
import { ScrollView, StyleSheet,
|
|
4
|
-
import { useSafeAreaInsets } from 'react-native-safe-area-context'
|
|
3
|
+
import { ScrollView, StyleSheet, Dimensions, FlatList } from 'react-native'
|
|
5
4
|
import { useTheme } from 'styled-components/native'
|
|
6
|
-
import {
|
|
7
|
-
|
|
8
|
-
import { NotFoundSource } from '../NotFoundSource'
|
|
5
|
+
import { OButton, OText } from '../shared'
|
|
6
|
+
|
|
9
7
|
import { SingleProductCard } from '../SingleProductCard'
|
|
10
|
-
import AntDesignIcon from 'react-native-vector-icons/AntDesign'
|
|
11
8
|
import {
|
|
12
|
-
SearchWrapper,
|
|
13
|
-
ProductsList,
|
|
14
9
|
SingleBusinessSearch,
|
|
15
10
|
BusinessInfo,
|
|
16
11
|
BusinessInfoItem,
|
|
17
12
|
Metadata,
|
|
18
13
|
SingleBusinessContainer,
|
|
19
|
-
TagsContainer,
|
|
20
|
-
SortContainer,
|
|
21
|
-
BrandContainer,
|
|
22
|
-
BrandItem,
|
|
23
|
-
PriceFilterWrapper,
|
|
24
14
|
BContainer,
|
|
25
|
-
WrapperButtons
|
|
26
15
|
} from './styles'
|
|
27
16
|
import FastImage from 'react-native-fast-image'
|
|
28
17
|
import { convertHoursToMinutes } from '../../utils'
|
|
29
|
-
import { Fade, Placeholder, PlaceholderLine } from 'rn-placeholder'
|
|
30
18
|
import { BusinessSearchParams } from '../../types'
|
|
31
19
|
import { useIsFocused } from '@react-navigation/native';
|
|
32
|
-
|
|
33
|
-
import {
|
|
20
|
+
|
|
21
|
+
import { BusinessSearchHeader } from './BusinessSearchHeader'
|
|
22
|
+
import { BusinessSearchFooter } from './BusinessSearchFooter'
|
|
34
23
|
|
|
35
24
|
const PIXELS_TO_SCROLL = 1000
|
|
36
25
|
|
|
@@ -51,94 +40,20 @@ export const BusinessListingSearchUI = (props: BusinessSearchParams) => {
|
|
|
51
40
|
handleUpdateProducts
|
|
52
41
|
} = props
|
|
53
42
|
|
|
54
|
-
const screenHeight = Dimensions.get('window').height;
|
|
55
43
|
const screenWidth = Dimensions.get('window').width;
|
|
56
44
|
const theme = useTheme()
|
|
57
45
|
const [orderState] = useOrder()
|
|
58
46
|
const [events] = useEvent()
|
|
59
|
-
const { top } = useSafeAreaInsets();
|
|
60
47
|
const [, t] = useLanguage()
|
|
61
48
|
const [{ parsePrice, parseDistance, optimizeImage }] = useUtils();
|
|
62
49
|
|
|
63
50
|
const [openFilters, setOpenFilters] = useState(false)
|
|
64
|
-
const noResults = (!businessesSearchList.loading && !businessesSearchList.lengthError && businessesSearchList?.businesses?.length === 0)
|
|
65
|
-
const maxDeliveryFeeOptions = [15, 25, 35, 'default']
|
|
66
|
-
// const maxProductPriceOptions = [5, 10, 15, 'default']
|
|
67
|
-
const maxDistanceOptions = [1000, 2000, 5000, 'default']
|
|
68
|
-
const maxTimeOptions = [5, 15, 30, 'default']
|
|
69
|
-
const sortItems = [
|
|
70
|
-
{ text: t('PICKED_FOR_YOU', 'Picked for you (default)'), value: 'distance' },
|
|
71
|
-
{ text: t('DELIVERY_TIME', 'Delivery time'), value: 'delivery_time' },
|
|
72
|
-
{ text: t('PICKUP_TIME', 'Pickup time'), value: 'pickup_time' }
|
|
73
|
-
]
|
|
74
|
-
|
|
75
|
-
const isChewLayout = theme?.header?.components?.layout?.type?.toLowerCase() === 'chew'
|
|
76
|
-
const hideBrowse = theme?.bar_menu?.components?.browse?.hidden
|
|
77
|
-
|
|
78
|
-
const priceList = [
|
|
79
|
-
{ level: '1', content: '$' },
|
|
80
|
-
{ level: '2', content: '$$' },
|
|
81
|
-
{ level: '3', content: '$$$' },
|
|
82
|
-
{ level: '4', content: '$$$$' },
|
|
83
|
-
{ level: '5', content: '$$$$$' }
|
|
84
|
-
]
|
|
85
51
|
|
|
86
52
|
const isFocused = useIsFocused();
|
|
87
53
|
|
|
88
54
|
const styles = StyleSheet.create({
|
|
89
|
-
container: {
|
|
90
|
-
paddingHorizontal: 40,
|
|
91
|
-
width: '100%'
|
|
92
|
-
},
|
|
93
|
-
filterContainer: {
|
|
94
|
-
maxHeight: screenHeight - 150,
|
|
95
|
-
paddingHorizontal: 40,
|
|
96
|
-
width: '100%'
|
|
97
|
-
},
|
|
98
|
-
searchInput: {
|
|
99
|
-
fontSize: 12,
|
|
100
|
-
height: 44
|
|
101
|
-
},
|
|
102
55
|
productsContainer: {
|
|
103
56
|
marginTop: 20
|
|
104
|
-
},
|
|
105
|
-
businessTypesContainer: {
|
|
106
|
-
width: '100%',
|
|
107
|
-
flexDirection: 'row',
|
|
108
|
-
flexWrap: 'wrap',
|
|
109
|
-
justifyContent: 'center'
|
|
110
|
-
},
|
|
111
|
-
priceContainer: {
|
|
112
|
-
width: '100%',
|
|
113
|
-
flexDirection: 'row',
|
|
114
|
-
flexWrap: 'wrap',
|
|
115
|
-
justifyContent: 'space-between'
|
|
116
|
-
},
|
|
117
|
-
categoryStyle: {
|
|
118
|
-
marginRight: 10,
|
|
119
|
-
marginTop: 10,
|
|
120
|
-
borderRadius: 50,
|
|
121
|
-
paddingHorizontal: 10,
|
|
122
|
-
paddingVertical: 4,
|
|
123
|
-
paddingLeft: 0,
|
|
124
|
-
paddingRight: 0,
|
|
125
|
-
height: 28,
|
|
126
|
-
borderWidth: 0
|
|
127
|
-
},
|
|
128
|
-
priceItem: {
|
|
129
|
-
marginRight: 10,
|
|
130
|
-
marginTop: 10,
|
|
131
|
-
borderRadius: 50,
|
|
132
|
-
paddingVertical: 4,
|
|
133
|
-
paddingLeft: 5,
|
|
134
|
-
paddingRight: 5,
|
|
135
|
-
height: 27,
|
|
136
|
-
borderWidth: 0
|
|
137
|
-
},
|
|
138
|
-
applyButton: {
|
|
139
|
-
paddingHorizontal: 10,
|
|
140
|
-
width: '100%',
|
|
141
|
-
marginTop: 20
|
|
142
57
|
}
|
|
143
58
|
});
|
|
144
59
|
|
|
@@ -250,71 +165,37 @@ export const BusinessListingSearchUI = (props: BusinessSearchParams) => {
|
|
|
250
165
|
}, [isFocused])
|
|
251
166
|
|
|
252
167
|
return (
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
}}
|
|
285
|
-
/>
|
|
286
|
-
)}
|
|
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.')}
|
|
311
|
-
/>
|
|
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}`}>
|
|
168
|
+
<>
|
|
169
|
+
<FlatList
|
|
170
|
+
data={businessesSearchList.businesses?.filter((business: any) => business?.categories?.length > 0)}
|
|
171
|
+
ListFooterComponent={<BusinessSearchFooter
|
|
172
|
+
businessesSearchList={businessesSearchList}
|
|
173
|
+
handleCloseFilters={handleCloseFilters}
|
|
174
|
+
handleChangeFilters={handleChangeFilters}
|
|
175
|
+
brandList={brandList}
|
|
176
|
+
filters={filters}
|
|
177
|
+
handleChangeBrandFilter={handleChangeBrandFilter}
|
|
178
|
+
handleChangePriceRange={handleChangePriceRange}
|
|
179
|
+
businessTypes={businessTypes}
|
|
180
|
+
handleApplyFilters={handleApplyFilters}
|
|
181
|
+
clearFilters={clearFilters}
|
|
182
|
+
handleChangeActiveBusinessType={handleChangeActiveBusinessType}
|
|
183
|
+
openFilters={openFilters}
|
|
184
|
+
/>}
|
|
185
|
+
ListHeaderComponent={<BusinessSearchHeader
|
|
186
|
+
businessesSearchList={businessesSearchList}
|
|
187
|
+
onChangeTermValue={onChangeTermValue}
|
|
188
|
+
termValue={termValue}
|
|
189
|
+
handleOpenfilters={handleOpenfilters}
|
|
190
|
+
/>}
|
|
191
|
+
onScroll={(e: any) => handleScroll(e)}
|
|
192
|
+
showsVerticalScrollIndicator={false}
|
|
193
|
+
keyExtractor={(business: any, index: number) => `card-${business?.id}-${index}`}
|
|
194
|
+
renderItem={({ item: business }: any) => (
|
|
195
|
+
<BContainer
|
|
196
|
+
style={{ paddingHorizontal: 20, paddingTop: 0, paddingBottom: 0 }}
|
|
197
|
+
>
|
|
198
|
+
<SingleBusinessSearch>
|
|
318
199
|
<SingleBusinessContainer>
|
|
319
200
|
<BusinessInfo>
|
|
320
201
|
{(business?.logo || theme.images?.dummies?.businessLogo) && (
|
|
@@ -351,9 +232,15 @@ export const BusinessListingSearchUI = (props: BusinessSearchParams) => {
|
|
|
351
232
|
onClick={() => onBusinessClick(business)}
|
|
352
233
|
textStyle={{ color: theme.colors.primary, fontSize: 10 }}
|
|
353
234
|
text={t('GO_TO_STORE', 'Go to store')}
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
235
|
+
style={{
|
|
236
|
+
borderRadius: 23,
|
|
237
|
+
paddingLeft: 10,
|
|
238
|
+
paddingRight: 10,
|
|
239
|
+
height: 23,
|
|
240
|
+
shadowOpacity: 0,
|
|
241
|
+
backgroundColor: theme.colors.primaryContrast,
|
|
242
|
+
borderWidth: 0
|
|
243
|
+
}}
|
|
357
244
|
/>
|
|
358
245
|
</SingleBusinessContainer>
|
|
359
246
|
<ScrollView horizontal style={styles.productsContainer} contentContainerStyle={{ flexGrow: 1 }}>
|
|
@@ -374,210 +261,18 @@ export const BusinessListingSearchUI = (props: BusinessSearchParams) => {
|
|
|
374
261
|
}}
|
|
375
262
|
/>
|
|
376
263
|
)))}
|
|
377
|
-
|
|
378
264
|
</ScrollView>
|
|
379
265
|
</SingleBusinessSearch>
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
height={70}
|
|
391
|
-
style={{ marginRight: 10, marginBottom: 10 }}
|
|
392
|
-
/>
|
|
393
|
-
<Placeholder style={{ paddingVertical: 10 }}>
|
|
394
|
-
<PlaceholderLine width={20} style={{ marginBottom: 25 }} />
|
|
395
|
-
<PlaceholderLine width={60} />
|
|
396
|
-
</Placeholder>
|
|
397
|
-
</View>
|
|
398
|
-
</Placeholder>
|
|
399
|
-
<Placeholder style={{ paddingHorizontal: 5, bottom: 10 }} Animation={Fade}>
|
|
400
|
-
<View style={{ flexDirection: 'row-reverse', overflow: 'hidden' }}>
|
|
401
|
-
<PlaceholderLine
|
|
402
|
-
width={24}
|
|
403
|
-
height={70}
|
|
404
|
-
style={{ marginRight: 10, marginBottom: 5 }}
|
|
405
|
-
/>
|
|
406
|
-
<Placeholder style={{ paddingVertical: 10 }}>
|
|
407
|
-
<PlaceholderLine width={60} height={10} />
|
|
408
|
-
<PlaceholderLine width={50} height={10} />
|
|
409
|
-
<PlaceholderLine width={70} height={10} />
|
|
410
|
-
</Placeholder>
|
|
411
|
-
</View>
|
|
412
|
-
</Placeholder>
|
|
413
|
-
</View>
|
|
414
|
-
),
|
|
415
|
-
)}
|
|
416
|
-
</>
|
|
417
|
-
)}
|
|
418
|
-
</ProductsList>
|
|
419
|
-
<OModal
|
|
420
|
-
open={openFilters}
|
|
421
|
-
onCancel={() => handleCloseFilters()}
|
|
422
|
-
onClose={() => handleCloseFilters()}
|
|
423
|
-
>
|
|
424
|
-
<ScrollView style={styles.filterContainer}>
|
|
425
|
-
<OText
|
|
426
|
-
size={20}
|
|
427
|
-
mBottom={15}
|
|
428
|
-
style={{ marginTop: 10 }}
|
|
429
|
-
>
|
|
430
|
-
{t('FILTER', 'Filter')}
|
|
431
|
-
</OText>
|
|
432
|
-
<SortContainer>
|
|
433
|
-
<OText weight='bold' mBottom={7} size={16}>
|
|
434
|
-
{t('SORT', 'Sort')}
|
|
435
|
-
</OText>
|
|
436
|
-
{sortItems?.filter(item => !(orderState?.options?.type === 1 && item?.value === 'pickup_time') && !(orderState?.options?.type === 2 && item?.value === 'delivery_time'))?.map(item => (
|
|
437
|
-
<TouchableOpacity
|
|
438
|
-
key={item?.value}
|
|
439
|
-
onPress={() => handleChangeFilters('orderBy', item?.value)}
|
|
440
|
-
style={{ marginBottom: 7 }}
|
|
441
|
-
>
|
|
442
|
-
<OText
|
|
443
|
-
weight={filters?.orderBy?.includes(item?.value) ? 'bold' : '500'}
|
|
444
|
-
mBottom={filters?.orderBy?.includes(item?.value) ? 5 : 0}
|
|
445
|
-
>
|
|
446
|
-
{item?.text} {(filters?.orderBy?.includes(item?.value)) && <>{filters?.orderBy?.includes('-') ? <AntDesignIcon name='caretup' /> : <AntDesignIcon name='caretdown' />}</>}
|
|
447
|
-
</OText>
|
|
448
|
-
</TouchableOpacity>
|
|
449
|
-
))}
|
|
450
|
-
</SortContainer>
|
|
451
|
-
<BrandContainer>
|
|
452
|
-
<OText
|
|
453
|
-
size={16}
|
|
454
|
-
weight='bold'
|
|
455
|
-
lineHeight={24}
|
|
456
|
-
style={{ marginBottom: 10 }}
|
|
457
|
-
>
|
|
458
|
-
{t('BRANDS', 'Brands')}
|
|
459
|
-
</OText>
|
|
460
|
-
{!brandList?.loading && !brandList?.error && brandList?.brands?.length > 0 && (
|
|
461
|
-
<ScrollView
|
|
462
|
-
style={{ maxHeight: 300, marginBottom: 10 }}
|
|
463
|
-
showsVerticalScrollIndicator={true}
|
|
464
|
-
nestedScrollEnabled={true}
|
|
465
|
-
>
|
|
466
|
-
{brandList?.brands.map((brand: any, i: number) => brand?.enabled && (
|
|
467
|
-
<BrandItem
|
|
468
|
-
key={i}
|
|
469
|
-
onPress={() => handleChangeBrandFilter(brand?.id)}
|
|
470
|
-
>
|
|
471
|
-
<OText
|
|
472
|
-
size={14}
|
|
473
|
-
weight={'400'}
|
|
474
|
-
lineHeight={24}
|
|
475
|
-
>
|
|
476
|
-
{brand?.name}
|
|
477
|
-
</OText>
|
|
478
|
-
{filters?.franchise_ids?.includes(brand?.id) && (
|
|
479
|
-
<AntDesignIcon
|
|
480
|
-
name='check'
|
|
481
|
-
color={theme.colors.success500}
|
|
482
|
-
size={16}
|
|
483
|
-
/>
|
|
484
|
-
)}
|
|
485
|
-
</BrandItem>
|
|
486
|
-
))}
|
|
487
|
-
</ScrollView>
|
|
488
|
-
)}
|
|
489
|
-
{!brandList?.loading && ((brandList?.brands?.filter((brand: any) => brand?.enabled))?.length === 0) && (
|
|
490
|
-
<OText size={14} weight='400'>{t('NO_RESULTS_FOUND', 'Sorry, no results found')}</OText>
|
|
491
|
-
)}
|
|
492
|
-
</BrandContainer>
|
|
493
|
-
<PriceFilterWrapper>
|
|
494
|
-
<OText
|
|
495
|
-
size={16}
|
|
496
|
-
weight='bold'
|
|
497
|
-
lineHeight={24}
|
|
498
|
-
style={{ marginBottom: 5 }}
|
|
499
|
-
>
|
|
500
|
-
{t('PRICE_RANGE', 'Price range')}
|
|
501
|
-
</OText>
|
|
502
|
-
<View style={styles.priceContainer}>
|
|
503
|
-
{priceList.map((price: any, i: number) => (
|
|
504
|
-
<OButton
|
|
505
|
-
key={i}
|
|
506
|
-
bgColor={(filters?.price_level === price?.level) ? theme.colors.primary : theme.colors.backgroundGray200}
|
|
507
|
-
onClick={() => handleChangePriceRange(price?.level)}
|
|
508
|
-
text={`${price.content} ${(filters?.price_level === price?.level) ? ' X' : ''}`}
|
|
509
|
-
style={styles.priceItem}
|
|
510
|
-
textStyle={{ fontSize: 10, color: (filters?.price_level === price?.level) ? theme.colors.backgroundLight : theme.colors.textNormal }}
|
|
511
|
-
/>
|
|
512
|
-
))}
|
|
513
|
-
</View>
|
|
514
|
-
</PriceFilterWrapper>
|
|
515
|
-
{orderState?.options?.type === 1 && (
|
|
516
|
-
<MaxSectionItem
|
|
517
|
-
filters={filters}
|
|
518
|
-
title={t('MAX_DELIVERY_FEE', 'Max delivery fee')}
|
|
519
|
-
options={maxDeliveryFeeOptions}
|
|
520
|
-
filter='max_delivery_price'
|
|
521
|
-
handleChangeFilters={handleChangeFilters}
|
|
522
|
-
/>
|
|
523
|
-
)}
|
|
524
|
-
{[1, 2].includes(orderState?.options?.type) && (
|
|
525
|
-
<MaxSectionItem
|
|
526
|
-
filters={filters}
|
|
527
|
-
title={orderState?.options?.type === 1 ? t('MAX_DELIVERY_TIME', 'Max delivery time') : t('MAX_PICKUP_TIME', 'Max pickup time')}
|
|
528
|
-
options={maxTimeOptions}
|
|
529
|
-
filter='max_eta'
|
|
530
|
-
handleChangeFilters={handleChangeFilters}
|
|
531
|
-
/>
|
|
532
|
-
)}
|
|
533
|
-
<MaxSectionItem
|
|
534
|
-
filters={filters}
|
|
535
|
-
title={t('MAX_DISTANCE', 'Max distance')}
|
|
536
|
-
options={maxDistanceOptions}
|
|
537
|
-
filter='max_distance'
|
|
538
|
-
handleChangeFilters={handleChangeFilters}
|
|
539
|
-
/>
|
|
540
|
-
{businessTypes?.length > 0 && (
|
|
541
|
-
<TagsContainer>
|
|
542
|
-
<OText weight='bold' mBottom={7} size={16}>{t('BUSINESS_CATEGORIES', 'Business categories')}</OText>
|
|
543
|
-
<View style={styles.businessTypesContainer}>
|
|
544
|
-
{businessTypes.map((type: any, i: number) => type.enabled && (
|
|
545
|
-
<OButton
|
|
546
|
-
key={type?.id}
|
|
547
|
-
bgColor={(filters?.business_types?.includes(type?.id) || (type?.id === null && filters?.business_types?.length === 0)) ? theme.colors.primary : theme.colors.backgroundGray200}
|
|
548
|
-
onClick={() => handleChangeActiveBusinessType(type)}
|
|
549
|
-
text={`${t(`BUSINESS_TYPE_${type.name.replace(/\s/g, '_').toUpperCase()}`, type.name)} ${filters?.business_types?.includes(type?.id) ? 'X' : ''}`}
|
|
550
|
-
style={styles.categoryStyle}
|
|
551
|
-
textStyle={{ fontSize: 10, color: (filters?.business_types?.includes(type?.id) || (type?.id === null && filters?.business_types?.length === 0)) ? '#fff' : theme.colors.textNormal }}
|
|
552
|
-
/>
|
|
553
|
-
))}
|
|
554
|
-
</View>
|
|
555
|
-
</TagsContainer>
|
|
556
|
-
)}
|
|
557
|
-
</ScrollView>
|
|
558
|
-
<WrapperButtons>
|
|
559
|
-
<View style={{ width: '50%' }}>
|
|
560
|
-
<OButton
|
|
561
|
-
text={t('APPLY', 'Apply')}
|
|
562
|
-
parentStyle={styles.applyButton}
|
|
563
|
-
textStyle={{ color: '#fff' }}
|
|
564
|
-
onClick={() => handleApplyFilters()}
|
|
565
|
-
/>
|
|
566
|
-
</View>
|
|
567
|
-
<View style={{ width: '50%' }}>
|
|
568
|
-
<OButton
|
|
569
|
-
text={t('CLEAR_FILTERS', 'Clear')}
|
|
570
|
-
bgColor={theme.colors.white}
|
|
571
|
-
borderColor={theme.colors.primary}
|
|
572
|
-
parentStyle={styles.applyButton}
|
|
573
|
-
textStyle={{ color: theme.colors.primary }}
|
|
574
|
-
onClick={() => clearFilters()}
|
|
575
|
-
/>
|
|
576
|
-
</View>
|
|
577
|
-
</WrapperButtons>
|
|
578
|
-
</OModal>
|
|
579
|
-
</BContainer>
|
|
580
|
-
</IOScrollView>
|
|
266
|
+
</BContainer>
|
|
267
|
+
)}
|
|
268
|
+
/>
|
|
269
|
+
{/* <IOScrollView
|
|
270
|
+
onScroll={(e: any) => handleScroll(e)}
|
|
271
|
+
showsVerticalScrollIndicator={false}
|
|
272
|
+
>
|
|
273
|
+
|
|
274
|
+
</IOScrollView> */}
|
|
275
|
+
</>
|
|
581
276
|
)
|
|
582
277
|
}
|
|
583
278
|
|
|
@@ -56,7 +56,7 @@ const BusinessPreorderUI = (props: BusinessPreorderParams) => {
|
|
|
56
56
|
const [datesWhitelist, setDateWhitelist] = useState<any>([{ start: null, end: null }])
|
|
57
57
|
const [isEnabled, setIsEnabled] = useState(false)
|
|
58
58
|
const { top } = useSafeAreaInsets()
|
|
59
|
-
const is12hours = configs?.
|
|
59
|
+
const is12hours = configs?.general_hour_format?.value?.includes('hh:mm')
|
|
60
60
|
|
|
61
61
|
const showOrderTime = (selectedPreorderType === 1 && Object.keys(menu)?.length > 0) || selectedPreorderType === 0
|
|
62
62
|
const isPreOrderSetting = configs?.preorder_status_enabled?.value === '1'
|
|
@@ -64,7 +64,7 @@ const BusinessPreorderUI = (props: BusinessPreorderParams) => {
|
|
|
64
64
|
container: {
|
|
65
65
|
height: windowHeight,
|
|
66
66
|
paddingVertical: 30,
|
|
67
|
-
paddingHorizontal:
|
|
67
|
+
paddingHorizontal: 20
|
|
68
68
|
},
|
|
69
69
|
businessLogo: {
|
|
70
70
|
backgroundColor: 'white',
|
|
@@ -319,11 +319,10 @@ const BusinessPreorderUI = (props: BusinessPreorderParams) => {
|
|
|
319
319
|
|
|
320
320
|
return (
|
|
321
321
|
<>
|
|
322
|
-
<PreOrderContainer contentContainerStyle={{ paddingVertical: 32, paddingHorizontal:
|
|
322
|
+
<PreOrderContainer contentContainerStyle={{ paddingVertical: 32, paddingHorizontal: 20 }}>
|
|
323
323
|
<TouchableOpacity onPress={() => goToBack && goToBack()} style={{ marginBottom: 12 }}>
|
|
324
324
|
<IconAntDesign
|
|
325
325
|
name='close'
|
|
326
|
-
color={theme.colors.textThird}
|
|
327
326
|
size={24}
|
|
328
327
|
style={{ marginLeft: -4 }}
|
|
329
328
|
/>
|
|
@@ -92,7 +92,7 @@ const BusinessProductsCategoriesUI = (props: any) => {
|
|
|
92
92
|
ref={tabsRef}
|
|
93
93
|
horizontal
|
|
94
94
|
style={{ ...styles.container, borderBottomWidth: loading ? 0 : 1 }}
|
|
95
|
-
contentContainerStyle={{ paddingHorizontal:
|
|
95
|
+
contentContainerStyle={{ paddingHorizontal: 20 }}
|
|
96
96
|
showsHorizontalScrollIndicator={false}
|
|
97
97
|
onScroll={(e: any) => setScrollOffsetX(e.nativeEvent.contentOffset.x)}
|
|
98
98
|
scrollEventThrottle={16}
|
|
@@ -106,7 +106,7 @@ const BusinessProductsListUI = (props: BusinessProductsListParams) => {
|
|
|
106
106
|
<SingleProductCard
|
|
107
107
|
key={'prod_' + product.id + `_${i}`}
|
|
108
108
|
isSoldOut={product.inventoried && !product.quantity}
|
|
109
|
-
enableIntersection={!isFiltMode}
|
|
109
|
+
// enableIntersection={!isFiltMode}
|
|
110
110
|
product={product}
|
|
111
111
|
businessId={businessId}
|
|
112
112
|
categoryState={categoryState}
|
|
@@ -135,7 +135,7 @@ const BusinessProductsListUI = (props: BusinessProductsListParams) => {
|
|
|
135
135
|
key={'feat_' + product.id + `_${i}`}
|
|
136
136
|
isSoldOut={product.inventoried && !product.quantity}
|
|
137
137
|
product={product}
|
|
138
|
-
enableIntersection={!isFiltMode}
|
|
138
|
+
// enableIntersection={!isFiltMode}
|
|
139
139
|
businessId={businessId}
|
|
140
140
|
categoryState={categoryState}
|
|
141
141
|
onProductClick={onProductClick}
|
|
@@ -18,15 +18,12 @@ export const RibbonBox = styled.View`
|
|
|
18
18
|
background-color: ${(props: any) => props.theme.colors.primary};
|
|
19
19
|
padding: 2px 8px;
|
|
20
20
|
max-width: 180px;
|
|
21
|
-
|
|
22
21
|
${(props: any) => props.bgColor && css`
|
|
23
22
|
background-color: ${props.bgColor};
|
|
24
23
|
`}
|
|
25
|
-
|
|
26
24
|
${(props: any) => props.isRoundRect && css`
|
|
27
25
|
border-radius: 7.6px;
|
|
28
26
|
`}
|
|
29
|
-
|
|
30
27
|
${(props: any) => props.isCapsule && css`
|
|
31
28
|
border-radius: 50px;
|
|
32
29
|
`}
|