ordering-ui-external 1.9.3 → 1.9.5
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/_bundles/{0.ordering-ui.ea0875b41af5b7f1d809.js → 0.ordering-ui.55652fab015bca672f9d.js} +0 -0
- package/_bundles/{1.ordering-ui.ea0875b41af5b7f1d809.js → 1.ordering-ui.55652fab015bca672f9d.js} +0 -0
- package/_bundles/{2.ordering-ui.ea0875b41af5b7f1d809.js → 2.ordering-ui.55652fab015bca672f9d.js} +0 -0
- package/_bundles/{4.ordering-ui.ea0875b41af5b7f1d809.js → 4.ordering-ui.55652fab015bca672f9d.js} +0 -0
- package/_bundles/{5.ordering-ui.ea0875b41af5b7f1d809.js → 5.ordering-ui.55652fab015bca672f9d.js} +0 -0
- package/_bundles/{6.ordering-ui.ea0875b41af5b7f1d809.js → 6.ordering-ui.55652fab015bca672f9d.js} +0 -0
- package/_bundles/{7.ordering-ui.ea0875b41af5b7f1d809.js → 7.ordering-ui.55652fab015bca672f9d.js} +1 -1
- package/_bundles/{7.ordering-ui.ea0875b41af5b7f1d809.js.LICENSE.txt → 7.ordering-ui.55652fab015bca672f9d.js.LICENSE.txt} +0 -0
- package/_bundles/{8.ordering-ui.ea0875b41af5b7f1d809.js → 8.ordering-ui.55652fab015bca672f9d.js} +0 -0
- package/_bundles/{9.ordering-ui.ea0875b41af5b7f1d809.js → 9.ordering-ui.55652fab015bca672f9d.js} +0 -0
- package/_bundles/ordering-ui.55652fab015bca672f9d.js +2 -0
- package/_bundles/{ordering-ui.ea0875b41af5b7f1d809.js.LICENSE.txt → ordering-ui.55652fab015bca672f9d.js.LICENSE.txt} +0 -0
- package/_modules/components/BusinessesListing/index.js +1 -3
- package/_modules/components/VerticalOrdersLayout/SingleOrderCard/index.js +17 -2
- package/_modules/components/VerticalOrdersLayout/styles.js +1 -1
- package/_modules/themes/five/src/components/BusinessListingSearch/index.js +14 -6
- package/_modules/themes/five/src/components/BusinessesListing/layouts/OriginalBusinessesListing/index.js +24 -60
- package/_modules/themes/five/src/components/Cart/index.js +52 -96
- package/_modules/themes/five/src/components/CartContent/index.js +25 -72
- package/_modules/themes/five/src/components/MultiCheckout/index.js +2 -3
- package/_modules/themes/five/src/components/MultiOrdersDetails/index.js +7 -1
- package/_modules/themes/five/src/components/OrdersOption/index.js +2 -1
- package/_modules/utils/index.js +136 -2
- package/package.json +2 -2
- package/src/components/BusinessesListing/index.js +1 -3
- package/src/components/VerticalOrdersLayout/SingleOrderCard/index.js +13 -2
- package/src/components/VerticalOrdersLayout/styles.js +8 -0
- package/src/themes/five/src/components/BusinessListingSearch/index.js +4 -0
- package/src/themes/five/src/components/BusinessesListing/layouts/OriginalBusinessesListing/index.js +218 -261
- package/src/themes/five/src/components/Cart/index.js +44 -54
- package/src/themes/five/src/components/CartContent/index.js +23 -41
- package/src/themes/five/src/components/MultiCheckout/index.js +1 -7
- package/src/themes/five/src/components/MultiOrdersDetails/index.js +19 -13
- package/src/themes/five/src/components/OrdersOption/index.js +2 -1
- package/src/utils/index.js +35 -1
- package/template/app.js +178 -65
- package/template/components/ListenPageChanges/index.js +1 -1
- package/template/pages/MultiCart/index.js +6 -0
- package/_bundles/ordering-ui.ea0875b41af5b7f1d809.js +0 -2
package/src/themes/five/src/components/BusinessesListing/layouts/OriginalBusinessesListing/index.js
CHANGED
|
@@ -47,6 +47,7 @@ import Skeleton from 'react-loading-skeleton'
|
|
|
47
47
|
import { AutoScroll } from '../../../AutoScroll'
|
|
48
48
|
import { CitiesControl } from '../../../CitiesControl'
|
|
49
49
|
import { OrderContextUI } from '../../../OrderContextUI'
|
|
50
|
+
import { OrdersSection } from './OrdersSection'
|
|
50
51
|
|
|
51
52
|
const PIXELS_TO_SCROLL = 300
|
|
52
53
|
|
|
@@ -89,10 +90,12 @@ const BusinessesListingUI = (props) => {
|
|
|
89
90
|
const hideCities = (theme?.business_listing_view?.components?.cities?.hidden || orderState?.options?.type !== 2) ?? true
|
|
90
91
|
const hideSearch = theme?.business_listing_view?.components?.search?.hidden
|
|
91
92
|
const hideFilter = theme?.business_listing_view?.components?.filter?.hidden || hideSearch
|
|
93
|
+
const hideHero = theme?.business_listing_view?.components?.business_hero?.hidden
|
|
94
|
+
const hidePreviousOrders = theme?.business_listing_view?.components?.previous_orders_block?.hidden
|
|
95
|
+
const hideHighestBusiness = theme?.business_listing_view?.components?.highest_rated_business_block?.hidden
|
|
92
96
|
const hideSearchSection = hideCities && hideSearch && hideFilter
|
|
93
97
|
const isAllCategoriesHidden = theme?.business_listing_view?.components?.categories?.hidden
|
|
94
|
-
const businessesIds =
|
|
95
|
-
businessesList.businesses &&
|
|
98
|
+
const businessesIds = businessesList.businesses &&
|
|
96
99
|
businessesList.businesses?.map(business => business.id)
|
|
97
100
|
const isChew = orderingTheme?.theme?.header?.components?.layout?.type?.toLowerCase() === 'chew'
|
|
98
101
|
|
|
@@ -176,44 +179,6 @@ const BusinessesListingUI = (props) => {
|
|
|
176
179
|
setFavoriteIds([...new Set(ids)])
|
|
177
180
|
}, [businessesList?.businesses?.length])
|
|
178
181
|
|
|
179
|
-
const OrdersSection = ({ titleContent }) => {
|
|
180
|
-
return (
|
|
181
|
-
<>
|
|
182
|
-
{isCustomLayout && onRedirectPage && (
|
|
183
|
-
<>
|
|
184
|
-
<OrdersOption
|
|
185
|
-
horizontal
|
|
186
|
-
isBusinessesPage
|
|
187
|
-
onRedirectPage={onRedirectPage}
|
|
188
|
-
titleContent={t('CARTS', 'Carts')}
|
|
189
|
-
businessesIds={businessesIds}
|
|
190
|
-
customArray={
|
|
191
|
-
getCustomArray(orderState.carts)?.filter(cart => cart.products.length > 0)
|
|
192
|
-
}
|
|
193
|
-
isCustomLayout
|
|
194
|
-
isBusinessesLoading={businessesList.loading}
|
|
195
|
-
isCustomerMode={isCustomerMode}
|
|
196
|
-
franchiseId={props.franchiseId}
|
|
197
|
-
/>
|
|
198
|
-
<OrdersOption
|
|
199
|
-
horizontal
|
|
200
|
-
asDashboard
|
|
201
|
-
isBusinessesPage
|
|
202
|
-
businessesIds={businessesIds}
|
|
203
|
-
onRedirectPage={onRedirectPage}
|
|
204
|
-
userCustomerId={userCustomer?.id}
|
|
205
|
-
isCustomLayout
|
|
206
|
-
titleContent={titleContent}
|
|
207
|
-
isBusinessesLoading={businessesList.loading}
|
|
208
|
-
isCustomerMode={isCustomerMode}
|
|
209
|
-
franchiseId={props.franchiseId}
|
|
210
|
-
/>
|
|
211
|
-
</>
|
|
212
|
-
)}
|
|
213
|
-
</>
|
|
214
|
-
)
|
|
215
|
-
}
|
|
216
|
-
|
|
217
182
|
if (logosLayout) {
|
|
218
183
|
return (
|
|
219
184
|
<BusinessLogosWrapper>
|
|
@@ -242,243 +207,235 @@ const BusinessesListingUI = (props) => {
|
|
|
242
207
|
}
|
|
243
208
|
|
|
244
209
|
return (
|
|
245
|
-
|
|
246
|
-
{
|
|
247
|
-
<
|
|
248
|
-
{
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
{windowSize.width < 576 && (
|
|
256
|
-
<OrderContextUI isBusinessList />
|
|
257
|
-
)}
|
|
258
|
-
{(configs?.business_listing_hide_image?.value !== '1' && !isChew) && (
|
|
259
|
-
<BusinessHeroImg
|
|
260
|
-
bgimage={theme.images?.general?.businessHero}
|
|
261
|
-
height={theme?.business_listing_view?.components?.business_hero?.style?.height}
|
|
262
|
-
/>
|
|
263
|
-
)}
|
|
264
|
-
</BusinessBanner>
|
|
265
|
-
)}
|
|
266
|
-
{!!Object.values(orderState?.carts)?.length && (
|
|
267
|
-
<OrderProgress
|
|
268
|
-
isChew={isChew}
|
|
269
|
-
franchiseId={props.franchiseId}
|
|
270
|
-
userCustomerId={userCustomer?.id}
|
|
271
|
-
asDashboard={isCustomerMode}
|
|
272
|
-
isCustomerMode={isCustomerMode}
|
|
273
|
-
/>
|
|
274
|
-
)}
|
|
275
|
-
{(configs?.business_listing_hide_image?.value !== '1' && isChew) && (
|
|
276
|
-
<BusinessHeroImg
|
|
277
|
-
bgimage={theme.images?.general?.businessHero}
|
|
278
|
-
height={theme?.business_listing_view?.components?.business_hero?.style?.height}
|
|
279
|
-
/>
|
|
280
|
-
)}
|
|
281
|
-
{isCustomerMode && (
|
|
282
|
-
<OrdersSection titleContent={t('PREVIOUS_ORDERS', 'Previous orders')} />
|
|
283
|
-
)}
|
|
284
|
-
{!isCustomerMode && !hideSearchSection && (
|
|
285
|
-
<>
|
|
286
|
-
<WrapperSearch isCustomLayout={isCustomLayout} isCustomerMode={isCustomerMode}>
|
|
287
|
-
{!hideSearch && windowSize.width <= 1200 && (
|
|
288
|
-
<SearchBar
|
|
289
|
-
lazyLoad
|
|
290
|
-
search={searchValue}
|
|
291
|
-
isCustomLayout={isCustomLayout}
|
|
292
|
-
placeholder={t('SEARCH_BUSINESSES', 'Search Businesses')}
|
|
293
|
-
onSearch={handleChangeSearch}
|
|
294
|
-
handleCustomEnter={() => onRedirectPage({ page: 'business_search' })}
|
|
295
|
-
/>
|
|
296
|
-
)}
|
|
297
|
-
{!hideCities && citiesState?.cities?.length > 0 && (
|
|
298
|
-
<Button color='primary' onClick={handleOpenCities}>
|
|
299
|
-
{citiesState?.cities?.find(city => city?.id === orderState?.options?.city_id)?.name || t('SELECT_A_CITY', 'Select a city')}
|
|
300
|
-
</Button>
|
|
301
|
-
)}
|
|
302
|
-
{!hideFilter && configs?.advanced_business_search_enabled?.value === '1' && (
|
|
303
|
-
<FiFilter onClick={() => onRedirectPage({ page: 'business_search' })} />
|
|
304
|
-
)}
|
|
305
|
-
{isCustomLayout && (
|
|
306
|
-
<FiMap onClick={toggleMap} />
|
|
307
|
-
)}
|
|
308
|
-
</WrapperSearch>
|
|
309
|
-
{activeMap && (
|
|
310
|
-
<BusinessesMap
|
|
311
|
-
businessList={businessesList.businesses}
|
|
312
|
-
userLocation={orderState?.options?.address?.location}
|
|
313
|
-
setErrors={setMapErrors}
|
|
314
|
-
/>
|
|
315
|
-
)}
|
|
316
|
-
</>
|
|
317
|
-
)}
|
|
318
|
-
{!isChew && hasHighRatedBusiness && !props.franchiseId && (
|
|
319
|
-
<HightestRatedWrapper>
|
|
320
|
-
<Divider />
|
|
321
|
-
<HighestRated
|
|
322
|
-
handleClickAddress={handleClickAddress}
|
|
323
|
-
setHasHighRatedBusiness={setHasHighRatedBusiness}
|
|
324
|
-
onBusinessClick={onBusinessClick}
|
|
325
|
-
isCustomerMode={isCustomerMode}
|
|
326
|
-
favoriteIds={favoriteIds}
|
|
327
|
-
setFavoriteIds={setFavoriteIds}
|
|
210
|
+
<BusinessContainer>
|
|
211
|
+
{(windowSize.width < 576 || (configs?.business_listing_hide_image?.value !== '1' && !isChew)) && (
|
|
212
|
+
<BusinessBanner>
|
|
213
|
+
{windowSize.width < 576 && (
|
|
214
|
+
<OrderContextUI isBusinessList />
|
|
215
|
+
)}
|
|
216
|
+
{(configs?.business_listing_hide_image?.value !== '1' && !isChew) && !hideHero && (
|
|
217
|
+
<BusinessHeroImg
|
|
218
|
+
bgimage={theme.images?.general?.businessHero}
|
|
219
|
+
height={theme?.business_listing_view?.components?.business_hero?.style?.height}
|
|
328
220
|
/>
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
<
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
221
|
+
)}
|
|
222
|
+
</BusinessBanner>
|
|
223
|
+
)}
|
|
224
|
+
{!!Object.values(orderState?.carts)?.length && (
|
|
225
|
+
<OrderProgress
|
|
226
|
+
isChew={isChew}
|
|
227
|
+
franchiseId={props.franchiseId}
|
|
228
|
+
userCustomerId={userCustomer?.id}
|
|
229
|
+
asDashboard={isCustomerMode}
|
|
230
|
+
isCustomerMode={isCustomerMode}
|
|
231
|
+
/>
|
|
232
|
+
)}
|
|
233
|
+
{(configs?.business_listing_hide_image?.value !== '1' && isChew) && (
|
|
234
|
+
<BusinessHeroImg
|
|
235
|
+
bgimage={theme.images?.general?.businessHero}
|
|
236
|
+
height={theme?.business_listing_view?.components?.business_hero?.style?.height}
|
|
237
|
+
/>
|
|
238
|
+
)}
|
|
239
|
+
{isCustomerMode && !hidePreviousOrders && !businessesList.loading && (
|
|
240
|
+
<OrdersSection
|
|
241
|
+
titleContent={t('PREVIOUS_ORDERS', 'Previous orders')}
|
|
242
|
+
onRedirectPage={onRedirectPage}
|
|
243
|
+
businessesIds={businessesIds}
|
|
244
|
+
getCustomArray={getCustomArray}
|
|
245
|
+
businessesList={businessesList}
|
|
246
|
+
isCustomerMode={isCustomerMode}
|
|
247
|
+
userCustomer={userCustomer}
|
|
248
|
+
/>
|
|
249
|
+
)}
|
|
250
|
+
{!isCustomerMode && !hideSearchSection && (
|
|
251
|
+
<>
|
|
252
|
+
<WrapperSearch isCustomLayout={isCustomLayout} isCustomerMode={isCustomerMode}>
|
|
253
|
+
{!hideSearch && windowSize.width <= 1200 && (
|
|
351
254
|
<SearchBar
|
|
352
255
|
lazyLoad
|
|
353
256
|
search={searchValue}
|
|
354
257
|
isCustomLayout={isCustomLayout}
|
|
355
258
|
placeholder={t('SEARCH_BUSINESSES', 'Search Businesses')}
|
|
356
259
|
onSearch={handleChangeSearch}
|
|
260
|
+
handleCustomEnter={() => onRedirectPage({ page: 'business_search' })}
|
|
357
261
|
/>
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
262
|
+
)}
|
|
263
|
+
{!hideCities && citiesState?.cities?.length > 0 && (
|
|
264
|
+
<Button color='primary' onClick={handleOpenCities}>
|
|
265
|
+
{citiesState?.cities?.find(city => city?.id === orderState?.options?.city_id)?.name || t('SELECT_A_CITY', 'Select a city')}
|
|
266
|
+
</Button>
|
|
267
|
+
)}
|
|
268
|
+
{!hideFilter && configs?.advanced_business_search_enabled?.value === '1' && (
|
|
269
|
+
<FiFilter onClick={() => onRedirectPage({ page: 'business_search' })} />
|
|
270
|
+
)}
|
|
271
|
+
{isCustomLayout && (
|
|
272
|
+
<FiMap onClick={toggleMap} />
|
|
273
|
+
)}
|
|
274
|
+
</WrapperSearch>
|
|
275
|
+
{activeMap && (
|
|
276
|
+
<BusinessesMap
|
|
277
|
+
businessList={businessesList.businesses}
|
|
278
|
+
userLocation={orderState?.options?.address?.location}
|
|
279
|
+
setErrors={setMapErrors}
|
|
280
|
+
/>
|
|
281
|
+
)}
|
|
282
|
+
</>
|
|
283
|
+
)}
|
|
284
|
+
{!isChew && hasHighRatedBusiness && !props.franchiseId && !hideHighestBusiness && (
|
|
285
|
+
<HightestRatedWrapper>
|
|
286
|
+
<Divider />
|
|
287
|
+
<HighestRated
|
|
288
|
+
handleClickAddress={handleClickAddress}
|
|
289
|
+
setHasHighRatedBusiness={setHasHighRatedBusiness}
|
|
290
|
+
onBusinessClick={onBusinessClick}
|
|
291
|
+
isCustomerMode={isCustomerMode}
|
|
292
|
+
favoriteIds={favoriteIds}
|
|
293
|
+
setFavoriteIds={setFavoriteIds}
|
|
294
|
+
disabledCities
|
|
372
295
|
/>
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
296
|
+
<Divider />
|
|
297
|
+
</HightestRatedWrapper>
|
|
298
|
+
)}
|
|
299
|
+
|
|
300
|
+
<PageBanner position='web_business_listing' />
|
|
301
|
+
|
|
302
|
+
{(((configs && configs?.business_listing_categories !== false) || !isCustomLayout) && !isAllCategoriesHidden) && (
|
|
303
|
+
<BusinessTypeFilter
|
|
304
|
+
images={props.images}
|
|
305
|
+
businessTypes={props.businessTypes}
|
|
306
|
+
defaultBusinessType={props.defaultBusinessType}
|
|
307
|
+
handleChangeBusinessType={handleChangeBusinessType}
|
|
308
|
+
/>
|
|
309
|
+
)}
|
|
310
|
+
{isCustomerMode && (
|
|
311
|
+
<SearchContainer>
|
|
312
|
+
{isCustomLayout && (
|
|
313
|
+
<BusinessesTitle isCustomerMode={isCustomerMode}>
|
|
380
314
|
{t('BUSINESSES', 'Businesses')}
|
|
381
315
|
</BusinessesTitle>
|
|
382
316
|
)}
|
|
317
|
+
<WrapperSearch isCustomLayout={isCustomLayout} isCustomerMode={isCustomerMode}>
|
|
318
|
+
<SearchBar
|
|
319
|
+
lazyLoad
|
|
320
|
+
search={searchValue}
|
|
321
|
+
isCustomLayout={isCustomLayout}
|
|
322
|
+
placeholder={t('SEARCH_BUSINESSES', 'Search Businesses')}
|
|
323
|
+
onSearch={handleChangeSearch}
|
|
324
|
+
/>
|
|
325
|
+
{configs?.advanced_business_search_enabled?.value === '1' && (
|
|
326
|
+
<FiFilter onClick={() => onRedirectPage({ page: 'business_search' })} />
|
|
327
|
+
)}
|
|
328
|
+
{isCustomLayout && (
|
|
329
|
+
<FiMap onClick={toggleMap} />
|
|
330
|
+
)}
|
|
331
|
+
</WrapperSearch>
|
|
332
|
+
</SearchContainer>
|
|
333
|
+
)}
|
|
334
|
+
{isCustomerMode && activeMap && (
|
|
335
|
+
<BusinessesMap
|
|
336
|
+
businessList={businessesList.businesses}
|
|
337
|
+
userLocation={orderState?.options?.address?.location}
|
|
338
|
+
setErrors={setMapErrors}
|
|
339
|
+
/>
|
|
340
|
+
)}
|
|
341
|
+
<>
|
|
342
|
+
{((!isCustomLayout && isCustomerMode && businessesList?.businesses?.length > 0) || isChew) && (
|
|
343
|
+
<BusinessesTitle>
|
|
344
|
+
{t('BUSINESSES', 'Businesses')}
|
|
345
|
+
</BusinessesTitle>
|
|
346
|
+
)}
|
|
383
347
|
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
348
|
+
<BusinessList>
|
|
349
|
+
{
|
|
350
|
+
!businessesList.loading && businessesList.businesses.length === 0 && businessesList?.fetched && (
|
|
351
|
+
<NotFoundSource
|
|
352
|
+
content={t('NOT_FOUND_BUSINESSES', 'No businesses to delivery / pick up at this address, please change filters or change address.')}
|
|
353
|
+
>
|
|
354
|
+
<Button
|
|
355
|
+
outline
|
|
356
|
+
color='primary'
|
|
357
|
+
onClick={() => handleClickAddress()}
|
|
358
|
+
style={{ height: '44px' }}
|
|
389
359
|
>
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
<
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
width='70%'
|
|
360
|
+
{t('CHANGE_ADDRESS', 'Select other Address')}
|
|
361
|
+
</Button>
|
|
362
|
+
</NotFoundSource>
|
|
363
|
+
)
|
|
364
|
+
}
|
|
365
|
+
{
|
|
366
|
+
businessesList.businesses?.map((business) => (
|
|
367
|
+
<BusinessController
|
|
368
|
+
key={business.id}
|
|
369
|
+
className='card'
|
|
370
|
+
business={business}
|
|
371
|
+
isBusinessOpen={business.open}
|
|
372
|
+
handleCustomClick={handleBusinessClick}
|
|
373
|
+
orderType={orderState?.options?.type}
|
|
374
|
+
isCustomLayout={isCustomLayout}
|
|
375
|
+
isCustomerMode={isCustomerMode}
|
|
376
|
+
onPreorderBusiness={setPreorderBusiness}
|
|
377
|
+
businessHeader={business?.header}
|
|
378
|
+
businessFeatured={business?.featured}
|
|
379
|
+
businessOffers={business?.offers}
|
|
380
|
+
businessLogo={business?.logo}
|
|
381
|
+
businessReviews={business?.reviews?.total}
|
|
382
|
+
businessDeliveryPrice={business?.delivery_price}
|
|
383
|
+
businessDeliveryTime={business?.delivery_time}
|
|
384
|
+
businessPickupTime={business?.pickup_time}
|
|
385
|
+
businessDistance={business?.distance}
|
|
386
|
+
handleUpdateBusinessList={handleUpdateBusinessList}
|
|
387
|
+
favoriteIds={favoriteIds}
|
|
388
|
+
setFavoriteIds={setFavoriteIds}
|
|
389
|
+
/>
|
|
390
|
+
))
|
|
391
|
+
}
|
|
392
|
+
{(businessesList.loading || !businessesList?.fetched) && (
|
|
393
|
+
[...Array(paginationProps?.nextPageItems > 4 ? paginationProps.nextPageItems : 8).keys()].map(i => (
|
|
394
|
+
<BusinessController
|
|
395
|
+
key={i}
|
|
396
|
+
className='card'
|
|
397
|
+
business={{}}
|
|
398
|
+
isSkeleton
|
|
399
|
+
orderType={orderState?.options?.type}
|
|
400
|
+
/>
|
|
401
|
+
))
|
|
402
|
+
)}
|
|
403
|
+
</BusinessList>
|
|
404
|
+
</>
|
|
405
|
+
<Modal
|
|
406
|
+
open={isPreorder}
|
|
407
|
+
width='760px'
|
|
408
|
+
onClose={() => handleClosePreorder()}
|
|
409
|
+
>
|
|
410
|
+
<BusinessPreorder
|
|
411
|
+
business={preorderBusiness}
|
|
412
|
+
handleClick={handleBusinessClick}
|
|
413
|
+
showButton
|
|
414
|
+
/>
|
|
415
|
+
</Modal>
|
|
416
|
+
<Modal
|
|
417
|
+
title={t('SELECT_A_STORE', 'Select a store')}
|
|
418
|
+
open={modals.citiesOpen}
|
|
419
|
+
width='70%'
|
|
420
|
+
onClose={() => setModals({ ...modals, citiesOpen: false })}
|
|
421
|
+
>
|
|
422
|
+
<CitiesControl
|
|
423
|
+
cities={citiesState?.cities}
|
|
424
|
+
handleChangeCity={handleChangeCity}
|
|
456
425
|
onClose={() => setModals({ ...modals, citiesOpen: false })}
|
|
457
|
-
>
|
|
458
|
-
<CitiesControl
|
|
459
|
-
cities={citiesState?.cities}
|
|
460
|
-
handleChangeCity={handleChangeCity}
|
|
461
|
-
onClose={() => setModals({ ...modals, citiesOpen: false })}
|
|
462
|
-
/>
|
|
463
|
-
</Modal>
|
|
464
|
-
|
|
465
|
-
<Alert
|
|
466
|
-
title={!mapErrors ? t('SEARCH', 'Search') : t('BUSINESSES_MAP', 'Businesses Map')}
|
|
467
|
-
content={alertState.content}
|
|
468
|
-
acceptText={t('ACCEPT', 'Accept')}
|
|
469
|
-
open={alertState.open}
|
|
470
|
-
onClose={() => handleCloseAlerts()}
|
|
471
|
-
onAccept={() => handleCloseAlerts()}
|
|
472
|
-
closeOnBackdrop={false}
|
|
473
426
|
/>
|
|
474
|
-
</
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
427
|
+
</Modal>
|
|
428
|
+
|
|
429
|
+
<Alert
|
|
430
|
+
title={!mapErrors ? t('SEARCH', 'Search') : t('BUSINESSES_MAP', 'Businesses Map')}
|
|
431
|
+
content={alertState.content}
|
|
432
|
+
acceptText={t('ACCEPT', 'Accept')}
|
|
433
|
+
open={alertState.open}
|
|
434
|
+
onClose={() => handleCloseAlerts()}
|
|
435
|
+
onAccept={() => handleCloseAlerts()}
|
|
436
|
+
closeOnBackdrop={false}
|
|
437
|
+
/>
|
|
438
|
+
</BusinessContainer>
|
|
482
439
|
)
|
|
483
440
|
}
|
|
484
441
|
|