ordering-ui-external 1.9.1 → 1.9.3
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 +1 -0
- package/_bundles/{1.ordering-ui.a97bdaf67c563ada4c74.js → 1.ordering-ui.ea0875b41af5b7f1d809.js} +1 -1
- package/_bundles/{2.ordering-ui.a97bdaf67c563ada4c74.js → 2.ordering-ui.ea0875b41af5b7f1d809.js} +1 -1
- package/_bundles/{4.ordering-ui.a97bdaf67c563ada4c74.js → 4.ordering-ui.ea0875b41af5b7f1d809.js} +1 -1
- package/_bundles/{5.ordering-ui.a97bdaf67c563ada4c74.js → 5.ordering-ui.ea0875b41af5b7f1d809.js} +1 -1
- package/_bundles/{6.ordering-ui.a97bdaf67c563ada4c74.js → 6.ordering-ui.ea0875b41af5b7f1d809.js} +1 -1
- package/_bundles/{7.ordering-ui.a97bdaf67c563ada4c74.js → 7.ordering-ui.ea0875b41af5b7f1d809.js} +2 -2
- package/_bundles/{7.ordering-ui.a97bdaf67c563ada4c74.js.LICENSE.txt → 7.ordering-ui.ea0875b41af5b7f1d809.js.LICENSE.txt} +0 -0
- package/_bundles/{8.ordering-ui.a97bdaf67c563ada4c74.js → 8.ordering-ui.ea0875b41af5b7f1d809.js} +1 -1
- package/_bundles/{9.ordering-ui.a97bdaf67c563ada4c74.js → 9.ordering-ui.ea0875b41af5b7f1d809.js} +1 -1
- package/_bundles/ordering-ui.ea0875b41af5b7f1d809.js +2 -0
- package/_bundles/{ordering-ui.a97bdaf67c563ada4c74.js.LICENSE.txt → ordering-ui.ea0875b41af5b7f1d809.js.LICENSE.txt} +0 -0
- package/_modules/components/VerticalOrdersLayout/SingleOrderCard/index.js +9 -10
- package/_modules/themes/five/index.js +7 -0
- package/_modules/themes/five/src/components/AddressList/index.js +3 -2
- package/_modules/themes/five/src/components/BusinessItemAccordion/index.js +3 -2
- package/_modules/themes/five/src/components/BusinessProductsCategories/index.js +8 -3
- package/_modules/themes/five/src/components/BusinessProductsList/index.js +50 -14
- package/_modules/themes/five/src/components/BusinessProductsListing/index.js +9 -2
- package/_modules/themes/five/src/components/BusinessProductsListing/styles.js +10 -6
- package/_modules/themes/five/src/components/BusinessesListing/layouts/OriginalBusinessesListing/index.js +34 -129
- package/_modules/themes/five/src/components/BusinessesListing/layouts/OriginalBusinessesListing/styles.js +29 -40
- package/_modules/themes/five/src/components/Cart/index.js +6 -3
- package/_modules/themes/five/src/components/CartContent/index.js +97 -2
- package/_modules/themes/five/src/components/CartContent/styles.js +6 -4
- package/_modules/themes/five/src/components/Checkout/index.js +8 -2
- package/_modules/themes/five/src/components/Checkout/styles.js +10 -4
- package/_modules/themes/five/src/components/Header/index.js +26 -34
- package/_modules/themes/five/src/components/Header/styles.js +46 -35
- package/_modules/themes/five/src/components/HeaderOption/index.js +3 -2
- package/_modules/themes/five/src/components/HomeHero/layouts/OriginalHomeHero/index.js +3 -2
- package/_modules/themes/five/src/components/MultiCheckout/index.js +20 -10
- package/_modules/themes/five/src/components/MultiCheckout/styles.js +11 -8
- package/_modules/themes/five/src/components/MultiOrdersDetails/index.js +2 -0
- package/_modules/themes/five/src/components/OrderContextUI/index.js +192 -0
- package/_modules/themes/five/src/components/OrderContextUI/styles.js +41 -0
- package/_modules/themes/five/src/components/OrderDetails/index.js +5 -2
- package/_modules/themes/five/src/components/OrdersOption/PreviousBusinessOrdered/index.js +8 -2
- package/_modules/themes/five/src/components/OrdersOption/PreviousBusinessOrdered/styles.js +8 -2
- package/_modules/themes/five/src/components/ProductItemAccordion/index.js +17 -8
- package/_modules/themes/five/src/components/ProductItemAccordion/styles.js +27 -27
- package/_modules/themes/five/src/components/ProductOptionSubOption/index.js +7 -2
- package/_modules/themes/five/src/components/ProductOptionSubOption/styles.js +17 -14
- package/_modules/themes/five/src/components/SingleOrderCard/index.js +16 -16
- package/_modules/themes/five/src/components/SingleOrderCard/styles.js +49 -41
- package/package.json +2 -1
- package/src/components/VerticalOrdersLayout/SingleOrderCard/index.js +12 -12
- package/src/themes/five/index.js +2 -0
- package/src/themes/five/src/components/AddressList/index.js +3 -2
- package/src/themes/five/src/components/BusinessItemAccordion/index.js +2 -1
- package/src/themes/five/src/components/BusinessProductsCategories/index.js +8 -3
- package/src/themes/five/src/components/BusinessProductsList/index.js +54 -18
- package/src/themes/five/src/components/BusinessProductsListing/index.js +14 -2
- package/src/themes/five/src/components/BusinessProductsListing/styles.js +18 -6
- package/src/themes/five/src/components/BusinessesListing/layouts/OriginalBusinessesListing/index.js +2 -85
- package/src/themes/five/src/components/BusinessesListing/layouts/OriginalBusinessesListing/styles.js +2 -77
- package/src/themes/five/src/components/Cart/index.js +6 -3
- package/src/themes/five/src/components/CartContent/index.js +61 -3
- package/src/themes/five/src/components/CartContent/styles.js +6 -0
- package/src/themes/five/src/components/Checkout/index.js +16 -2
- package/src/themes/five/src/components/Checkout/styles.js +19 -6
- package/src/themes/five/src/components/Header/index.js +281 -277
- package/src/themes/five/src/components/Header/styles.js +20 -51
- package/src/themes/five/src/components/HeaderOption/index.js +3 -2
- package/src/themes/five/src/components/HomeHero/layouts/OriginalHomeHero/index.js +2 -1
- package/src/themes/five/src/components/MultiCheckout/index.js +26 -6
- package/src/themes/five/src/components/MultiCheckout/styles.js +8 -13
- package/src/themes/five/src/components/MultiOrdersDetails/index.js +2 -0
- package/src/themes/five/src/components/OrderContextUI/index.js +133 -0
- package/src/themes/five/src/components/OrderContextUI/styles.js +86 -0
- package/src/themes/five/src/components/OrderDetails/index.js +6 -2
- package/src/themes/five/src/components/OrdersOption/PreviousBusinessOrdered/index.js +5 -2
- package/src/themes/five/src/components/OrdersOption/PreviousBusinessOrdered/styles.js +4 -0
- package/src/themes/five/src/components/ProductItemAccordion/index.js +58 -40
- package/src/themes/five/src/components/ProductItemAccordion/styles.js +4 -3
- package/src/themes/five/src/components/ProductOptionSubOption/index.js +8 -1
- package/src/themes/five/src/components/ProductOptionSubOption/styles.js +6 -0
- package/src/themes/five/src/components/SingleOrderCard/index.js +12 -13
- package/src/themes/five/src/components/SingleOrderCard/styles.js +26 -7
- package/template/app.js +1 -1
- package/template/components/ListenPageChanges/index.js +3 -2
- package/template/components/OrderingThemeUpdated/index.js +41 -0
- package/template/helmetdata.json +7 -0
- package/template/pages/MessagesList/index.js +2 -0
- package/template/pages/MultiCart/index.js +24 -0
- package/template/pages/MultiCheckout/index.js +86 -10
- package/template/pages/MultiOrdersDetails/index.js +9 -4
- package/_bundles/0.ordering-ui.a97bdaf67c563ada4c74.js +0 -1
- package/_bundles/ordering-ui.a97bdaf67c563ada4c74.js +0 -2
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
|
|
2
1
|
import React, { useState, useEffect, useRef } from 'react'
|
|
3
2
|
import { useLocation } from 'react-router-dom'
|
|
4
3
|
import { useSession, useLanguage, useOrder, useEvent, useConfig, useCustomer, useUtils, useOrderingTheme } from 'ordering-components-external'
|
|
@@ -27,7 +26,8 @@ import {
|
|
|
27
26
|
Divider,
|
|
28
27
|
AddressFormWrapper,
|
|
29
28
|
LanguageSelectorWrapper,
|
|
30
|
-
HeaderSearchMode
|
|
29
|
+
HeaderSearchMode,
|
|
30
|
+
LeftSide
|
|
31
31
|
} from './styles'
|
|
32
32
|
import { useWindowSize } from '../../../../../hooks/useWindowSize'
|
|
33
33
|
import { useOnlineStatus } from '../../../../../hooks/useOnlineStatus'
|
|
@@ -97,6 +97,7 @@ export const Header = (props) => {
|
|
|
97
97
|
const configTypes = configState?.configs?.order_types_allowed?.value.split('|').map(value => Number(value)) || []
|
|
98
98
|
const isPreOrderSetting = configState?.configs?.preorder_status_enabled?.value === '1'
|
|
99
99
|
const isChew = orderingTheme?.theme?.header?.components?.layout?.type?.toLowerCase() === 'chew'
|
|
100
|
+
const isHideLanguages = theme?.header?.components?.language_selector?.hidden
|
|
100
101
|
|
|
101
102
|
const handleSuccessSignup = (user) => {
|
|
102
103
|
login({
|
|
@@ -209,15 +210,9 @@ export const Header = (props) => {
|
|
|
209
210
|
}, [orderState?.options?.address?.location, pathname])
|
|
210
211
|
|
|
211
212
|
return (
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
<
|
|
215
|
-
{BeforeElement}
|
|
216
|
-
</React.Fragment>))}
|
|
217
|
-
{props.beforeComponents?.map((BeforeComponent, i) => (
|
|
218
|
-
<BeforeComponent key={i} {...props} />))}
|
|
219
|
-
<HeaderContainer isChew={isChew}>
|
|
220
|
-
<InnerHeader>
|
|
213
|
+
<HeaderContainer isChew={isChew}>
|
|
214
|
+
<InnerHeader>
|
|
215
|
+
<LeftSide>
|
|
221
216
|
<LeftHeader id='left-side'>
|
|
222
217
|
<SidebarMenu
|
|
223
218
|
auth={auth}
|
|
@@ -233,7 +228,7 @@ export const Header = (props) => {
|
|
|
233
228
|
<img alt='Isotype' width={isChew ? '70px' : '35px'} height={isChew ? '20px' : '45px'} src={isChew ? theme?.images?.logos?.chewLogo : orderingTheme?.my_products?.components?.images?.components?.logo?.components?.image || (isHome ? theme?.images?.logos?.isotypeInvert : theme?.images?.logos?.isotype)} loading='lazy' />
|
|
234
229
|
</LogoHeader>
|
|
235
230
|
</LeftHeader>
|
|
236
|
-
{isShowOrderOptions && !props.isCustomLayout && (
|
|
231
|
+
{isShowOrderOptions && !props.isCustomLayout && windowSize.width >= 576 && (
|
|
237
232
|
<Menu id='center-side' className='left-header' isCustomerMode={isCustomerMode} isChew={isChew}>
|
|
238
233
|
{windowSize.width > 820 && isFarAway && (
|
|
239
234
|
<FarAwayMessage>
|
|
@@ -313,106 +308,118 @@ export const Header = (props) => {
|
|
|
313
308
|
)}
|
|
314
309
|
</Menu>
|
|
315
310
|
)}
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
/>
|
|
369
|
-
)
|
|
370
|
-
)}
|
|
371
|
-
{windowSize.width > 768 && (
|
|
372
|
-
<UserPopover
|
|
373
|
-
withLogout
|
|
311
|
+
</LeftSide>
|
|
312
|
+
{windowSize.width > 1200 && window.location.pathname === '/search' && (
|
|
313
|
+
<HeaderSearchMode>
|
|
314
|
+
<SearchBar
|
|
315
|
+
lazyLoad
|
|
316
|
+
search={searchValue}
|
|
317
|
+
placeholder={t('SEARCH_BUSINESSES', 'Search Businesses')}
|
|
318
|
+
starbucksStyle
|
|
319
|
+
onSearch={(value) => setSearchValue(value)}
|
|
320
|
+
handleCustomEnter={() => events.emit('go_to_page', { page: 'business_search' })}
|
|
321
|
+
/>
|
|
322
|
+
</HeaderSearchMode>
|
|
323
|
+
)}
|
|
324
|
+
{onlineStatus && (
|
|
325
|
+
<RightHeader id='right-side'>
|
|
326
|
+
<Menu isCustomerMode={isCustomerMode}>
|
|
327
|
+
{
|
|
328
|
+
!auth && windowSize.width > 920 && (
|
|
329
|
+
<>
|
|
330
|
+
<MenuLink
|
|
331
|
+
name='signin'
|
|
332
|
+
highlight={isChew && 1}
|
|
333
|
+
style={{ whiteSpace: 'nowrap' }}
|
|
334
|
+
onClick={() => handleOpenLoginSignUp('login')}
|
|
335
|
+
>
|
|
336
|
+
{t('LOGIN', theme?.defaultLanguages?.LOGIN || 'Login')}
|
|
337
|
+
</MenuLink>
|
|
338
|
+
{!isHideSignup && (
|
|
339
|
+
<MenuLink
|
|
340
|
+
name='signup'
|
|
341
|
+
highlight={1}
|
|
342
|
+
style={{ whiteSpace: 'nowrap' }}
|
|
343
|
+
onClick={() => handleOpenLoginSignUp('signup')}
|
|
344
|
+
>
|
|
345
|
+
{t('SIGN_UP', theme?.defaultLanguages?.SIGN_UP || 'Sign up')}
|
|
346
|
+
</MenuLink>
|
|
347
|
+
)}
|
|
348
|
+
</>
|
|
349
|
+
)
|
|
350
|
+
}
|
|
351
|
+
{
|
|
352
|
+
auth && (
|
|
353
|
+
<>
|
|
354
|
+
{isShowOrderOptions && (
|
|
355
|
+
windowSize.width > 768 ? (
|
|
356
|
+
<CartPopover
|
|
357
|
+
open={openPopover.cart}
|
|
358
|
+
carts={cartsWithProducts}
|
|
359
|
+
onClick={() => handleTogglePopover('cart')}
|
|
360
|
+
onClose={() => handleClosePopover('cart')}
|
|
361
|
+
auth={auth}
|
|
362
|
+
location={location}
|
|
374
363
|
isCustomerMode={isCustomerMode}
|
|
375
|
-
|
|
376
|
-
handleOpenAddressModal={() => openModal('address')}
|
|
377
|
-
onClick={() => handleTogglePopover('user')}
|
|
378
|
-
onClose={() => handleClosePopover('user')}
|
|
364
|
+
setPreorderBusiness={setPreorderBusiness}
|
|
379
365
|
/>
|
|
380
|
-
)
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
366
|
+
) : (
|
|
367
|
+
<HeaderOption
|
|
368
|
+
variant='cart'
|
|
369
|
+
totalCarts={cartsWithProducts?.length}
|
|
370
|
+
onClick={(variant) => openModal(variant)}
|
|
371
|
+
/>
|
|
372
|
+
)
|
|
373
|
+
)}
|
|
374
|
+
{windowSize.width > 768 && (
|
|
375
|
+
<UserPopover
|
|
376
|
+
withLogout
|
|
377
|
+
isCustomerMode={isCustomerMode}
|
|
378
|
+
open={openPopover.user}
|
|
379
|
+
handleOpenAddressModal={() => openModal('address')}
|
|
380
|
+
onClick={() => handleTogglePopover('user')}
|
|
381
|
+
onClose={() => handleClosePopover('user')}
|
|
382
|
+
/>
|
|
383
|
+
)}
|
|
384
|
+
</>
|
|
385
|
+
)
|
|
386
|
+
}
|
|
387
|
+
{!isHideLanguages && (
|
|
384
388
|
<LanguageSelectorWrapper>
|
|
385
389
|
<LanguageSelector />
|
|
386
390
|
</LanguageSelectorWrapper>
|
|
387
|
-
</Menu>
|
|
388
|
-
</RightHeader>
|
|
389
|
-
)}
|
|
390
|
-
</InnerHeader>
|
|
391
|
-
{onlineStatus && isShowOrderOptions && !props.isCustomLayout && !isCustomerMode && (
|
|
392
|
-
windowSize.width > 768 && windowSize.width <= 820 ? (
|
|
393
|
-
<SubMenu>
|
|
394
|
-
{isFarAway && (
|
|
395
|
-
<FarAwayMessage>
|
|
396
|
-
<TiWarningOutline />
|
|
397
|
-
<span>{t('YOU_ARE_FAR_FROM_ADDRESS', 'You are far from this address')}</span>
|
|
398
|
-
</FarAwayMessage>
|
|
399
391
|
)}
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
392
|
+
</Menu>
|
|
393
|
+
</RightHeader>
|
|
394
|
+
)}
|
|
395
|
+
</InnerHeader>
|
|
396
|
+
{onlineStatus && isShowOrderOptions && !props.isCustomLayout && !isCustomerMode && (
|
|
397
|
+
windowSize.width > 768 && windowSize.width <= 820 ? (
|
|
398
|
+
<SubMenu>
|
|
399
|
+
{isFarAway && (
|
|
400
|
+
<FarAwayMessage>
|
|
401
|
+
<TiWarningOutline />
|
|
402
|
+
<span>{t('YOU_ARE_FAR_FROM_ADDRESS', 'You are far from this address')}</span>
|
|
403
|
+
</FarAwayMessage>
|
|
404
|
+
)}
|
|
405
|
+
<AddressMenu
|
|
406
|
+
isChew={isChew}
|
|
407
|
+
onClick={() => openModal('address')}
|
|
408
|
+
>
|
|
409
|
+
<GeoAlt /> {orderState.options?.address?.address || t('WHAT_IS_YOUR_ADDRESS', 'What\'s your address?')}
|
|
410
|
+
</AddressMenu>
|
|
411
|
+
{!isCustomerMode && (isPreOrderSetting || configState?.configs?.preorder_status_enabled?.value === undefined) && (
|
|
412
|
+
<HeaderOption
|
|
413
|
+
variant='moment'
|
|
414
|
+
momentState={orderState?.options?.moment}
|
|
415
|
+
onClick={configState?.configs?.max_days_preorder?.value === -1 || configState?.configs?.max_days_preorder?.value === 0
|
|
416
|
+
? null
|
|
417
|
+
: (variant) => openModal(variant)}
|
|
418
|
+
/>
|
|
419
|
+
)}
|
|
420
|
+
</SubMenu>
|
|
421
|
+
) : (
|
|
422
|
+
windowSize.width >= 576 && (
|
|
416
423
|
<SubMenu>
|
|
417
424
|
{isFarAway && (
|
|
418
425
|
<FarAwayMessage>
|
|
@@ -424,6 +431,7 @@ export const Header = (props) => {
|
|
|
424
431
|
variant='address'
|
|
425
432
|
addressState={orderState?.options?.address?.address}
|
|
426
433
|
onClick={(variant) => openModal(variant)}
|
|
434
|
+
containerStyle={{ width: '80%' }}
|
|
427
435
|
/>
|
|
428
436
|
{!isCustomerMode && (isPreOrderSetting || configState?.configs?.preorder_status_enabled?.value === undefined) && (
|
|
429
437
|
<HeaderOption
|
|
@@ -436,190 +444,186 @@ export const Header = (props) => {
|
|
|
436
444
|
)}
|
|
437
445
|
</SubMenu>
|
|
438
446
|
)
|
|
439
|
-
)
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
447
|
+
)
|
|
448
|
+
)}
|
|
449
|
+
{modalIsOpen && (
|
|
450
|
+
<Modal
|
|
451
|
+
{...(!auth && modalSelected === 'address' && { title: t('WHAT_IS_YOUR_ADDRESS', 'What\'s your address?') })}
|
|
452
|
+
open={modalIsOpen}
|
|
453
|
+
onClose={() => setModalIsOpen(false)}
|
|
454
|
+
width={modalSelected === 'address' ? orderState?.options?.user_id ? '70%' : '50%' : '700px'}
|
|
455
|
+
>
|
|
456
|
+
{modalSelected === 'cart' && (
|
|
457
|
+
<CartContent
|
|
458
|
+
carts={cartsWithProducts}
|
|
459
|
+
isOrderStateCarts={!!orderState.carts}
|
|
460
|
+
onClose={() => setModalIsOpen(false)}
|
|
461
|
+
/>
|
|
462
|
+
)}
|
|
463
|
+
{modalSelected === 'address' && (
|
|
464
|
+
auth ? (
|
|
465
|
+
<AddressList
|
|
466
|
+
isModal
|
|
467
|
+
changeOrderAddressWithDefault
|
|
468
|
+
userId={isNaN(userCustomer?.id) ? null : userCustomer?.id}
|
|
469
|
+
onCancel={() => setModalIsOpen(false)}
|
|
470
|
+
isCustomerMode={isCustomerMode}
|
|
452
471
|
/>
|
|
453
|
-
)
|
|
454
|
-
|
|
455
|
-
|
|
472
|
+
) : (
|
|
473
|
+
<AddressFormWrapper>
|
|
474
|
+
<AddressForm
|
|
475
|
+
useValidationFileds
|
|
476
|
+
address={orderState?.options?.address || {}}
|
|
477
|
+
onCancel={() => setModalIsOpen(false)}
|
|
478
|
+
onSaveAddress={() => setModalIsOpen(false)}
|
|
479
|
+
isCustomerMode={isCustomerMode}
|
|
480
|
+
/>
|
|
481
|
+
</AddressFormWrapper>
|
|
482
|
+
)
|
|
483
|
+
)}
|
|
484
|
+
{modalSelected === 'moment' && (
|
|
485
|
+
<MomentContent
|
|
486
|
+
onClose={() => setModalIsOpen(false)}
|
|
487
|
+
/>
|
|
488
|
+
)}
|
|
489
|
+
{modalSelected === 'delivery' && (
|
|
490
|
+
<OrderTypeSelectorContent
|
|
491
|
+
onClose={() => setModalIsOpen(false)}
|
|
492
|
+
configTypes={!configState?.loading && configTypes?.length > 0 ? configTypes : null}
|
|
493
|
+
defaultValue={!(!configState?.loading && configTypes?.length > 0) && 1}
|
|
494
|
+
/>
|
|
495
|
+
)}
|
|
496
|
+
</Modal>
|
|
497
|
+
)}
|
|
498
|
+
{isCustomerMode && customerModalOpen && (
|
|
499
|
+
<Modal
|
|
500
|
+
open={customerModalOpen}
|
|
501
|
+
width='80%'
|
|
502
|
+
onClose={() => setCustomerModalOpen(false)}
|
|
503
|
+
padding='20px'
|
|
504
|
+
hideCloseDefault
|
|
505
|
+
>
|
|
506
|
+
<UserEdit>
|
|
507
|
+
{!customerState?.loading && (
|
|
508
|
+
<>
|
|
509
|
+
<UserDetails
|
|
510
|
+
isAddressFormOpen={isAddressFormOpen}
|
|
511
|
+
userData={customerState?.user}
|
|
512
|
+
userId={customerState?.user?.id}
|
|
513
|
+
isOpenUserData={isOpenUserData}
|
|
514
|
+
isCustomerMode
|
|
515
|
+
isModal
|
|
516
|
+
setIsOpenUserData={setIsOpenUserData}
|
|
517
|
+
onClose={() => setCustomerModalOpen(false)}
|
|
518
|
+
/>
|
|
456
519
|
<AddressList
|
|
457
520
|
isModal
|
|
521
|
+
userId={customerState?.user?.id}
|
|
458
522
|
changeOrderAddressWithDefault
|
|
459
|
-
|
|
460
|
-
|
|
523
|
+
userCustomerSetup={customerState.user}
|
|
524
|
+
isOpenUserData={isOpenUserData}
|
|
525
|
+
setCustomerModalOpen={setCustomerModalOpen}
|
|
526
|
+
setIsOpenUserData={setIsOpenUserData}
|
|
527
|
+
setIsAddressFormOpen={setIsAddressFormOpen}
|
|
528
|
+
isHeader
|
|
461
529
|
isCustomerMode={isCustomerMode}
|
|
462
530
|
/>
|
|
463
|
-
|
|
464
|
-
<AddressFormWrapper>
|
|
465
|
-
<AddressForm
|
|
466
|
-
useValidationFileds
|
|
467
|
-
address={orderState?.options?.address || {}}
|
|
468
|
-
onCancel={() => setModalIsOpen(false)}
|
|
469
|
-
onSaveAddress={() => setModalIsOpen(false)}
|
|
470
|
-
isCustomerMode={isCustomerMode}
|
|
471
|
-
/>
|
|
472
|
-
</AddressFormWrapper>
|
|
473
|
-
)
|
|
474
|
-
)}
|
|
475
|
-
{modalSelected === 'moment' && (
|
|
476
|
-
<MomentContent
|
|
477
|
-
onClose={() => setModalIsOpen(false)}
|
|
478
|
-
/>
|
|
479
|
-
)}
|
|
480
|
-
{modalSelected === 'delivery' && (
|
|
481
|
-
<OrderTypeSelectorContent
|
|
482
|
-
onClose={() => setModalIsOpen(false)}
|
|
483
|
-
configTypes={!configState?.loading && configTypes?.length > 0 ? configTypes : null}
|
|
484
|
-
defaultValue={!(!configState?.loading && configTypes?.length > 0) && 1}
|
|
485
|
-
/>
|
|
486
|
-
)}
|
|
487
|
-
</Modal>
|
|
488
|
-
)}
|
|
489
|
-
{isCustomerMode && customerModalOpen && (
|
|
490
|
-
<Modal
|
|
491
|
-
open={customerModalOpen}
|
|
492
|
-
width='80%'
|
|
493
|
-
onClose={() => setCustomerModalOpen(false)}
|
|
494
|
-
padding='20px'
|
|
495
|
-
hideCloseDefault
|
|
496
|
-
>
|
|
497
|
-
<UserEdit>
|
|
498
|
-
{!customerState?.loading && (
|
|
499
|
-
<>
|
|
500
|
-
<UserDetails
|
|
501
|
-
isAddressFormOpen={isAddressFormOpen}
|
|
502
|
-
userData={customerState?.user}
|
|
503
|
-
userId={customerState?.user?.id}
|
|
504
|
-
isOpenUserData={isOpenUserData}
|
|
505
|
-
isCustomerMode
|
|
506
|
-
isModal
|
|
507
|
-
setIsOpenUserData={setIsOpenUserData}
|
|
508
|
-
onClose={() => setCustomerModalOpen(false)}
|
|
509
|
-
/>
|
|
510
|
-
<AddressList
|
|
511
|
-
isModal
|
|
512
|
-
userId={customerState?.user?.id}
|
|
513
|
-
changeOrderAddressWithDefault
|
|
514
|
-
userCustomerSetup={customerState.user}
|
|
515
|
-
isOpenUserData={isOpenUserData}
|
|
516
|
-
setCustomerModalOpen={setCustomerModalOpen}
|
|
517
|
-
setIsOpenUserData={setIsOpenUserData}
|
|
518
|
-
setIsAddressFormOpen={setIsAddressFormOpen}
|
|
519
|
-
isHeader
|
|
520
|
-
isCustomerMode={isCustomerMode}
|
|
521
|
-
/>
|
|
522
|
-
</>
|
|
523
|
-
)}
|
|
524
|
-
</UserEdit>
|
|
525
|
-
</Modal>
|
|
526
|
-
)}
|
|
527
|
-
{authModalOpen && !auth && (
|
|
528
|
-
<Modal
|
|
529
|
-
open={authModalOpen}
|
|
530
|
-
onRemove={() => closeAuthModal()}
|
|
531
|
-
onClose={() => closeAuthModal()}
|
|
532
|
-
width='50%'
|
|
533
|
-
authModal
|
|
534
|
-
closeOnBackdrop
|
|
535
|
-
>
|
|
536
|
-
{modalPageToShow === 'login' && (
|
|
537
|
-
<LoginForm
|
|
538
|
-
handleSuccessLogin={handleSuccessLogin}
|
|
539
|
-
elementLinkToSignup={
|
|
540
|
-
<a
|
|
541
|
-
onClick={
|
|
542
|
-
(e) => handleCustomModalClick(e, { page: 'signup' })
|
|
543
|
-
} href='#'
|
|
544
|
-
>{t('CREATE_ACCOUNT', theme?.defaultLanguages?.CREATE_ACCOUNT || 'Create account')}
|
|
545
|
-
</a>
|
|
546
|
-
}
|
|
547
|
-
elementLinkToForgotPassword={
|
|
548
|
-
<a
|
|
549
|
-
onClick={
|
|
550
|
-
(e) => handleCustomModalClick(e, { page: 'forgotpassword' })
|
|
551
|
-
} href='#'
|
|
552
|
-
>{t('RESET_PASSWORD', theme?.defaultLanguages?.RESET_PASSWORD || 'Reset password')}
|
|
553
|
-
</a>
|
|
554
|
-
}
|
|
555
|
-
useLoginByCellphone
|
|
556
|
-
isPopup
|
|
557
|
-
/>
|
|
531
|
+
</>
|
|
558
532
|
)}
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
onClick={
|
|
564
|
-
(e) => handleCustomModalClick(e, { page: 'login' })
|
|
565
|
-
} href='#'
|
|
566
|
-
>{t('LOGIN', theme?.defaultLanguages?.LOGIN || 'Login')}
|
|
567
|
-
</a>
|
|
568
|
-
}
|
|
569
|
-
useLoginByCellphone
|
|
570
|
-
useChekoutFileds
|
|
571
|
-
handleSuccessSignup={handleSuccessSignup}
|
|
572
|
-
isPopup
|
|
573
|
-
closeModal={() => closeAuthModal()}
|
|
574
|
-
/>
|
|
575
|
-
)}
|
|
576
|
-
{modalPageToShow === 'forgotpassword' && (
|
|
577
|
-
<ForgotPasswordForm
|
|
578
|
-
elementLinkToLogin={
|
|
579
|
-
<a
|
|
580
|
-
onClick={
|
|
581
|
-
(e) => handleCustomModalClick(e, { page: 'login' })
|
|
582
|
-
} href='#'
|
|
583
|
-
>{t('LOGIN', theme?.defaultLanguages?.LOGIN || 'Login')}
|
|
584
|
-
</a>
|
|
585
|
-
}
|
|
586
|
-
isPopup
|
|
587
|
-
/>
|
|
588
|
-
)}
|
|
589
|
-
</Modal>
|
|
590
|
-
)}
|
|
591
|
-
<Confirm
|
|
592
|
-
title={t('CUSTOMER', theme?.defaultLanguages?.CUSTOMER || 'Customer')}
|
|
593
|
-
content={confirm.content}
|
|
594
|
-
acceptText={t('ACCEPT', theme?.defaultLanguages?.ACCEPT || 'Accept')}
|
|
595
|
-
open={isCustomerMode && confirm.open}
|
|
596
|
-
onClose={() => setConfirm({ ...confirm, open: false })}
|
|
597
|
-
onCancel={() => setConfirm({ ...confirm, open: false })}
|
|
598
|
-
onAccept={confirm.handleOnAccept}
|
|
599
|
-
closeOnBackdrop={false}
|
|
600
|
-
/>
|
|
533
|
+
</UserEdit>
|
|
534
|
+
</Modal>
|
|
535
|
+
)}
|
|
536
|
+
{authModalOpen && !auth && (
|
|
601
537
|
<Modal
|
|
602
|
-
open={
|
|
603
|
-
|
|
604
|
-
onClose={() =>
|
|
538
|
+
open={authModalOpen}
|
|
539
|
+
onRemove={() => closeAuthModal()}
|
|
540
|
+
onClose={() => closeAuthModal()}
|
|
541
|
+
width='50%'
|
|
542
|
+
authModal
|
|
543
|
+
closeOnBackdrop
|
|
605
544
|
>
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
545
|
+
{modalPageToShow === 'login' && (
|
|
546
|
+
<LoginForm
|
|
547
|
+
handleSuccessLogin={handleSuccessLogin}
|
|
548
|
+
elementLinkToSignup={
|
|
549
|
+
<a
|
|
550
|
+
onClick={
|
|
551
|
+
(e) => handleCustomModalClick(e, { page: 'signup' })
|
|
552
|
+
} href='#'
|
|
553
|
+
>{t('CREATE_ACCOUNT', theme?.defaultLanguages?.CREATE_ACCOUNT || 'Create account')}
|
|
554
|
+
</a>
|
|
555
|
+
}
|
|
556
|
+
elementLinkToForgotPassword={
|
|
557
|
+
<a
|
|
558
|
+
onClick={
|
|
559
|
+
(e) => handleCustomModalClick(e, { page: 'forgotpassword' })
|
|
560
|
+
} href='#'
|
|
561
|
+
>{t('RESET_PASSWORD', theme?.defaultLanguages?.RESET_PASSWORD || 'Reset password')}
|
|
562
|
+
</a>
|
|
563
|
+
}
|
|
564
|
+
useLoginByCellphone
|
|
565
|
+
isPopup
|
|
566
|
+
/>
|
|
567
|
+
)}
|
|
568
|
+
{modalPageToShow === 'signup' && (
|
|
569
|
+
<SignUpForm
|
|
570
|
+
elementLinkToLogin={
|
|
571
|
+
<a
|
|
572
|
+
onClick={
|
|
573
|
+
(e) => handleCustomModalClick(e, { page: 'login' })
|
|
574
|
+
} href='#'
|
|
575
|
+
>{t('LOGIN', theme?.defaultLanguages?.LOGIN || 'Login')}
|
|
576
|
+
</a>
|
|
577
|
+
}
|
|
578
|
+
useLoginByCellphone
|
|
579
|
+
useChekoutFileds
|
|
580
|
+
handleSuccessSignup={handleSuccessSignup}
|
|
581
|
+
isPopup
|
|
582
|
+
closeModal={() => closeAuthModal()}
|
|
583
|
+
/>
|
|
584
|
+
)}
|
|
585
|
+
{modalPageToShow === 'forgotpassword' && (
|
|
586
|
+
<ForgotPasswordForm
|
|
587
|
+
elementLinkToLogin={
|
|
588
|
+
<a
|
|
589
|
+
onClick={
|
|
590
|
+
(e) => handleCustomModalClick(e, { page: 'login' })
|
|
591
|
+
} href='#'
|
|
592
|
+
>{t('LOGIN', theme?.defaultLanguages?.LOGIN || 'Login')}
|
|
593
|
+
</a>
|
|
594
|
+
}
|
|
595
|
+
isPopup
|
|
596
|
+
/>
|
|
597
|
+
)}
|
|
611
598
|
</Modal>
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
599
|
+
)}
|
|
600
|
+
<Confirm
|
|
601
|
+
title={t('CUSTOMER', theme?.defaultLanguages?.CUSTOMER || 'Customer')}
|
|
602
|
+
content={confirm.content}
|
|
603
|
+
acceptText={t('ACCEPT', theme?.defaultLanguages?.ACCEPT || 'Accept')}
|
|
604
|
+
open={isCustomerMode && confirm.open}
|
|
605
|
+
onClose={() => setConfirm({ ...confirm, open: false })}
|
|
606
|
+
onCancel={() => setConfirm({ ...confirm, open: false })}
|
|
607
|
+
onAccept={confirm.handleOnAccept}
|
|
608
|
+
closeOnBackdrop={false}
|
|
609
|
+
/>
|
|
610
|
+
<Modal
|
|
611
|
+
open={!!preorderBusiness}
|
|
612
|
+
width='760px'
|
|
613
|
+
onClose={() => handleClosePreorder()}
|
|
614
|
+
>
|
|
615
|
+
<BusinessPreorder
|
|
616
|
+
business={preorderBusiness}
|
|
617
|
+
handleClick={handleBusinessClick}
|
|
618
|
+
showButton
|
|
619
|
+
/>
|
|
620
|
+
</Modal>
|
|
621
|
+
</HeaderContainer>
|
|
620
622
|
)
|
|
621
623
|
}
|
|
622
624
|
|
|
623
625
|
Header.defaultProps = {
|
|
624
626
|
isShowOrderOptions: true
|
|
625
627
|
}
|
|
628
|
+
|
|
629
|
+
export default Header
|