ordering-ui-react-native 0.15.57 → 0.15.59-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 +5 -3
- package/src/DeliveryApp.tsx +43 -1
- package/src/components/AddressForm/index.tsx +18 -2
- package/src/components/BusinessController/index.tsx +16 -8
- package/src/components/BusinessTypeFilter/index.tsx +3 -1
- package/src/components/BusinessesListing/index.tsx +1 -1
- package/src/components/Checkout/index.tsx +23 -2
- package/src/components/DriverTips/index.tsx +11 -6
- package/src/components/LanguageSelector/index.tsx +7 -2
- package/src/components/LoginForm/index.tsx +120 -30
- package/src/components/LoginForm/styles.tsx +6 -0
- package/src/components/OrderDetails/index.tsx +7 -21
- package/src/components/PaymentOptions/index.tsx +67 -50
- package/src/components/PaymentOptionsWebView/index.tsx +123 -124
- package/src/components/ReviewDriver/index.tsx +1 -1
- package/src/components/ReviewOrder/index.tsx +2 -1
- package/src/components/ReviewProducts/index.tsx +11 -0
- package/src/components/SignupForm/index.tsx +145 -61
- package/src/components/SingleProductCard/index.tsx +16 -4
- package/src/components/SingleProductReview/index.tsx +1 -1
- package/src/components/StripeMethodForm/index.tsx +1 -2
- package/src/components/UpsellingProducts/index.tsx +1 -1
- package/src/components/UserProfileForm/index.tsx +63 -6
- package/src/components/UserProfileForm/styles.tsx +8 -0
- package/src/components/VerifyPhone/styles.tsx +1 -2
- package/src/components/shared/OModal.tsx +1 -1
- package/src/hooks/useCountdownTimer.tsx +26 -0
- package/src/navigators/CheckoutNavigator.tsx +6 -0
- package/src/navigators/HomeNavigator.tsx +12 -0
- package/src/pages/BusinessesListing.tsx +1 -1
- package/src/pages/MultiCheckout.tsx +31 -0
- package/src/pages/MultiOrdersDetails.tsx +27 -0
- package/src/pages/Sessions.tsx +22 -0
- package/src/theme.json +0 -1
- package/src/types/index.tsx +18 -11
- package/src/utils/index.tsx +68 -1
- package/themes/business/src/components/AcceptOrRejectOrder/index.tsx +103 -15
- package/themes/business/src/components/AcceptOrRejectOrder/styles.tsx +6 -0
- package/themes/business/src/components/Chat/index.tsx +42 -90
- package/themes/business/src/components/DriverMap/index.tsx +6 -5
- package/themes/business/src/components/LoginForm/index.tsx +89 -2
- package/themes/business/src/components/LoginForm/styles.tsx +6 -0
- package/themes/business/src/components/LogoutButton/index.tsx +1 -1
- package/themes/business/src/components/NewOrderNotification/index.tsx +26 -13
- package/themes/business/src/components/OrderDetails/Business.tsx +2 -2
- package/themes/business/src/components/OrderDetails/Delivery.tsx +28 -11
- package/themes/business/src/components/OrderDetails/OrderContentComponent.tsx +41 -7
- package/themes/business/src/components/OrderDetails/OrderHeaderComponent.tsx +6 -0
- package/themes/business/src/components/OrdersListManager/index.tsx +1 -1
- package/themes/business/src/components/OrdersOption/index.tsx +5 -2
- package/themes/business/src/components/PreviousOrders/index.tsx +7 -7
- package/themes/business/src/components/ProductItemAccordion/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/OModal.tsx +1 -1
- package/themes/business/src/types/index.tsx +6 -1
- 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/BusinessMenu/index.tsx +39 -28
- package/themes/kiosk/src/components/BusinessesListing/index.tsx +2 -3
- package/themes/kiosk/src/components/Cart/index.tsx +11 -12
- package/themes/kiosk/src/components/CartBottomSheet/index.tsx +9 -2
- package/themes/kiosk/src/components/CartContent/index.tsx +0 -11
- package/themes/kiosk/src/components/CartItem/index.tsx +4 -3
- package/themes/kiosk/src/components/CategoriesMenu/index.tsx +107 -62
- package/themes/kiosk/src/components/Checkout/index.tsx +40 -22
- package/themes/kiosk/src/components/CustomerName/index.tsx +0 -6
- package/themes/kiosk/src/components/DrawerView/index.tsx +1 -0
- package/themes/kiosk/src/components/DrawerView/styles.tsx +2 -2
- package/themes/kiosk/src/components/NavBar/index.tsx +29 -20
- package/themes/kiosk/src/components/OptionCard/index.tsx +1 -1
- package/themes/kiosk/src/components/OrderDetails/index.tsx +32 -27
- package/themes/kiosk/src/components/OrderTypeCardSelector/index.tsx +9 -11
- package/themes/kiosk/src/components/PaymentOptions/index.tsx +56 -54
- package/themes/kiosk/src/components/ProductForm/index.tsx +7 -8
- package/themes/kiosk/src/components/ProductItemAccordion/index.tsx +2 -2
- package/themes/kiosk/src/components/ProductOption/index.tsx +1 -1
- package/themes/kiosk/src/components/ProductOptionSubOption/index.tsx +3 -1
- package/themes/kiosk/src/components/UpsellingProducts/index.tsx +16 -5
- package/themes/kiosk/src/components/shared/OButton.tsx +5 -18
- package/themes/kiosk/src/types/index.d.ts +1 -0
- package/themes/original/index.tsx +22 -8
- package/themes/original/src/components/ActiveOrders/index.tsx +15 -132
- package/themes/original/src/components/ActiveOrders/styles.tsx +0 -54
- package/themes/original/src/components/AddressForm/index.tsx +7 -6
- package/themes/original/src/components/AddressList/index.tsx +30 -18
- package/themes/original/src/components/AppleLogin/index.tsx +9 -13
- package/themes/original/src/components/BusinessBasicInformation/index.tsx +136 -45
- package/themes/original/src/components/BusinessBasicInformation/styles.tsx +4 -0
- package/themes/original/src/components/BusinessController/index.tsx +48 -11
- package/themes/original/src/components/BusinessController/styles.tsx +27 -0
- package/themes/original/src/components/BusinessFeaturedController/index.tsx +20 -1
- package/themes/original/src/components/BusinessFeaturedController/styles.tsx +23 -0
- package/themes/original/src/components/BusinessItemAccordion/index.tsx +8 -5
- package/themes/original/src/components/BusinessItemAccordion/styles.tsx +3 -1
- package/themes/original/src/components/BusinessListingSearch/index.tsx +196 -58
- package/themes/original/src/components/BusinessListingSearch/styles.tsx +22 -2
- package/themes/original/src/components/BusinessPreorder/index.tsx +1 -1
- package/themes/original/src/components/BusinessProductsCategories/index.tsx +2 -2
- package/themes/original/src/components/BusinessProductsList/CategoryDescription/index.tsx +44 -0
- package/themes/original/src/components/BusinessProductsList/index.tsx +51 -53
- package/themes/original/src/components/BusinessProductsList/styles.tsx +0 -3
- package/themes/original/src/components/BusinessProductsListing/index.tsx +105 -22
- package/themes/original/src/components/BusinessProductsListing/styles.tsx +22 -0
- package/themes/original/src/components/BusinessReviews/index.tsx +6 -1
- package/themes/original/src/components/BusinessTypeFilter/index.tsx +1 -2
- package/themes/original/src/components/BusinessesListing/index.tsx +126 -65
- package/themes/original/src/components/BusinessesListing/styles.tsx +11 -3
- package/themes/original/src/components/Cart/index.tsx +60 -41
- package/themes/original/src/components/Checkout/index.tsx +48 -32
- package/themes/original/src/components/DriverTips/index.tsx +17 -12
- package/themes/original/src/components/Favorite/index.tsx +92 -0
- package/themes/original/src/components/Favorite/styles.tsx +22 -0
- package/themes/original/src/components/FavoriteList/index.tsx +298 -0
- package/themes/original/src/components/FavoriteList/styles.tsx +5 -0
- package/themes/original/src/components/ForgotPasswordForm/index.tsx +84 -4
- package/themes/original/src/components/GPSButton/index.tsx +15 -8
- package/themes/original/src/components/GoogleMap/index.tsx +11 -11
- package/themes/original/src/components/Help/index.tsx +21 -4
- package/themes/original/src/components/HighestRatedBusinesses/index.tsx +18 -1
- package/themes/original/src/components/LastOrders/index.tsx +12 -1
- package/themes/original/src/components/LoginForm/Otp/index.tsx +91 -0
- package/themes/original/src/components/LoginForm/Otp/styles.tsx +7 -0
- package/themes/original/src/components/LoginForm/index.tsx +332 -164
- package/themes/original/src/components/LoginForm/styles.tsx +1 -3
- package/themes/original/src/components/MessageListing/index.tsx +10 -1
- package/themes/original/src/components/Messages/index.tsx +1 -1
- package/themes/original/src/components/MomentOption/index.tsx +10 -1
- package/themes/original/src/components/MomentOption/styles.tsx +1 -1
- package/themes/original/src/components/MultiCartsPaymethodsAndWallets/index.tsx +243 -0
- package/themes/original/src/components/MultiCartsPaymethodsAndWallets/styles.tsx +46 -0
- package/themes/original/src/components/MultiCheckout/index.tsx +298 -0
- package/themes/original/src/components/MultiCheckout/styles.tsx +59 -0
- package/themes/original/src/components/MultiOrdersDetails/SingleOrderCard.tsx +372 -0
- package/themes/original/src/components/MultiOrdersDetails/index.tsx +258 -0
- package/themes/original/src/components/MultiOrdersDetails/styles.tsx +50 -0
- package/themes/original/src/components/MyOrders/index.tsx +120 -32
- package/themes/original/src/components/MyOrders/styles.tsx +8 -1
- package/themes/original/src/components/OrderDetails/OrderHistory.tsx +167 -0
- package/themes/original/src/components/OrderDetails/index.tsx +135 -49
- package/themes/original/src/components/OrderDetails/styles.tsx +1 -2
- package/themes/original/src/components/OrderSummary/index.tsx +2 -2
- package/themes/original/src/components/OrderTypeSelector/index.tsx +4 -2
- package/themes/original/src/components/OrdersOption/PreviousBusinessOrdered/index.tsx +153 -0
- package/themes/original/src/components/OrdersOption/PreviousBusinessOrdered/styles.tsx +6 -0
- package/themes/original/src/components/OrdersOption/PreviousProductsOrdered/index.tsx +53 -0
- package/themes/original/src/components/OrdersOption/PreviousProductsOrdered/styles.tsx +6 -0
- package/themes/original/src/components/OrdersOption/index.tsx +130 -38
- package/themes/original/src/components/OrdersOption/styles.tsx +4 -1
- package/themes/original/src/components/PaymentOptionCash/index.tsx +2 -2
- package/themes/original/src/components/PaymentOptionWallet/index.tsx +17 -23
- package/themes/original/src/components/PaymentOptionWallet/styles.tsx +1 -1
- package/themes/original/src/components/PaymentOptions/index.tsx +57 -36
- package/themes/original/src/components/PhoneInputNumber/index.tsx +5 -11
- package/themes/original/src/components/PreviousOrders/index.tsx +18 -147
- package/themes/original/src/components/ProductForm/index.tsx +70 -62
- package/themes/original/src/components/ProductForm/styles.tsx +0 -1
- package/themes/original/src/components/ProductItemAccordion/index.tsx +2 -2
- package/themes/original/src/components/ProductOptionSubOption/index.tsx +18 -12
- package/themes/original/src/components/Promotions/index.tsx +151 -133
- package/themes/original/src/components/Promotions/styles.tsx +3 -23
- package/themes/original/src/components/SearchBar/index.tsx +10 -4
- package/themes/original/src/components/Sessions/index.tsx +160 -0
- package/themes/original/src/components/Sessions/styles.tsx +15 -0
- package/themes/original/src/components/SignupForm/index.tsx +237 -126
- package/themes/original/src/components/SingleOrderCard/index.tsx +282 -0
- package/themes/original/src/components/SingleOrderCard/styles.tsx +54 -0
- package/themes/original/src/components/SingleProductCard/index.tsx +59 -17
- package/themes/original/src/components/StripeElementsForm/index.tsx +16 -8
- package/themes/original/src/components/StripeElementsForm/naked.tsx +2 -2
- package/themes/original/src/components/UpsellingProducts/index.tsx +86 -74
- package/themes/original/src/components/UserDetails/index.tsx +5 -96
- package/themes/original/src/components/UserFormDetails/index.tsx +25 -26
- package/themes/original/src/components/UserProfile/index.tsx +52 -5
- package/themes/original/src/components/UserProfileForm/index.tsx +20 -18
- package/themes/original/src/components/UserVerification/index.tsx +178 -192
- package/themes/original/src/components/VerifyPhone/index.tsx +10 -7
- package/themes/original/src/components/VerifyPhone/styles.tsx +2 -1
- package/themes/original/src/components/Wallets/index.tsx +76 -9
- package/themes/original/src/components/Wallets/styles.tsx +21 -0
- package/themes/original/src/components/shared/OModal.tsx +4 -2
- package/themes/original/src/types/index.tsx +189 -35
- package/themes/original/src/utils/index.tsx +85 -2
- package/themes/single-business/src/components/OrderTypeSelector/index.tsx +1 -1
- package/themes/uber-eats/src/components/BusinessesListing/index.tsx +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React, { useEffect, useState } from 'react'
|
|
2
2
|
import { useLanguage, BusinessSearchList, useOrder, useUtils } from 'ordering-components/native'
|
|
3
|
-
import { ScrollView, StyleSheet, TouchableOpacity, Platform, View } from 'react-native'
|
|
3
|
+
import { ScrollView, StyleSheet, TouchableOpacity, Platform, View, Dimensions } from 'react-native'
|
|
4
4
|
import { useSafeAreaInsets } from 'react-native-safe-area-context'
|
|
5
5
|
import { useTheme } from 'styled-components/native'
|
|
6
6
|
import { OButton, OIcon, OModal, OText } from '../shared'
|
|
@@ -22,15 +22,20 @@ import {
|
|
|
22
22
|
ProgressContentWrapper,
|
|
23
23
|
ProgressBar,
|
|
24
24
|
TagsContainer,
|
|
25
|
-
SortContainer
|
|
25
|
+
SortContainer,
|
|
26
|
+
BrandContainer,
|
|
27
|
+
BrandItem,
|
|
28
|
+
PriceFilterWrapper,
|
|
29
|
+
OptionTitle
|
|
26
30
|
} from './styles'
|
|
27
31
|
import FastImage from 'react-native-fast-image'
|
|
28
32
|
import { convertHoursToMinutes } from '../../utils'
|
|
29
33
|
import { Fade, Placeholder, PlaceholderLine } from 'rn-placeholder'
|
|
30
34
|
import { BusinessSearchParams } from '../../types'
|
|
35
|
+
import { MyOrders } from '../MyOrders'
|
|
31
36
|
|
|
32
|
-
export const BusinessListingSearchUI = (props : BusinessSearchParams) => {
|
|
33
37
|
|
|
38
|
+
export const BusinessListingSearchUI = (props: BusinessSearchParams) => {
|
|
34
39
|
const {
|
|
35
40
|
navigation,
|
|
36
41
|
businessesSearchList,
|
|
@@ -42,9 +47,15 @@ export const BusinessListingSearchUI = (props : BusinessSearchParams) => {
|
|
|
42
47
|
handleChangeFilters,
|
|
43
48
|
filters,
|
|
44
49
|
businessTypes,
|
|
45
|
-
setFilters
|
|
50
|
+
setFilters,
|
|
51
|
+
brandList,
|
|
52
|
+
onNavigationRedirect,
|
|
53
|
+
handleUpdateBusinessList,
|
|
54
|
+
handleUpdateProducts
|
|
46
55
|
} = props
|
|
47
56
|
|
|
57
|
+
const screenHeight = Dimensions.get('window').height;
|
|
58
|
+
const screenWidth = Dimensions.get('window').width;
|
|
48
59
|
const theme = useTheme()
|
|
49
60
|
const [orderState] = useOrder()
|
|
50
61
|
const { top } = useSafeAreaInsets();
|
|
@@ -63,11 +74,24 @@ export const BusinessListingSearchUI = (props : BusinessSearchParams) => {
|
|
|
63
74
|
{ text: t('PICKUP_TIME', 'Pickup time'), value: 'pickup_time' }
|
|
64
75
|
]
|
|
65
76
|
|
|
77
|
+
const priceList = [
|
|
78
|
+
{ level: '1', content: '$' },
|
|
79
|
+
{ level: '2', content: '$$' },
|
|
80
|
+
{ level: '3', content: '$$$' },
|
|
81
|
+
{ level: '4', content: '$$$$' },
|
|
82
|
+
{ level: '5', content: '$$$$$' }
|
|
83
|
+
]
|
|
84
|
+
|
|
66
85
|
const styles = StyleSheet.create({
|
|
67
86
|
container: {
|
|
68
87
|
paddingHorizontal: 40,
|
|
69
88
|
width: '100%'
|
|
70
89
|
},
|
|
90
|
+
filterContainer: {
|
|
91
|
+
maxHeight: screenHeight - 150,
|
|
92
|
+
paddingHorizontal: 40,
|
|
93
|
+
width: '100%'
|
|
94
|
+
},
|
|
71
95
|
searchInput: {
|
|
72
96
|
fontSize: 10,
|
|
73
97
|
},
|
|
@@ -84,6 +108,12 @@ export const BusinessListingSearchUI = (props : BusinessSearchParams) => {
|
|
|
84
108
|
flexWrap: 'wrap',
|
|
85
109
|
justifyContent: 'center'
|
|
86
110
|
},
|
|
111
|
+
priceContainer: {
|
|
112
|
+
width: '100%',
|
|
113
|
+
flexDirection: 'row',
|
|
114
|
+
flexWrap: 'wrap',
|
|
115
|
+
justifyContent: 'space-between'
|
|
116
|
+
},
|
|
87
117
|
categoryStyle: {
|
|
88
118
|
marginRight: 10,
|
|
89
119
|
marginTop: 10,
|
|
@@ -95,6 +125,16 @@ export const BusinessListingSearchUI = (props : BusinessSearchParams) => {
|
|
|
95
125
|
height: 28,
|
|
96
126
|
borderWidth: 0
|
|
97
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
|
+
},
|
|
98
138
|
applyButton: {
|
|
99
139
|
paddingHorizontal: 40,
|
|
100
140
|
width: '100%',
|
|
@@ -107,7 +147,7 @@ export const BusinessListingSearchUI = (props : BusinessSearchParams) => {
|
|
|
107
147
|
}
|
|
108
148
|
|
|
109
149
|
const handleCloseFilters = () => {
|
|
110
|
-
setFilters({ business_types: [], orderBy: 'default' })
|
|
150
|
+
setFilters({ business_types: [], orderBy: 'default', franchise_ids: [], price_level: null })
|
|
111
151
|
setOpenFilters(false)
|
|
112
152
|
}
|
|
113
153
|
|
|
@@ -126,6 +166,18 @@ export const BusinessListingSearchUI = (props : BusinessSearchParams) => {
|
|
|
126
166
|
}
|
|
127
167
|
}
|
|
128
168
|
|
|
169
|
+
const handleChangeBrandFilter = (brandId: number) => {
|
|
170
|
+
let franchiseIds = [...filters?.franchise_ids]
|
|
171
|
+
if (filters?.franchise_ids?.includes(brandId)) franchiseIds = filters?.franchise_ids?.filter((item: any) => item !== brandId)
|
|
172
|
+
else franchiseIds.push(brandId)
|
|
173
|
+
handleChangeFilters && handleChangeFilters('franchise_ids', franchiseIds)
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
const handleChangePriceRange = (value: string) => {
|
|
177
|
+
if (value === filters?.price_level) handleChangeFilters('price_level', null)
|
|
178
|
+
else handleChangeFilters('price_level', value)
|
|
179
|
+
}
|
|
180
|
+
|
|
129
181
|
const handleApplyFilters = () => {
|
|
130
182
|
handleSearchbusinessAndProducts(true)
|
|
131
183
|
setOpenFilters(false)
|
|
@@ -176,6 +228,60 @@ export const BusinessListingSearchUI = (props : BusinessSearchParams) => {
|
|
|
176
228
|
)
|
|
177
229
|
}
|
|
178
230
|
|
|
231
|
+
const BusinessControllerSkeletons = () => {
|
|
232
|
+
return (
|
|
233
|
+
<>
|
|
234
|
+
{[
|
|
235
|
+
...Array(
|
|
236
|
+
paginationProps.nextPageItems
|
|
237
|
+
? paginationProps.nextPageItems
|
|
238
|
+
: 3,
|
|
239
|
+
).keys(),
|
|
240
|
+
].map((item, i) => (
|
|
241
|
+
<Placeholder
|
|
242
|
+
Animation={Fade}
|
|
243
|
+
key={i}
|
|
244
|
+
style={{ width: 320, marginRight: 20, marginTop: 20 }}>
|
|
245
|
+
<View style={{ width: 320 }}>
|
|
246
|
+
<PlaceholderLine
|
|
247
|
+
height={155}
|
|
248
|
+
style={{ marginBottom: 20, borderRadius: 25 }}
|
|
249
|
+
/>
|
|
250
|
+
<View style={{ paddingHorizontal: 10 }}>
|
|
251
|
+
<View
|
|
252
|
+
style={{
|
|
253
|
+
flexDirection: 'row',
|
|
254
|
+
justifyContent: 'space-between',
|
|
255
|
+
}}>
|
|
256
|
+
<PlaceholderLine
|
|
257
|
+
height={25}
|
|
258
|
+
width={40}
|
|
259
|
+
style={{ marginBottom: 10 }}
|
|
260
|
+
/>
|
|
261
|
+
<PlaceholderLine
|
|
262
|
+
height={25}
|
|
263
|
+
width={20}
|
|
264
|
+
style={{ marginBottom: 10 }}
|
|
265
|
+
/>
|
|
266
|
+
</View>
|
|
267
|
+
<PlaceholderLine
|
|
268
|
+
height={20}
|
|
269
|
+
width={30}
|
|
270
|
+
style={{ marginBottom: 10 }}
|
|
271
|
+
/>
|
|
272
|
+
<PlaceholderLine
|
|
273
|
+
height={20}
|
|
274
|
+
width={80}
|
|
275
|
+
style={{ marginBottom: 0 }}
|
|
276
|
+
/>
|
|
277
|
+
</View>
|
|
278
|
+
</View>
|
|
279
|
+
</Placeholder>
|
|
280
|
+
))}
|
|
281
|
+
</>
|
|
282
|
+
)
|
|
283
|
+
}
|
|
284
|
+
|
|
179
285
|
return (
|
|
180
286
|
<ScrollView style={styles.container}>
|
|
181
287
|
<WrapHeader style={{ paddingTop: top + 20, marginVertical: 2 }}>
|
|
@@ -211,6 +317,20 @@ export const BusinessListingSearchUI = (props : BusinessSearchParams) => {
|
|
|
211
317
|
</View>
|
|
212
318
|
)
|
|
213
319
|
}
|
|
320
|
+
{businessesSearchList.businesses?.length > 0 && (
|
|
321
|
+
<MyOrders
|
|
322
|
+
hideOrders
|
|
323
|
+
businessesSearchList={businessesSearchList}
|
|
324
|
+
onNavigationRedirect={onNavigationRedirect}
|
|
325
|
+
BusinessControllerSkeletons={BusinessControllerSkeletons}
|
|
326
|
+
/>
|
|
327
|
+
)}
|
|
328
|
+
|
|
329
|
+
<OptionTitle isBusinessesSearchList={!!businessesSearchList}>
|
|
330
|
+
<OText size={16} lineHeight={24} weight={'500'} color={theme.colors.textNormal} mBottom={10}>
|
|
331
|
+
{t('BUSINESSES', 'Businesses')}
|
|
332
|
+
</OText>
|
|
333
|
+
</OptionTitle>
|
|
214
334
|
<ScrollView horizontal>
|
|
215
335
|
{businessesSearchList.businesses?.length > 0 && businessesSearchList.businesses.map((business: any, i: number) => (
|
|
216
336
|
<BusinessController
|
|
@@ -218,8 +338,9 @@ export const BusinessListingSearchUI = (props : BusinessSearchParams) => {
|
|
|
218
338
|
business={business}
|
|
219
339
|
isBusinessOpen={business.open}
|
|
220
340
|
handleCustomClick={() => onBusinessClick(business)}
|
|
341
|
+
handleUpdateBusinessList={handleUpdateBusinessList}
|
|
221
342
|
orderType={orderState?.options?.type}
|
|
222
|
-
style={{ width:
|
|
343
|
+
style={{ width: screenWidth - 80, marginRight: (businessesSearchList.loading || i !== businessesSearchList.businesses?.length - 1) ? 20 : 0 }}
|
|
223
344
|
/>
|
|
224
345
|
))}
|
|
225
346
|
{!businessesSearchList.loading && paginationProps?.totalPages && paginationProps?.currentPage < paginationProps?.totalPages && (
|
|
@@ -234,55 +355,7 @@ export const BusinessListingSearchUI = (props : BusinessSearchParams) => {
|
|
|
234
355
|
</LoadMoreBusinessContainer>
|
|
235
356
|
)}
|
|
236
357
|
{businessesSearchList.loading && (
|
|
237
|
-
|
|
238
|
-
{[
|
|
239
|
-
...Array(
|
|
240
|
-
paginationProps.nextPageItems
|
|
241
|
-
? paginationProps.nextPageItems
|
|
242
|
-
: 3,
|
|
243
|
-
).keys(),
|
|
244
|
-
].map((item, i) => (
|
|
245
|
-
<Placeholder
|
|
246
|
-
Animation={Fade}
|
|
247
|
-
key={i}
|
|
248
|
-
style={{ width: 320, marginRight: 20, marginTop: 20 }}>
|
|
249
|
-
<View style={{ width: 320 }}>
|
|
250
|
-
<PlaceholderLine
|
|
251
|
-
height={155}
|
|
252
|
-
style={{ marginBottom: 20, borderRadius: 25 }}
|
|
253
|
-
/>
|
|
254
|
-
<View style={{ paddingHorizontal: 10 }}>
|
|
255
|
-
<View
|
|
256
|
-
style={{
|
|
257
|
-
flexDirection: 'row',
|
|
258
|
-
justifyContent: 'space-between',
|
|
259
|
-
}}>
|
|
260
|
-
<PlaceholderLine
|
|
261
|
-
height={25}
|
|
262
|
-
width={40}
|
|
263
|
-
style={{ marginBottom: 10 }}
|
|
264
|
-
/>
|
|
265
|
-
<PlaceholderLine
|
|
266
|
-
height={25}
|
|
267
|
-
width={20}
|
|
268
|
-
style={{ marginBottom: 10 }}
|
|
269
|
-
/>
|
|
270
|
-
</View>
|
|
271
|
-
<PlaceholderLine
|
|
272
|
-
height={20}
|
|
273
|
-
width={30}
|
|
274
|
-
style={{ marginBottom: 10 }}
|
|
275
|
-
/>
|
|
276
|
-
<PlaceholderLine
|
|
277
|
-
height={20}
|
|
278
|
-
width={80}
|
|
279
|
-
style={{ marginBottom: 0 }}
|
|
280
|
-
/>
|
|
281
|
-
</View>
|
|
282
|
-
</View>
|
|
283
|
-
</Placeholder>
|
|
284
|
-
))}
|
|
285
|
-
</>
|
|
358
|
+
<BusinessControllerSkeletons />
|
|
286
359
|
)}
|
|
287
360
|
</ScrollView>
|
|
288
361
|
<ProductsList>
|
|
@@ -338,7 +411,8 @@ export const BusinessListingSearchUI = (props : BusinessSearchParams) => {
|
|
|
338
411
|
businessId={business?.id}
|
|
339
412
|
onProductClick={() => { }}
|
|
340
413
|
productAddedToCartLength={0}
|
|
341
|
-
|
|
414
|
+
handleUpdateProducts={(productId: number, changes: any) => handleUpdateProducts(productId, category?.id, business?.id, changes)}
|
|
415
|
+
style={{ width: screenWidth - 80, marginRight: i === category?.products?.length - 1 ? 0 : 20 }}
|
|
342
416
|
/>
|
|
343
417
|
)))}
|
|
344
418
|
|
|
@@ -388,7 +462,7 @@ export const BusinessListingSearchUI = (props : BusinessSearchParams) => {
|
|
|
388
462
|
onCancel={() => handleCloseFilters()}
|
|
389
463
|
onClose={() => handleCloseFilters()}
|
|
390
464
|
>
|
|
391
|
-
<ScrollView style={styles.
|
|
465
|
+
<ScrollView style={styles.filterContainer}>
|
|
392
466
|
<OText
|
|
393
467
|
size={20}
|
|
394
468
|
mBottom={15}
|
|
@@ -406,7 +480,7 @@ export const BusinessListingSearchUI = (props : BusinessSearchParams) => {
|
|
|
406
480
|
onPress={() => handleChangeFilters('orderBy', item?.value)}
|
|
407
481
|
style={{ marginBottom: 7 }}
|
|
408
482
|
>
|
|
409
|
-
<OText
|
|
483
|
+
<OText
|
|
410
484
|
weight={filters?.orderBy?.includes(item?.value) ? 'bold' : '500'}
|
|
411
485
|
mBottom={filters?.orderBy?.includes(item?.value) ? 5 : 0}
|
|
412
486
|
>
|
|
@@ -415,6 +489,70 @@ export const BusinessListingSearchUI = (props : BusinessSearchParams) => {
|
|
|
415
489
|
</TouchableOpacity>
|
|
416
490
|
))}
|
|
417
491
|
</SortContainer>
|
|
492
|
+
<BrandContainer>
|
|
493
|
+
<OText
|
|
494
|
+
size={16}
|
|
495
|
+
weight='bold'
|
|
496
|
+
lineHeight={24}
|
|
497
|
+
style={{ marginBottom: 10 }}
|
|
498
|
+
>
|
|
499
|
+
{t('BRANDS', 'Brands')}
|
|
500
|
+
</OText>
|
|
501
|
+
{!brandList?.loading && !brandList?.error && brandList?.brands?.length > 0 && (
|
|
502
|
+
<ScrollView
|
|
503
|
+
style={{ maxHeight: 300, marginBottom: 10 }}
|
|
504
|
+
showsVerticalScrollIndicator={true}
|
|
505
|
+
nestedScrollEnabled={true}
|
|
506
|
+
>
|
|
507
|
+
{brandList?.brands.map((brand: any, i: number) => brand?.enabled && (
|
|
508
|
+
<BrandItem
|
|
509
|
+
key={i}
|
|
510
|
+
onPress={() => handleChangeBrandFilter(brand?.id)}
|
|
511
|
+
>
|
|
512
|
+
<OText
|
|
513
|
+
size={14}
|
|
514
|
+
weight={'400'}
|
|
515
|
+
lineHeight={24}
|
|
516
|
+
>
|
|
517
|
+
{brand?.name}
|
|
518
|
+
</OText>
|
|
519
|
+
{filters?.franchise_ids?.includes(brand?.id) && (
|
|
520
|
+
<AntDesignIcon
|
|
521
|
+
name='check'
|
|
522
|
+
color={theme.colors.success500}
|
|
523
|
+
size={16}
|
|
524
|
+
/>
|
|
525
|
+
)}
|
|
526
|
+
</BrandItem>
|
|
527
|
+
))}
|
|
528
|
+
</ScrollView>
|
|
529
|
+
)}
|
|
530
|
+
{!brandList?.loading && ((brandList?.brands?.filter((brand: any) => brand?.enabled))?.length === 0) && (
|
|
531
|
+
<OText size={14} weight='400'>{t('NO_RESULTS_FOUND', 'Sorry, no results found')}</OText>
|
|
532
|
+
)}
|
|
533
|
+
</BrandContainer>
|
|
534
|
+
<PriceFilterWrapper>
|
|
535
|
+
<OText
|
|
536
|
+
size={16}
|
|
537
|
+
weight='bold'
|
|
538
|
+
lineHeight={24}
|
|
539
|
+
style={{ marginBottom: 5 }}
|
|
540
|
+
>
|
|
541
|
+
{t('PRICE_RANGE', 'Price range')}
|
|
542
|
+
</OText>
|
|
543
|
+
<View style={styles.priceContainer}>
|
|
544
|
+
{priceList.map((price: any, i: number) => (
|
|
545
|
+
<OButton
|
|
546
|
+
key={i}
|
|
547
|
+
bgColor={(filters?.price_level === price?.level) ? theme.colors.primary : theme.colors.backgroundGray200}
|
|
548
|
+
onClick={() => handleChangePriceRange(price?.level)}
|
|
549
|
+
text={`${price.content} ${(filters?.price_level === price?.level) ? ' X' : ''}`}
|
|
550
|
+
style={styles.priceItem}
|
|
551
|
+
textStyle={{ fontSize: 10, color: (filters?.price_level === price?.level) ? theme.colors.backgroundLight : theme.colors.textNormal }}
|
|
552
|
+
/>
|
|
553
|
+
))}
|
|
554
|
+
</View>
|
|
555
|
+
</PriceFilterWrapper>
|
|
418
556
|
{orderState?.options?.type === 1 && (
|
|
419
557
|
<MaxSectionItem
|
|
420
558
|
title={t('MAX_DELIVERY_FEE', 'Max delivery fee')}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import styled from 'styled-components/native'
|
|
1
|
+
import styled, { css } from 'styled-components/native'
|
|
2
2
|
|
|
3
3
|
export const WrapHeader = styled.View`
|
|
4
4
|
width: 100%;
|
|
@@ -68,9 +68,29 @@ export const ProgressContentWrapper = styled.View`
|
|
|
68
68
|
`
|
|
69
69
|
|
|
70
70
|
export const TagsContainer = styled.View`
|
|
71
|
-
|
|
71
|
+
padding-bottom: 10px;
|
|
72
72
|
`
|
|
73
73
|
|
|
74
74
|
export const SortContainer = styled.View`
|
|
75
75
|
margin-bottom: 10px;
|
|
76
76
|
`
|
|
77
|
+
|
|
78
|
+
export const BrandContainer = styled.View``
|
|
79
|
+
|
|
80
|
+
export const BrandItem = styled.TouchableOpacity`
|
|
81
|
+
flex-direction: row;
|
|
82
|
+
justify-content: space-between;
|
|
83
|
+
margin-bottom: 4px;
|
|
84
|
+
align-items: center;
|
|
85
|
+
`
|
|
86
|
+
|
|
87
|
+
export const PriceFilterWrapper = styled.View`
|
|
88
|
+
margin-bottom: 20px;
|
|
89
|
+
`
|
|
90
|
+
|
|
91
|
+
export const OptionTitle = styled.View`
|
|
92
|
+
margin-top: 24px;
|
|
93
|
+
${(props: any) => props.titleContent && css`
|
|
94
|
+
margin-left: ${() => props.isBusinessesSearchList ? '0' : '40px'};
|
|
95
|
+
`}
|
|
96
|
+
`
|
|
@@ -144,7 +144,7 @@ const BusinessPreorderUI = (props: BusinessPreorderParams) => {
|
|
|
144
144
|
|
|
145
145
|
const validateSelectedDate = (curdate: any, menu: any) => {
|
|
146
146
|
const day = moment(curdate).format('d')
|
|
147
|
-
setIsEnabled(menu?.schedule[day]?.enabled || false)
|
|
147
|
+
setIsEnabled(menu?.schedule?.[day]?.enabled || false)
|
|
148
148
|
}
|
|
149
149
|
|
|
150
150
|
const getTimes = (curdate: any, menu: any) => {
|
|
@@ -57,12 +57,12 @@ const BusinessProductsCategoriesUI = (props: any) => {
|
|
|
57
57
|
|
|
58
58
|
if (!lazyLoadProductsRecommended) {
|
|
59
59
|
if (category?.id) {
|
|
60
|
-
scrollViewRef.current.scrollTo({
|
|
60
|
+
scrollViewRef?.current?.scrollTo && scrollViewRef.current.scrollTo({
|
|
61
61
|
y: categoriesLayout[`cat_${category?.id}`]?.y + productListLayout?.y - 70,
|
|
62
62
|
animated: true
|
|
63
63
|
})
|
|
64
64
|
} else {
|
|
65
|
-
scrollViewRef.current.scrollTo({
|
|
65
|
+
scrollViewRef?.current?.scrollTo && scrollViewRef.current.scrollTo({
|
|
66
66
|
y: productListLayout?.y - 70,
|
|
67
67
|
animated: true
|
|
68
68
|
})
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import React from 'react'
|
|
2
|
+
import { OModal, OText, OIcon } from '../../shared'
|
|
3
|
+
import { ScrollView } from 'react-native'
|
|
4
|
+
import { useUtils } from 'ordering-components/native'
|
|
5
|
+
|
|
6
|
+
interface CategoryDescriptionParams {
|
|
7
|
+
openDescription?: {name: string, image: string, description: string} | null,
|
|
8
|
+
setOpenDescription: any;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
function categoryDescriptionPropsAreEqual(prev : any, next : any) {
|
|
12
|
+
return prev.openDescription === next.openDescription
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
const CategoryDescription = (props : CategoryDescriptionParams) => {
|
|
16
|
+
const [{ optimizeImage }] = useUtils()
|
|
17
|
+
return (
|
|
18
|
+
<OModal
|
|
19
|
+
open={!!props.openDescription}
|
|
20
|
+
onClose={() => props.setOpenDescription(null)}
|
|
21
|
+
styleContainerCloseButton={{
|
|
22
|
+
marginLeft: -37,
|
|
23
|
+
width: 55,
|
|
24
|
+
height: 55,
|
|
25
|
+
marginTop: 2
|
|
26
|
+
}}
|
|
27
|
+
>
|
|
28
|
+
<OText size={20} style={{ paddingLeft: 70, paddingRight: 20, bottom: 25 }}>{props.openDescription?.name}</OText>
|
|
29
|
+
<ScrollView style={{ padding: 20 }}>
|
|
30
|
+
{!!props.openDescription?.image && (
|
|
31
|
+
<OIcon
|
|
32
|
+
url={optimizeImage(props.openDescription?.image, 'h_100,c_limit')}
|
|
33
|
+
width={240}
|
|
34
|
+
height={240}
|
|
35
|
+
style={{ borderRadius: 7.6 }}
|
|
36
|
+
/>
|
|
37
|
+
)}
|
|
38
|
+
<OText mBottom={60}>{props.openDescription?.description}</OText>
|
|
39
|
+
</ScrollView>
|
|
40
|
+
</OModal>
|
|
41
|
+
)
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
export const CategoryDescriptionMemoized = React.memo(CategoryDescription,categoryDescriptionPropsAreEqual)
|