ordering-ui-external 2.0.2 → 2.0.4
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.32113e17b220a7b5ae09.js → 0.ordering-ui.a228aa8797d9d0fc5a6c.js} +0 -0
- package/_bundles/{1.ordering-ui.32113e17b220a7b5ae09.js → 1.ordering-ui.a228aa8797d9d0fc5a6c.js} +0 -0
- package/_bundles/{2.ordering-ui.32113e17b220a7b5ae09.js → 2.ordering-ui.a228aa8797d9d0fc5a6c.js} +0 -0
- package/_bundles/{4.ordering-ui.32113e17b220a7b5ae09.js → 4.ordering-ui.a228aa8797d9d0fc5a6c.js} +0 -0
- package/_bundles/{5.ordering-ui.32113e17b220a7b5ae09.js → 5.ordering-ui.a228aa8797d9d0fc5a6c.js} +0 -0
- package/_bundles/{6.ordering-ui.32113e17b220a7b5ae09.js → 6.ordering-ui.a228aa8797d9d0fc5a6c.js} +0 -0
- package/_bundles/{7.ordering-ui.32113e17b220a7b5ae09.js → 7.ordering-ui.a228aa8797d9d0fc5a6c.js} +1 -1
- package/_bundles/{7.ordering-ui.32113e17b220a7b5ae09.js.LICENSE.txt → 7.ordering-ui.a228aa8797d9d0fc5a6c.js.LICENSE.txt} +0 -0
- package/_bundles/{8.ordering-ui.32113e17b220a7b5ae09.js → 8.ordering-ui.a228aa8797d9d0fc5a6c.js} +0 -0
- package/_bundles/{9.ordering-ui.32113e17b220a7b5ae09.js → 9.ordering-ui.a228aa8797d9d0fc5a6c.js} +0 -0
- package/_bundles/ordering-ui.a228aa8797d9d0fc5a6c.js +2 -0
- package/_bundles/{ordering-ui.32113e17b220a7b5ae09.js.LICENSE.txt → ordering-ui.a228aa8797d9d0fc5a6c.js.LICENSE.txt} +0 -0
- package/_modules/themes/callcenterOriginal/index.js +7 -0
- package/_modules/themes/callcenterOriginal/src/components/Cart/index.js +46 -32
- package/_modules/themes/callcenterOriginal/src/components/Cart/styles.js +1 -1
- package/_modules/themes/callcenterOriginal/src/components/CartContent/index.js +53 -21
- package/_modules/themes/callcenterOriginal/src/components/CartContent/styles.js +6 -4
- package/_modules/themes/callcenterOriginal/src/components/CartPopover/index.js +5 -19
- package/_modules/themes/callcenterOriginal/src/components/Header/index.js +3 -21
- package/_modules/themes/callcenterOriginal/src/components/Header/styles.js +2 -2
- package/_modules/themes/five/src/components/BusinessProductsCategories/index.js +1 -1
- package/_modules/themes/five/src/components/BusinessProductsListing/index.js +1 -0
- package/_modules/themes/five/src/components/BusinessesListing/layouts/OriginalBusinessesListing/index.js +13 -8
- package/_modules/themes/five/src/components/Cart/index.js +1 -1
- package/_modules/themes/five/src/components/RenderProductsLayout/index.js +1 -1
- package/package.json +2 -2
- package/src/themes/callcenterOriginal/index.js +2 -0
- package/src/themes/callcenterOriginal/src/components/Cart/index.js +321 -307
- package/src/themes/callcenterOriginal/src/components/Cart/styles.js +1 -1
- package/src/themes/callcenterOriginal/src/components/CartContent/index.js +69 -50
- package/src/themes/callcenterOriginal/src/components/CartContent/styles.js +6 -0
- package/src/themes/callcenterOriginal/src/components/CartPopover/index.js +20 -32
- package/src/themes/callcenterOriginal/src/components/Header/index.js +276 -292
- package/src/themes/callcenterOriginal/src/components/Header/styles.js +19 -1
- package/src/themes/five/src/components/BusinessProductsCategories/index.js +1 -1
- package/src/themes/five/src/components/BusinessProductsListing/index.js +1 -0
- package/src/themes/five/src/components/BusinessesListing/layouts/OriginalBusinessesListing/index.js +5 -1
- package/src/themes/five/src/components/Cart/index.js +1 -1
- package/src/themes/five/src/components/RenderProductsLayout/index.js +1 -1
- package/_bundles/ordering-ui.32113e17b220a7b5ae09.js +0 -2
|
@@ -8,7 +8,6 @@ import TiWarningOutline from '@meronex/icons/ti/TiWarningOutline'
|
|
|
8
8
|
import { OrderTypeSelectorContent } from '../OrderTypeSelectorContent'
|
|
9
9
|
import { LanguageSelector } from '../LanguageSelector'
|
|
10
10
|
import AiOutlineClose from '@meronex/icons/ai/AiOutlineClose'
|
|
11
|
-
import BisDownArrow from '@meronex/icons/bi/BisDownArrow'
|
|
12
11
|
|
|
13
12
|
import {
|
|
14
13
|
Header as HeaderContainer,
|
|
@@ -24,8 +23,7 @@ import {
|
|
|
24
23
|
AddressMenu,
|
|
25
24
|
MomentMenu,
|
|
26
25
|
FarAwayMessage,
|
|
27
|
-
Divider
|
|
28
|
-
AdminSection
|
|
26
|
+
Divider
|
|
29
27
|
} from './styles'
|
|
30
28
|
import { useWindowSize } from '../../../../../hooks/useWindowSize'
|
|
31
29
|
import { useOnlineStatus } from '../../../../../hooks/useOnlineStatus'
|
|
@@ -170,319 +168,305 @@ export const Header = (props) => {
|
|
|
170
168
|
}, [orderState?.options?.address?.location, pathname])
|
|
171
169
|
|
|
172
170
|
return (
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
<
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
<
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
>
|
|
192
|
-
|
|
193
|
-
<img alt='Isotype' width='35px' height='45px' src={isHome ? theme?.images?.logos?.isotypeInvert : theme?.images?.logos?.isotype} loading='lazy' />
|
|
194
|
-
</LogoHeader>
|
|
195
|
-
</LeftHeader>
|
|
196
|
-
{isShowOrderOptions && (
|
|
197
|
-
<>
|
|
198
|
-
<Menu className='left-header' id='center-side'>
|
|
199
|
-
{windowSize.width > 820 && isFarAway && (
|
|
200
|
-
<FarAwayMessage>
|
|
201
|
-
<TiWarningOutline />
|
|
202
|
-
<span>{t('YOU_ARE_FAR_FROM_ADDRESS', 'You are far from this address')}</span>
|
|
203
|
-
</FarAwayMessage>
|
|
204
|
-
)}
|
|
205
|
-
<AddressMenu
|
|
206
|
-
onClick={(e) => handleClickUserCustomer(e)}
|
|
207
|
-
>
|
|
208
|
-
<GeoAlt /> {orderState.options?.address?.address?.split(',')?.[0] || t('WHAT_IS_YOUR_ADDRESS', 'What\'s your address?')}
|
|
209
|
-
</AddressMenu>
|
|
210
|
-
<Divider />
|
|
211
|
-
{isCustomerMode && windowSize.width > 450 && (
|
|
212
|
-
<CustomerInfo
|
|
213
|
-
onClick={(e) => handleClickUserCustomer(e)}
|
|
214
|
-
>
|
|
215
|
-
<span>
|
|
216
|
-
<p>{userCustomer?.name} {userCustomer?.lastname}</p>
|
|
217
|
-
</span>
|
|
218
|
-
<span
|
|
219
|
-
ref={clearCustomer}
|
|
220
|
-
>
|
|
221
|
-
<AiOutlineClose />
|
|
222
|
-
</span>
|
|
223
|
-
</CustomerInfo>
|
|
224
|
-
)}
|
|
225
|
-
<Divider />
|
|
226
|
-
{onlineStatus && windowSize.width > 820 && (
|
|
227
|
-
<>
|
|
228
|
-
{!isCustomerMode && (isPreOrderSetting || configState?.configs?.preorder_status_enabled?.value === undefined) && (
|
|
229
|
-
<MomentMenu
|
|
230
|
-
onClick={configState?.configs?.max_days_preorder?.value === -1 || configState?.configs?.max_days_preorder?.value === 0
|
|
231
|
-
? null
|
|
232
|
-
: () => openModal('moment')}
|
|
233
|
-
>
|
|
234
|
-
<div>
|
|
235
|
-
{orderState.options?.moment
|
|
236
|
-
? parseDate(orderState.options?.moment, { outputFormat: configState?.configs?.dates_moment_format?.value })
|
|
237
|
-
: t('ASAP_ABBREVIATION', 'ASAP')}
|
|
238
|
-
</div>
|
|
239
|
-
</MomentMenu>
|
|
240
|
-
)}
|
|
241
|
-
</>
|
|
242
|
-
)}
|
|
243
|
-
{windowSize.width > 768 ? (
|
|
244
|
-
<OrderTypeSelectorHeader
|
|
245
|
-
orderTypeList={orderTypeList}
|
|
246
|
-
onClick={() => openModal('delivery')}
|
|
247
|
-
/>
|
|
248
|
-
) : (
|
|
249
|
-
<HeaderOption
|
|
250
|
-
variant='delivery'
|
|
251
|
-
onClick={(variant) => openModal(variant)}
|
|
252
|
-
orderTypeList={orderTypeList}
|
|
253
|
-
/>
|
|
254
|
-
)}
|
|
255
|
-
</Menu>
|
|
256
|
-
{user?.level === 0 && (
|
|
257
|
-
<AdminAreaPopover
|
|
258
|
-
withLogout
|
|
259
|
-
isCustomerMode={isCustomerMode}
|
|
260
|
-
open={openPopover.admin}
|
|
261
|
-
onClick={() => handleTogglePopover('admin')}
|
|
262
|
-
onClose={() => handleClosePopover('admin')}
|
|
263
|
-
/>
|
|
264
|
-
)}
|
|
265
|
-
</>
|
|
266
|
-
)}
|
|
267
|
-
{onlineStatus && (
|
|
268
|
-
<RightHeader>
|
|
269
|
-
<Menu>
|
|
270
|
-
{
|
|
271
|
-
!auth && windowSize.width > 920 && (
|
|
272
|
-
<>
|
|
273
|
-
<MenuLink onClick={() => handleOpenLoginSignUp('login')} style={{ whiteSpace: 'nowrap' }} name='signin'>{t('LOGIN', theme?.defaultLanguages?.LOGIN || 'Login')}</MenuLink>
|
|
274
|
-
{!isHideSignup && (
|
|
275
|
-
<MenuLink
|
|
276
|
-
onClick={() => handleOpenLoginSignUp('signup')}
|
|
277
|
-
highlight={1}
|
|
278
|
-
style={{ whiteSpace: 'nowrap' }}
|
|
279
|
-
name='signup'
|
|
280
|
-
>
|
|
281
|
-
{t('SIGN_UP', theme?.defaultLanguages?.SIGN_UP || 'Sign up')}
|
|
282
|
-
</MenuLink>
|
|
283
|
-
)}
|
|
284
|
-
</>
|
|
285
|
-
)
|
|
286
|
-
}
|
|
287
|
-
{
|
|
288
|
-
auth && (
|
|
289
|
-
<>
|
|
290
|
-
{isShowOrderOptions && (
|
|
291
|
-
windowSize.width > 768 ? (
|
|
292
|
-
<CartPopover
|
|
293
|
-
open={openPopover.cart}
|
|
294
|
-
carts={cartsWithProducts}
|
|
295
|
-
onClick={() => handleTogglePopover('cart')}
|
|
296
|
-
onClose={() => handleClosePopover('cart')}
|
|
297
|
-
auth={auth}
|
|
298
|
-
location={location}
|
|
299
|
-
isCustomerMode={isCustomerMode}
|
|
300
|
-
setPreorderBusiness={setPreorderBusiness}
|
|
301
|
-
/>
|
|
302
|
-
) : (
|
|
303
|
-
<HeaderOption
|
|
304
|
-
variant='cart'
|
|
305
|
-
totalCarts={cartsWithProducts?.length}
|
|
306
|
-
onClick={(variant) => openModal(variant)}
|
|
307
|
-
/>
|
|
308
|
-
)
|
|
309
|
-
)}
|
|
310
|
-
<LanguageSelector />
|
|
311
|
-
{windowSize.width > 768 && (
|
|
312
|
-
<UserPopover
|
|
313
|
-
withLogout
|
|
314
|
-
isCustomerMode={isCustomerMode}
|
|
315
|
-
open={openPopover.user}
|
|
316
|
-
onClick={() => handleTogglePopover('user')}
|
|
317
|
-
onClose={() => handleClosePopover('user')}
|
|
318
|
-
/>
|
|
319
|
-
)}
|
|
320
|
-
</>
|
|
321
|
-
)
|
|
322
|
-
}
|
|
323
|
-
</Menu>
|
|
324
|
-
</RightHeader>
|
|
325
|
-
)}
|
|
326
|
-
</InnerHeader>
|
|
327
|
-
{onlineStatus && isShowOrderOptions && (
|
|
328
|
-
windowSize.width > 768 && windowSize.width <= 820 ? (
|
|
329
|
-
<SubMenu>
|
|
330
|
-
{isFarAway && (
|
|
171
|
+
<HeaderContainer>
|
|
172
|
+
<InnerHeader>
|
|
173
|
+
<LeftHeader>
|
|
174
|
+
<SidebarMenu
|
|
175
|
+
auth={auth}
|
|
176
|
+
isHideSignup={isHideSignup}
|
|
177
|
+
userCustomer={userCustomer}
|
|
178
|
+
isCustomerMode={isCustomerMode}
|
|
179
|
+
/>
|
|
180
|
+
<LogoHeader
|
|
181
|
+
onClick={() => handleGoToPage({ page: orderState?.options?.address?.location && !isCustomerMode ? 'search' : 'home' })}
|
|
182
|
+
>
|
|
183
|
+
<img alt='Logotype' width='170px' height='45px' src={theme?.images?.logos?.logotype} loading='lazy' />
|
|
184
|
+
<img alt='Isotype' width='35px' height='45px' src={isHome ? theme?.images?.logos?.isotypeInvert : theme?.images?.logos?.isotype} loading='lazy' />
|
|
185
|
+
</LogoHeader>
|
|
186
|
+
</LeftHeader>
|
|
187
|
+
{isShowOrderOptions && (
|
|
188
|
+
<>
|
|
189
|
+
<Menu className='left-header' id='center-side'>
|
|
190
|
+
{windowSize.width > 820 && isFarAway && (
|
|
331
191
|
<FarAwayMessage>
|
|
332
192
|
<TiWarningOutline />
|
|
333
193
|
<span>{t('YOU_ARE_FAR_FROM_ADDRESS', 'You are far from this address')}</span>
|
|
334
194
|
</FarAwayMessage>
|
|
335
195
|
)}
|
|
336
196
|
<AddressMenu
|
|
337
|
-
onClick={() =>
|
|
197
|
+
onClick={(e) => handleClickUserCustomer(e)}
|
|
338
198
|
>
|
|
339
199
|
<GeoAlt /> {orderState.options?.address?.address?.split(',')?.[0] || t('WHAT_IS_YOUR_ADDRESS', 'What\'s your address?')}
|
|
340
200
|
</AddressMenu>
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
201
|
+
<Divider />
|
|
202
|
+
{isCustomerMode && windowSize.width > 450 && (
|
|
203
|
+
<CustomerInfo
|
|
204
|
+
onClick={(e) => handleClickUserCustomer(e)}
|
|
205
|
+
>
|
|
206
|
+
<span>
|
|
207
|
+
<p>{userCustomer?.name} {userCustomer?.lastname}</p>
|
|
208
|
+
</span>
|
|
209
|
+
<span
|
|
210
|
+
ref={clearCustomer}
|
|
211
|
+
>
|
|
212
|
+
<AiOutlineClose />
|
|
213
|
+
</span>
|
|
214
|
+
</CustomerInfo>
|
|
349
215
|
)}
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
216
|
+
<Divider />
|
|
217
|
+
{onlineStatus && windowSize.width > 820 && (
|
|
218
|
+
<>
|
|
219
|
+
{!isCustomerMode && (isPreOrderSetting || configState?.configs?.preorder_status_enabled?.value === undefined) && (
|
|
220
|
+
<MomentMenu
|
|
221
|
+
onClick={configState?.configs?.max_days_preorder?.value === -1 || configState?.configs?.max_days_preorder?.value === 0
|
|
222
|
+
? null
|
|
223
|
+
: () => openModal('moment')}
|
|
224
|
+
>
|
|
225
|
+
<div>
|
|
226
|
+
{orderState.options?.moment
|
|
227
|
+
? parseDate(orderState.options?.moment, { outputFormat: configState?.configs?.dates_moment_format?.value })
|
|
228
|
+
: t('ASAP_ABBREVIATION', 'ASAP')}
|
|
229
|
+
</div>
|
|
230
|
+
</MomentMenu>
|
|
231
|
+
)}
|
|
232
|
+
</>
|
|
358
233
|
)}
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
234
|
+
{windowSize.width > 768 ? (
|
|
235
|
+
<OrderTypeSelectorHeader
|
|
236
|
+
orderTypeList={orderTypeList}
|
|
237
|
+
onClick={() => openModal('delivery')}
|
|
238
|
+
/>
|
|
239
|
+
) : (
|
|
365
240
|
<HeaderOption
|
|
366
|
-
variant='
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
? null
|
|
370
|
-
: (variant) => openModal(variant)}
|
|
241
|
+
variant='delivery'
|
|
242
|
+
onClick={(variant) => openModal(variant)}
|
|
243
|
+
orderTypeList={orderTypeList}
|
|
371
244
|
/>
|
|
372
245
|
)}
|
|
373
|
-
</
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
width='700px'
|
|
382
|
-
>
|
|
383
|
-
{modalSelected === 'cart' && (
|
|
384
|
-
<CartContent
|
|
385
|
-
carts={cartsWithProducts}
|
|
386
|
-
isOrderStateCarts={!!orderState.carts}
|
|
387
|
-
onClose={() => setModalIsOpen(false)}
|
|
246
|
+
</Menu>
|
|
247
|
+
{user?.level === 0 && (
|
|
248
|
+
<AdminAreaPopover
|
|
249
|
+
withLogout
|
|
250
|
+
isCustomerMode={isCustomerMode}
|
|
251
|
+
open={openPopover.admin}
|
|
252
|
+
onClick={() => handleTogglePopover('admin')}
|
|
253
|
+
onClose={() => handleClosePopover('admin')}
|
|
388
254
|
/>
|
|
389
255
|
)}
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
256
|
+
</>
|
|
257
|
+
)}
|
|
258
|
+
{onlineStatus && (
|
|
259
|
+
<RightHeader>
|
|
260
|
+
<Menu>
|
|
261
|
+
{
|
|
262
|
+
!auth && windowSize.width > 920 && (
|
|
263
|
+
<>
|
|
264
|
+
<MenuLink onClick={() => handleOpenLoginSignUp('login')} style={{ whiteSpace: 'nowrap' }} name='signin'>{t('LOGIN', theme?.defaultLanguages?.LOGIN || 'Login')}</MenuLink>
|
|
265
|
+
{!isHideSignup && (
|
|
266
|
+
<MenuLink
|
|
267
|
+
onClick={() => handleOpenLoginSignUp('signup')}
|
|
268
|
+
highlight={1}
|
|
269
|
+
style={{ whiteSpace: 'nowrap' }}
|
|
270
|
+
name='signup'
|
|
271
|
+
>
|
|
272
|
+
{t('SIGN_UP', theme?.defaultLanguages?.SIGN_UP || 'Sign up')}
|
|
273
|
+
</MenuLink>
|
|
274
|
+
)}
|
|
275
|
+
</>
|
|
276
|
+
)
|
|
277
|
+
}
|
|
278
|
+
{
|
|
279
|
+
auth && (
|
|
280
|
+
<>
|
|
281
|
+
{isShowOrderOptions && (
|
|
282
|
+
windowSize.width > 768 ? (
|
|
283
|
+
<CartPopover
|
|
284
|
+
open={openPopover.cart}
|
|
285
|
+
carts={cartsWithProducts}
|
|
286
|
+
onClick={() => handleTogglePopover('cart')}
|
|
287
|
+
onClose={() => handleClosePopover('cart')}
|
|
288
|
+
auth={auth}
|
|
289
|
+
location={location}
|
|
290
|
+
isCustomerMode={isCustomerMode}
|
|
291
|
+
setPreorderBusiness={setPreorderBusiness}
|
|
292
|
+
/>
|
|
293
|
+
) : (
|
|
294
|
+
<HeaderOption
|
|
295
|
+
variant='cart'
|
|
296
|
+
totalCarts={cartsWithProducts?.length}
|
|
297
|
+
onClick={(variant) => openModal(variant)}
|
|
298
|
+
/>
|
|
299
|
+
)
|
|
300
|
+
)}
|
|
301
|
+
<LanguageSelector />
|
|
302
|
+
{windowSize.width > 768 && (
|
|
303
|
+
<UserPopover
|
|
304
|
+
withLogout
|
|
305
|
+
isCustomerMode={isCustomerMode}
|
|
306
|
+
open={openPopover.user}
|
|
307
|
+
onClick={() => handleTogglePopover('user')}
|
|
308
|
+
onClose={() => handleClosePopover('user')}
|
|
309
|
+
/>
|
|
310
|
+
)}
|
|
311
|
+
</>
|
|
312
|
+
)
|
|
313
|
+
}
|
|
314
|
+
</Menu>
|
|
315
|
+
</RightHeader>
|
|
316
|
+
)}
|
|
317
|
+
</InnerHeader>
|
|
318
|
+
{onlineStatus && isShowOrderOptions && (
|
|
319
|
+
windowSize.width > 768 && windowSize.width <= 820 ? (
|
|
320
|
+
<SubMenu>
|
|
321
|
+
{isFarAway && (
|
|
322
|
+
<FarAwayMessage>
|
|
323
|
+
<TiWarningOutline />
|
|
324
|
+
<span>{t('YOU_ARE_FAR_FROM_ADDRESS', 'You are far from this address')}</span>
|
|
325
|
+
</FarAwayMessage>
|
|
407
326
|
)}
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
327
|
+
<AddressMenu
|
|
328
|
+
onClick={() => openModal('address')}
|
|
329
|
+
>
|
|
330
|
+
<GeoAlt /> {orderState.options?.address?.address?.split(',')?.[0] || t('WHAT_IS_YOUR_ADDRESS', 'What\'s your address?')}
|
|
331
|
+
</AddressMenu>
|
|
332
|
+
{!isCustomerMode && (isPreOrderSetting || configState?.configs?.preorder_status_enabled?.value === undefined) && (
|
|
333
|
+
<HeaderOption
|
|
334
|
+
variant='moment'
|
|
335
|
+
momentState={orderState?.options?.moment}
|
|
336
|
+
onClick={configState?.configs?.max_days_preorder?.value === -1 || configState?.configs?.max_days_preorder?.value === 0
|
|
337
|
+
? null
|
|
338
|
+
: (variant) => openModal(variant)}
|
|
411
339
|
/>
|
|
412
340
|
)}
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
341
|
+
</SubMenu>
|
|
342
|
+
) : (
|
|
343
|
+
<SubMenu>
|
|
344
|
+
{isFarAway && (
|
|
345
|
+
<FarAwayMessage>
|
|
346
|
+
<TiWarningOutline />
|
|
347
|
+
<span>{t('YOU_ARE_FAR_FROM_ADDRESS', 'You are far from this address')}</span>
|
|
348
|
+
</FarAwayMessage>
|
|
349
|
+
)}
|
|
350
|
+
<HeaderOption
|
|
351
|
+
variant='address'
|
|
352
|
+
addressState={orderState?.options?.address?.address?.split(',')?.[0]}
|
|
353
|
+
onClick={(variant) => openModal(variant)}
|
|
354
|
+
/>
|
|
355
|
+
{!isCustomerMode && (isPreOrderSetting || configState?.configs?.preorder_status_enabled?.value === undefined) && (
|
|
356
|
+
<HeaderOption
|
|
357
|
+
variant='moment'
|
|
358
|
+
momentState={orderState?.options?.moment}
|
|
359
|
+
onClick={configState?.configs?.max_days_preorder?.value === -1 || configState?.configs?.max_days_preorder?.value === 0
|
|
360
|
+
? null
|
|
361
|
+
: (variant) => openModal(variant)}
|
|
418
362
|
/>
|
|
419
363
|
)}
|
|
420
|
-
</
|
|
421
|
-
)
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
open={customerModalOpen}
|
|
425
|
-
width='80%'
|
|
426
|
-
onClose={() => setCustomerModalOpen(false)}
|
|
427
|
-
padding='20px'
|
|
428
|
-
hideCloseDefault
|
|
429
|
-
>
|
|
430
|
-
<UserEdit>
|
|
431
|
-
<>
|
|
432
|
-
<UserDetails
|
|
433
|
-
isAddressFormOpen={isAddressFormOpen}
|
|
434
|
-
userData={customerState?.user}
|
|
435
|
-
userId={customerState?.user?.id}
|
|
436
|
-
isOpenUserData={isOpenUserData}
|
|
437
|
-
isCustomerMode
|
|
438
|
-
isModal
|
|
439
|
-
setIsOpenUserData={setIsOpenUserData}
|
|
440
|
-
onClose={() => setCustomerModalOpen(false)}
|
|
441
|
-
/>
|
|
442
|
-
<AddressList
|
|
443
|
-
isModal
|
|
444
|
-
userId={customerState?.user?.id}
|
|
445
|
-
changeOrderAddressWithDefault
|
|
446
|
-
userCustomerSetup={customerState.user}
|
|
447
|
-
isOpenUserData={isOpenUserData}
|
|
448
|
-
setCustomerModalOpen={setCustomerModalOpen}
|
|
449
|
-
setIsOpenUserData={setIsOpenUserData}
|
|
450
|
-
setIsAddressFormOpen={setIsAddressFormOpen}
|
|
451
|
-
isHeader
|
|
452
|
-
/>
|
|
453
|
-
</>
|
|
454
|
-
</UserEdit>
|
|
455
|
-
</Modal>
|
|
456
|
-
)}
|
|
457
|
-
<Confirm
|
|
458
|
-
title={t('CUSTOMER', theme?.defaultLanguages?.CUSTOMER || 'Customer')}
|
|
459
|
-
content={confirm.content}
|
|
460
|
-
acceptText={t('ACCEPT', theme?.defaultLanguages?.ACCEPT || 'Accept')}
|
|
461
|
-
open={isCustomerMode && confirm.open}
|
|
462
|
-
onClose={() => setConfirm({ ...confirm, open: false })}
|
|
463
|
-
onCancel={() => setConfirm({ ...confirm, open: false })}
|
|
464
|
-
onAccept={confirm.handleOnAccept}
|
|
465
|
-
closeOnBackdrop={false}
|
|
466
|
-
/>
|
|
364
|
+
</SubMenu>
|
|
365
|
+
)
|
|
366
|
+
)}
|
|
367
|
+
{modalIsOpen && (
|
|
467
368
|
<Modal
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
onClose={() =>
|
|
369
|
+
title={(modalSelected === 'address') ? t('WHAT_IS_YOUR_ADDRESS', 'What\'s your address?') : null}
|
|
370
|
+
open={modalIsOpen}
|
|
371
|
+
onClose={() => setModalIsOpen(false)}
|
|
372
|
+
width='700px'
|
|
471
373
|
>
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
374
|
+
{modalSelected === 'cart' && (
|
|
375
|
+
<CartContent
|
|
376
|
+
carts={cartsWithProducts}
|
|
377
|
+
isOrderStateCarts={!!orderState.carts}
|
|
378
|
+
onClose={() => setModalIsOpen(false)}
|
|
379
|
+
/>
|
|
380
|
+
)}
|
|
381
|
+
{modalSelected === 'address' && (
|
|
382
|
+
auth ? (
|
|
383
|
+
<AddressList
|
|
384
|
+
isModal
|
|
385
|
+
changeOrderAddressWithDefault
|
|
386
|
+
userId={isNaN(userCustomer?.id) ? null : userCustomer?.id}
|
|
387
|
+
onCancel={() => setModalIsOpen(false)}
|
|
388
|
+
onAccept={() => setModalIsOpen(false)}
|
|
389
|
+
/>
|
|
390
|
+
) : (
|
|
391
|
+
<AddressForm
|
|
392
|
+
useValidationFileds
|
|
393
|
+
address={orderState?.options?.address || {}}
|
|
394
|
+
onCancel={() => setModalIsOpen(false)}
|
|
395
|
+
onSaveAddress={() => setModalIsOpen(false)}
|
|
396
|
+
/>
|
|
397
|
+
)
|
|
398
|
+
)}
|
|
399
|
+
{modalSelected === 'moment' && (
|
|
400
|
+
<MomentContent
|
|
401
|
+
onClose={() => setModalIsOpen(false)}
|
|
402
|
+
/>
|
|
403
|
+
)}
|
|
404
|
+
{modalSelected === 'delivery' && (
|
|
405
|
+
<OrderTypeSelectorContent
|
|
406
|
+
onClose={() => setModalIsOpen(false)}
|
|
407
|
+
configTypes={!configState?.loading && configTypes?.length > 0 ? configTypes : null}
|
|
408
|
+
defaultValue={!(!configState?.loading && configTypes?.length > 0) && 1}
|
|
409
|
+
/>
|
|
410
|
+
)}
|
|
411
|
+
</Modal>
|
|
412
|
+
)}
|
|
413
|
+
{isCustomerMode && customerModalOpen && (
|
|
414
|
+
<Modal
|
|
415
|
+
open={customerModalOpen}
|
|
416
|
+
width='80%'
|
|
417
|
+
onClose={() => setCustomerModalOpen(false)}
|
|
418
|
+
padding='20px'
|
|
419
|
+
hideCloseDefault
|
|
420
|
+
>
|
|
421
|
+
<UserEdit>
|
|
422
|
+
<>
|
|
423
|
+
<UserDetails
|
|
424
|
+
isAddressFormOpen={isAddressFormOpen}
|
|
425
|
+
userData={customerState?.user}
|
|
426
|
+
userId={customerState?.user?.id}
|
|
427
|
+
isOpenUserData={isOpenUserData}
|
|
428
|
+
isCustomerMode
|
|
429
|
+
isModal
|
|
430
|
+
setIsOpenUserData={setIsOpenUserData}
|
|
431
|
+
onClose={() => setCustomerModalOpen(false)}
|
|
432
|
+
/>
|
|
433
|
+
<AddressList
|
|
434
|
+
isModal
|
|
435
|
+
userId={customerState?.user?.id}
|
|
436
|
+
changeOrderAddressWithDefault
|
|
437
|
+
userCustomerSetup={customerState.user}
|
|
438
|
+
isOpenUserData={isOpenUserData}
|
|
439
|
+
setCustomerModalOpen={setCustomerModalOpen}
|
|
440
|
+
setIsOpenUserData={setIsOpenUserData}
|
|
441
|
+
setIsAddressFormOpen={setIsAddressFormOpen}
|
|
442
|
+
isHeader
|
|
443
|
+
/>
|
|
444
|
+
</>
|
|
445
|
+
</UserEdit>
|
|
477
446
|
</Modal>
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
447
|
+
)}
|
|
448
|
+
<Confirm
|
|
449
|
+
title={t('CUSTOMER', theme?.defaultLanguages?.CUSTOMER || 'Customer')}
|
|
450
|
+
content={confirm.content}
|
|
451
|
+
acceptText={t('ACCEPT', theme?.defaultLanguages?.ACCEPT || 'Accept')}
|
|
452
|
+
open={isCustomerMode && confirm.open}
|
|
453
|
+
onClose={() => setConfirm({ ...confirm, open: false })}
|
|
454
|
+
onCancel={() => setConfirm({ ...confirm, open: false })}
|
|
455
|
+
onAccept={confirm.handleOnAccept}
|
|
456
|
+
closeOnBackdrop={false}
|
|
457
|
+
/>
|
|
458
|
+
<Modal
|
|
459
|
+
open={!!preorderBusiness}
|
|
460
|
+
width='760px'
|
|
461
|
+
onClose={() => handleClosePreorder()}
|
|
462
|
+
>
|
|
463
|
+
<BusinessPreorder
|
|
464
|
+
business={preorderBusiness}
|
|
465
|
+
handleClick={handleBusinessClick}
|
|
466
|
+
showButton
|
|
467
|
+
/>
|
|
468
|
+
</Modal>
|
|
469
|
+
</HeaderContainer>
|
|
486
470
|
)
|
|
487
471
|
}
|
|
488
472
|
|
|
@@ -246,6 +246,7 @@ export const CustomerInfo = styled.div`
|
|
|
246
246
|
text-overflow: ellipsis;
|
|
247
247
|
white-space: nowrap;
|
|
248
248
|
color: #909BA9;
|
|
249
|
+
margin: 0;
|
|
249
250
|
}
|
|
250
251
|
svg {
|
|
251
252
|
color: #748194;
|
|
@@ -272,7 +273,18 @@ export const AddressMenu = styled.div`
|
|
|
272
273
|
display: flex;
|
|
273
274
|
align-items: center;
|
|
274
275
|
position: relative;
|
|
275
|
-
|
|
276
|
+
width: 50%;
|
|
277
|
+
|
|
278
|
+
span {
|
|
279
|
+
width: 85%;
|
|
280
|
+
p {
|
|
281
|
+
margin: 0;
|
|
282
|
+
padding: 0;
|
|
283
|
+
text-overflow: ellipsis;
|
|
284
|
+
white-space: nowrap;
|
|
285
|
+
overflow: hidden;
|
|
286
|
+
}
|
|
287
|
+
}
|
|
276
288
|
|
|
277
289
|
svg {
|
|
278
290
|
color: ${props => props.theme.colors?.lightGray};
|
|
@@ -283,6 +295,12 @@ export const AddressMenu = styled.div`
|
|
|
283
295
|
margin-right: 0;
|
|
284
296
|
`}
|
|
285
297
|
}
|
|
298
|
+
@media (min-width: 765px) {
|
|
299
|
+
width: 80%;
|
|
300
|
+
}
|
|
301
|
+
@media (min-width: 820px) {
|
|
302
|
+
width: 50%;
|
|
303
|
+
}
|
|
286
304
|
`
|
|
287
305
|
|
|
288
306
|
export const MomentMenu = styled.div`
|
|
@@ -121,7 +121,7 @@ const BusinessProductsCategoriesUI = (props) => {
|
|
|
121
121
|
if (typeof useKioskApp === 'undefined') return
|
|
122
122
|
const styleSheet = document.getElementById('styles').sheet
|
|
123
123
|
|
|
124
|
-
const disabledCustomWidth = isChew
|
|
124
|
+
const disabledCustomWidth = isChew || !useKioskApp
|
|
125
125
|
|
|
126
126
|
let style0 = '.sticky-prod-cat {'
|
|
127
127
|
style0 += 'position: fixed !important;'
|
|
@@ -317,6 +317,7 @@ const BusinessProductsListingUI = (props) => {
|
|
|
317
317
|
categorySelected={categorySelected}
|
|
318
318
|
openCategories={openCategories}
|
|
319
319
|
openBusinessInformation={openBusinessInformation}
|
|
320
|
+
forceShowNearBusiness={props.forceShowNearBusiness}
|
|
320
321
|
isCartOnProductsList={isCartOnProductsList && currentCart?.products?.length > 0}
|
|
321
322
|
handleChangeSortBy={handleChangeSortBy}
|
|
322
323
|
errorQuantityProducts={errorQuantityProducts}
|