ordering-ui-external 2.4.5 → 2.5.0

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.
Files changed (135) hide show
  1. package/_bundles/{0.ordering-ui.83ddb51fdc85c2b920b0.js → 0.ordering-ui.5657c6a53b3791887fd7.js} +1 -1
  2. package/_bundles/{1.ordering-ui.83ddb51fdc85c2b920b0.js → 1.ordering-ui.5657c6a53b3791887fd7.js} +1 -1
  3. package/_bundles/{2.ordering-ui.83ddb51fdc85c2b920b0.js → 2.ordering-ui.5657c6a53b3791887fd7.js} +1 -1
  4. package/_bundles/{4.ordering-ui.83ddb51fdc85c2b920b0.js → 4.ordering-ui.5657c6a53b3791887fd7.js} +1 -1
  5. package/_bundles/{5.ordering-ui.83ddb51fdc85c2b920b0.js → 5.ordering-ui.5657c6a53b3791887fd7.js} +1 -1
  6. package/_bundles/{6.ordering-ui.83ddb51fdc85c2b920b0.js → 6.ordering-ui.5657c6a53b3791887fd7.js} +1 -1
  7. package/_bundles/{7.ordering-ui.83ddb51fdc85c2b920b0.js → 7.ordering-ui.5657c6a53b3791887fd7.js} +2 -2
  8. package/_bundles/{8.ordering-ui.83ddb51fdc85c2b920b0.js → 8.ordering-ui.5657c6a53b3791887fd7.js} +1 -1
  9. package/_bundles/{9.ordering-ui.83ddb51fdc85c2b920b0.js → 9.ordering-ui.5657c6a53b3791887fd7.js} +1 -1
  10. package/_bundles/ordering-ui.5657c6a53b3791887fd7.js +2 -0
  11. package/_modules/components/OrdersOption/styles.js +1 -1
  12. package/_modules/components/VerticalOrdersLayout/SingleOrderCard/index.js +15 -8
  13. package/_modules/components/VerticalOrdersLayout/styles.js +2 -2
  14. package/_modules/contexts/ThemeContext/index.js +1 -0
  15. package/_modules/themes/five/src/components/AddressList/index.js +8 -7
  16. package/_modules/themes/five/src/components/BusinessBasicInformation/index.js +28 -22
  17. package/_modules/themes/five/src/components/BusinessBasicInformation/styles.js +22 -21
  18. package/_modules/themes/five/src/components/BusinessController/index.js +5 -3
  19. package/_modules/themes/five/src/components/BusinessInformation/index.js +16 -10
  20. package/_modules/themes/five/src/components/BusinessItemAccordion/index.js +5 -8
  21. package/_modules/themes/five/src/components/BusinessListingSearch/index.js +93 -74
  22. package/_modules/themes/five/src/components/BusinessListingSearch/styles.js +10 -4
  23. package/_modules/themes/five/src/components/BusinessProductsCategories/index.js +7 -2
  24. package/_modules/themes/five/src/components/BusinessProductsCategories/styles.js +1 -1
  25. package/_modules/themes/five/src/components/BusinessProductsList/index.js +1 -1
  26. package/_modules/themes/five/src/components/BusinessProductsListing/index.js +38 -13
  27. package/_modules/themes/five/src/components/BusinessProductsListing/styles.js +20 -9
  28. package/_modules/themes/five/src/components/BusinessesListing/layouts/OriginalBusinessesListing/index.js +35 -23
  29. package/_modules/themes/five/src/components/Cart/index.js +7 -3
  30. package/_modules/themes/five/src/components/Checkout/index.js +12 -11
  31. package/_modules/themes/five/src/components/Checkout/styles.js +8 -4
  32. package/_modules/themes/five/src/components/GiftCard/GiftCardUI/index.js +1 -0
  33. package/_modules/themes/five/src/components/GiftCard/PurchaseGiftCard/index.js +4 -3
  34. package/_modules/themes/five/src/components/GiftCard/PurchaseGiftCard/styles.js +14 -8
  35. package/_modules/themes/five/src/components/GiftCard/RedeemGiftCard/index.js +1 -1
  36. package/_modules/themes/five/src/components/Header/index.js +29 -21
  37. package/_modules/themes/five/src/components/Header/styles.js +44 -40
  38. package/_modules/themes/five/src/components/MultiCheckout/index.js +18 -16
  39. package/_modules/themes/five/src/components/MultiOrdersDetails/SingleOrderCard.js +6 -4
  40. package/_modules/themes/five/src/components/MyOrders/index.js +16 -10
  41. package/_modules/themes/five/src/components/MyOrders/styles.js +15 -12
  42. package/_modules/themes/five/src/components/OrderDetails/OrderEta.js +5 -2
  43. package/_modules/themes/five/src/components/OrderDetails/OrderHistory.js +2 -2
  44. package/_modules/themes/five/src/components/OrderDetails/index.js +2 -2
  45. package/_modules/themes/five/src/components/OrderItAgain/styles.js +1 -1
  46. package/_modules/themes/five/src/components/OrderProgress/index.js +15 -4
  47. package/_modules/themes/five/src/components/OrderTypeSelectorContent/index.js +16 -4
  48. package/_modules/themes/five/src/components/PageBanner/styles.js +1 -1
  49. package/_modules/themes/five/src/components/ProductForm/index.js +27 -7
  50. package/_modules/themes/five/src/components/ProductForm/styles.js +40 -31
  51. package/_modules/themes/five/src/components/ProductItemAccordion/index.js +6 -6
  52. package/_modules/themes/five/src/components/RenderProductsLayout/index.js +3 -3
  53. package/_modules/themes/five/src/components/ReviewProduct/index.js +9 -4
  54. package/_modules/themes/five/src/components/ServiceForm/index.js +22 -3
  55. package/_modules/themes/five/src/components/ServiceForm/styles.js +9 -3
  56. package/_modules/themes/five/src/components/SidebarMenu/index.js +19 -10
  57. package/_modules/themes/five/src/components/SignUpForm/index.js +56 -29
  58. package/_modules/themes/five/src/components/SingleOrderCard/index.js +1 -1
  59. package/_modules/themes/five/src/components/SingleOrderCard/styles.js +26 -24
  60. package/_modules/themes/five/src/components/SingleProductCard/layouts/original/index.js +9 -5
  61. package/_modules/themes/five/src/components/SingleProductCard/layouts/original/styles.js +2 -2
  62. package/_modules/themes/five/src/components/UpsellingPage/index.js +2 -1
  63. package/_modules/themes/five/src/components/UserFormDetails/index.js +58 -18
  64. package/_modules/themes/five/src/components/UserFormDetails/styles.js +7 -3
  65. package/_modules/themes/five/src/components/UserPopover/index.js +41 -25
  66. package/_modules/themes/five/src/components/UserProfileForm/index.js +19 -11
  67. package/_modules/themes/five/src/styles/Buttons/index.js +68 -58
  68. package/_modules/themes/five/src/styles/Inputs/index.js +40 -16
  69. package/_modules/utils/index.js +8 -2
  70. package/index.html +1 -1
  71. package/package.json +3 -2
  72. package/src/components/OrdersOption/styles.js +1 -0
  73. package/src/components/VerticalOrdersLayout/SingleOrderCard/index.js +35 -17
  74. package/src/components/VerticalOrdersLayout/styles.js +9 -0
  75. package/src/contexts/ThemeContext/index.js +1 -0
  76. package/src/themes/five/src/components/AddressList/index.js +6 -6
  77. package/src/themes/five/src/components/BusinessBasicInformation/index.js +24 -22
  78. package/src/themes/five/src/components/BusinessBasicInformation/styles.js +24 -3
  79. package/src/themes/five/src/components/BusinessController/index.js +4 -2
  80. package/src/themes/five/src/components/BusinessInformation/index.js +24 -12
  81. package/src/themes/five/src/components/BusinessItemAccordion/index.js +5 -6
  82. package/src/themes/five/src/components/BusinessListingSearch/index.js +127 -101
  83. package/src/themes/five/src/components/BusinessListingSearch/styles.js +15 -0
  84. package/src/themes/five/src/components/BusinessProductsCategories/index.js +7 -2
  85. package/src/themes/five/src/components/BusinessProductsCategories/styles.js +1 -1
  86. package/src/themes/five/src/components/BusinessProductsList/index.js +1 -1
  87. package/src/themes/five/src/components/BusinessProductsListing/index.js +34 -9
  88. package/src/themes/five/src/components/BusinessProductsListing/styles.js +26 -0
  89. package/src/themes/five/src/components/BusinessesListing/layouts/OriginalBusinessesListing/index.js +9 -2
  90. package/src/themes/five/src/components/Cart/index.js +3 -4
  91. package/src/themes/five/src/components/Checkout/index.js +18 -4
  92. package/src/themes/five/src/components/Checkout/styles.js +22 -0
  93. package/src/themes/five/src/components/GiftCard/GiftCardUI/index.js +1 -0
  94. package/src/themes/five/src/components/GiftCard/PurchaseGiftCard/index.js +41 -31
  95. package/src/themes/five/src/components/GiftCard/PurchaseGiftCard/styles.js +15 -4
  96. package/src/themes/five/src/components/GiftCard/RedeemGiftCard/index.js +2 -2
  97. package/src/themes/five/src/components/Header/index.js +17 -5
  98. package/src/themes/five/src/components/Header/styles.js +9 -6
  99. package/src/themes/five/src/components/MultiCheckout/index.js +9 -10
  100. package/src/themes/five/src/components/MultiOrdersDetails/SingleOrderCard.js +8 -5
  101. package/src/themes/five/src/components/MyOrders/index.js +13 -9
  102. package/src/themes/five/src/components/MyOrders/styles.js +3 -1
  103. package/src/themes/five/src/components/OrderDetails/OrderEta.js +3 -2
  104. package/src/themes/five/src/components/OrderDetails/OrderHistory.js +8 -2
  105. package/src/themes/five/src/components/OrderDetails/index.js +2 -2
  106. package/src/themes/five/src/components/OrderItAgain/styles.js +1 -1
  107. package/src/themes/five/src/components/OrderProgress/index.js +16 -5
  108. package/src/themes/five/src/components/OrderTypeSelectorContent/index.js +7 -4
  109. package/src/themes/five/src/components/PageBanner/styles.js +1 -4
  110. package/src/themes/five/src/components/ProductForm/index.js +23 -5
  111. package/src/themes/five/src/components/ProductForm/styles.js +36 -1
  112. package/src/themes/five/src/components/ProductItemAccordion/index.js +37 -29
  113. package/src/themes/five/src/components/RenderProductsLayout/index.js +3 -3
  114. package/src/themes/five/src/components/ReviewProduct/index.js +14 -6
  115. package/src/themes/five/src/components/ServiceForm/index.js +22 -4
  116. package/src/themes/five/src/components/ServiceForm/styles.js +16 -0
  117. package/src/themes/five/src/components/SidebarMenu/index.js +162 -144
  118. package/src/themes/five/src/components/SignUpForm/index.js +4 -3
  119. package/src/themes/five/src/components/SingleOrderCard/index.js +1 -1
  120. package/src/themes/five/src/components/SingleOrderCard/styles.js +9 -1
  121. package/src/themes/five/src/components/SingleProductCard/layouts/original/index.js +13 -3
  122. package/src/themes/five/src/components/SingleProductCard/layouts/original/styles.js +2 -2
  123. package/src/themes/five/src/components/UpsellingPage/index.js +1 -1
  124. package/src/themes/five/src/components/UserFormDetails/index.js +58 -14
  125. package/src/themes/five/src/components/UserFormDetails/styles.js +16 -0
  126. package/src/themes/five/src/components/UserPopover/index.js +26 -15
  127. package/src/themes/five/src/components/UserProfileForm/index.js +18 -9
  128. package/src/themes/five/src/styles/Buttons/index.js +11 -0
  129. package/src/themes/five/src/styles/Inputs/index.js +34 -0
  130. package/src/utils/index.js +5 -0
  131. package/template/app.js +5 -3
  132. package/template/theme.json +335 -24
  133. package/_bundles/ordering-ui.83ddb51fdc85c2b920b0.js +0 -2
  134. /package/_bundles/{7.ordering-ui.83ddb51fdc85c2b920b0.js.LICENSE.txt → 7.ordering-ui.5657c6a53b3791887fd7.js.LICENSE.txt} +0 -0
  135. /package/_bundles/{ordering-ui.83ddb51fdc85c2b920b0.js.LICENSE.txt → ordering-ui.5657c6a53b3791887fd7.js.LICENSE.txt} +0 -0
@@ -319,10 +319,16 @@ export const MobileWrapperPlaceOrderButton = styled.div`
319
319
  export const OrderContextUIWrapper = styled.div`
320
320
  flex: 1;
321
321
  margin-left: 15px;
322
+ max-width: 85%;
323
+
322
324
  ${props => props.theme.rtl && css`
323
325
  margin-left: 0px;
324
326
  margin-right: 15px;
325
327
  `}
328
+
329
+ @media (min-width: 480px) {
330
+ max-width: 90%;
331
+ }
326
332
  `
327
333
 
328
334
  export const HeaderContent = styled.div`
@@ -349,3 +355,19 @@ export const AuthButtonList = styled.div`
349
355
  margin-top: 22px;
350
356
  }
351
357
  `
358
+ export const Flag = styled.span`
359
+ font-size: 13px;
360
+ margin: 0px;
361
+ text-transform: capitalize;
362
+ color: #E63757;
363
+ font-weight: 500;
364
+
365
+ @media (min-width: 381px) {
366
+ font-size: 14px;
367
+ }
368
+ `
369
+ export const SectionTitleContainer = styled.div`
370
+ display: flex;
371
+ align-items: center;
372
+ justify-content: space-between;
373
+ `
@@ -40,6 +40,7 @@ export const GiftCardUI = (props) => {
40
40
  </ActionWrapper>
41
41
  <Modal
42
42
  width='700px'
43
+ padding='0px'
43
44
  open={openModal === 'purchase'}
44
45
  onClose={() => setOpenModal(null)}
45
46
  >
@@ -4,12 +4,15 @@ import Skeleton from 'react-loading-skeleton'
4
4
  import { Button } from '../../../styles/Buttons'
5
5
  import RiRadioButtonFill from '@meronex/icons/ri/RiRadioButtonFill'
6
6
  import MdRadioButtonUnchecked from '@meronex/icons/md/MdRadioButtonUnchecked'
7
+ import { NotFoundSource } from '../../NotFoundSource'
7
8
 
8
9
  import {
9
10
  Container,
10
11
  GiftCardsListContainer,
12
+ GiftCardsWrapper,
11
13
  GiftCardItem,
12
- IconControl
14
+ IconControl,
15
+ ActionButtonContainer
13
16
  } from './styles'
14
17
 
15
18
  const PurchaseGiftCardUI = (props) => {
@@ -24,39 +27,46 @@ const PurchaseGiftCardUI = (props) => {
24
27
  return (
25
28
  <Container>
26
29
  <h2>{t('PURCHASE_GIFT_CARD', 'Purchase gift card')}</h2>
27
- <p>{t('SELECT_ONE_OPTION', 'Select one option')}</p>
28
30
  <GiftCardsListContainer>
29
- {productsListState.loading && (
30
- [...Array(5).keys()].map(i => (
31
- <GiftCardItem key={i}>
32
- <Skeleton width={150} />
31
+ <p>{t('SELECT_ONE_OPTION', 'Select one option')}</p>
32
+ <GiftCardsWrapper>
33
+ {productsListState.loading && (
34
+ [...Array(5).keys()].map(i => (
35
+ <GiftCardItem key={i}>
36
+ <Skeleton width={150} />
37
+ </GiftCardItem>
38
+ ))
39
+ )}
40
+ {productsListState.products.map(product => (
41
+ <GiftCardItem
42
+ key={product.id}
43
+ onClick={() => setSelectedProduct(product)}
44
+ >
45
+ <IconControl>
46
+ {selectedProduct?.id === product.id ? (
47
+ <RiRadioButtonFill />
48
+ ) : (
49
+ <MdRadioButtonUnchecked disabled />
50
+ )}
51
+ </IconControl>
52
+ <span>{product.name}</span>
33
53
  </GiftCardItem>
34
- ))
35
- )}
36
- {productsListState.products.map(product => (
37
- <GiftCardItem
38
- key={product.id}
39
- onClick={() => setSelectedProduct(product)}
40
- >
41
- <IconControl>
42
- {selectedProduct?.id === product.id ? (
43
- <RiRadioButtonFill />
44
- ) : (
45
- <MdRadioButtonUnchecked disabled />
46
- )}
47
- </IconControl>
48
- <span>{product.name}</span>
49
- </GiftCardItem>
50
- ))}
54
+ ))}
55
+ {!productsListState.loading && productsListState.products.length === 0 && (
56
+ <NotFoundSource />
57
+ )}
58
+ </GiftCardsWrapper>
51
59
  </GiftCardsListContainer>
52
- <Button
53
- type='button'
54
- color='primary'
55
- disabled={!selectedProduct}
56
- onClick={() => handleAccept()}
57
- >
58
- {t('ACCEPT', 'Accept')}
59
- </Button>
60
+ <ActionButtonContainer>
61
+ <Button
62
+ type='button'
63
+ color='primary'
64
+ disabled={!selectedProduct}
65
+ onClick={() => handleAccept()}
66
+ >
67
+ {t('ACCEPT', 'Accept')}
68
+ </Button>
69
+ </ActionButtonContainer>
60
70
  </Container>
61
71
  )
62
72
  }
@@ -3,6 +3,7 @@ import styled, { css } from 'styled-components'
3
3
  export const Container = styled.div`
4
4
  display: flex;
5
5
  flex-direction: column;
6
+ padding-top: 30px;
6
7
 
7
8
  h2 {
8
9
  font-size: 24px;
@@ -16,12 +17,12 @@ export const Container = styled.div`
16
17
  line-height: 24px;
17
18
  margin-top: 0;
18
19
  }
19
- > button {
20
- height: 44px;
21
- }
22
20
  `
23
21
  export const GiftCardsListContainer = styled.div`
24
- margin-bottom: 40px;
22
+ padding: 30px 20px;
23
+ `
24
+ export const GiftCardsWrapper = styled.div`
25
+ margin-bottom: 10px;
25
26
  `
26
27
  export const GiftCardItem = styled.div`
27
28
  cursor: pointer;
@@ -50,3 +51,13 @@ export const IconControl = styled.div`
50
51
  color: ${props => props.theme.colors.lightGray};
51
52
  }
52
53
  `
54
+ export const ActionButtonContainer = styled.div`
55
+ position: sticky;
56
+ bottom: 0px;
57
+ background-color: ${props => props.theme.colors.backgroundPage};
58
+ padding: 15px 20px;
59
+ > button {
60
+ height: 44px;
61
+ width: 100%;
62
+ }
63
+ `
@@ -98,8 +98,8 @@ const RedeemGiftCardUI = (props) => {
98
98
  <p>{t('TYPE', 'Type')}: {redeemedGiftCard?.type}</p>
99
99
  <p>{t('AMOUNT', 'Amount')}: {parsePrice(redeemedGiftCard?.amount)}</p>
100
100
  <p>{t('FROM', 'From')}: {redeemedGiftCard?.receiver?.name} {redeemedGiftCard?.receiver?.lastname}</p>
101
- <p>{t('TITLE', 'Title')}: {redeemedGiftCard?.title}</p>
102
- <p>{t('MESSAGES', 'Messages')}: {redeemedGiftCard?.message}</p>
101
+ {redeemedGiftCard?.title && <p>{t('TITLE', 'Title')}: {redeemedGiftCard?.title}</p>}
102
+ {redeemedGiftCard?.message && <p>{t('MESSAGES', 'Messages')}: {redeemedGiftCard?.message}</p>}
103
103
  <Button
104
104
  color='primary'
105
105
  onClick={() => onClose()}
@@ -1,6 +1,6 @@
1
1
  import React, { useState, useEffect, useRef } from 'react'
2
2
  import { useLocation } from 'react-router-dom'
3
- import { useSession, useLanguage, useOrder, useEvent, useConfig, useCustomer, useUtils, useOrderingTheme } from 'ordering-components-external'
3
+ import { useSession, useLanguage, useOrder, useEvent, useConfig, useCustomer, useUtils, useOrderingTheme, useBusiness } from 'ordering-components-external'
4
4
  import { useTheme } from 'styled-components'
5
5
  import AiOutlineClose from '@meronex/icons/ai/AiOutlineClose'
6
6
  import { LanguageSelector } from '../../../../../components/LanguageSelector'
@@ -47,7 +47,7 @@ import { Confirm } from '../Confirm'
47
47
  import { LoginForm } from '../LoginForm'
48
48
  import { SignUpForm } from '../SignUpForm'
49
49
  import { ForgotPasswordForm } from '../ForgotPasswordForm'
50
- import { getDistance } from '../../../../../utils'
50
+ import { getDistance, getCateringValues } from '../../../../../utils'
51
51
  import { BusinessPreorder } from '../BusinessPreorder'
52
52
  import { SearchBar } from '../SearchBar'
53
53
 
@@ -73,6 +73,7 @@ export const Header = (props) => {
73
73
  const [configState] = useConfig()
74
74
  const [customerState, { deleteUserCustomer }] = useCustomer()
75
75
  const [orderingTheme] = useOrderingTheme()
76
+ const [{ business }] = useBusiness()
76
77
 
77
78
  const clearCustomer = useRef(null)
78
79
  const [modalIsOpen, setModalIsOpen] = useState(false)
@@ -93,11 +94,18 @@ export const Header = (props) => {
93
94
 
94
95
  const userCustomer = JSON.parse(window.localStorage.getItem('user-customer'))
95
96
 
96
- const orderTypeList = [t('DELIVERY', 'Delivery'), t('PICKUP', 'Pickup'), t('EAT_IN', 'Eat in'), t('CURBSIDE', 'Curbside'), t('DRIVE_THRU', 'Drive thru')]
97
+ const orderTypeList = [t('DELIVERY', 'Delivery'), t('PICKUP', 'Pickup'), t('EAT_IN', 'Eat in'), t('CURBSIDE', 'Curbside'), t('DRIVE_THRU', 'Drive thru'), '', t('CATERING_DELIVERY', 'Catering Delivery'), t('CATERING_PICKUP', 'Catering pickup')]
97
98
  const configTypes = configState?.configs?.order_types_allowed?.value.split('|').map(value => Number(value)) || []
98
99
  const isPreOrderSetting = configState?.configs?.preorder_status_enabled?.value === '1'
99
100
  const isChew = orderingTheme?.theme?.header?.components?.layout?.type?.toLowerCase() === 'chew'
100
101
  const isHideLanguages = theme?.header?.components?.language_selector?.hidden
102
+ const cateringTypeString = orderState?.options?.type === 7
103
+ ? 'catering_delivery'
104
+ : orderState?.options?.type === 8
105
+ ? 'catering_pickup'
106
+ : null
107
+
108
+ const cateringValues = getCateringValues(cateringTypeString, pathname.includes('store') && Object?.keys(business || {})?.length > 0 ? business?.configs : configState?.configs)
101
109
 
102
110
  const handleSuccessSignup = (user) => {
103
111
  login({
@@ -225,12 +233,12 @@ export const Header = (props) => {
225
233
  isChew={isChew}
226
234
  >
227
235
  <img alt='Logotype' width='170px' height={isChew ? '35px' : '45px'} src={isChew ? theme?.images?.logos?.chewLogo : orderingTheme?.theme?.my_products?.components?.images?.components?.logo?.components?.image || theme?.images?.logos?.logotype} loading='lazy' />
228
- <img alt='Isotype' width={isChew ? '70px' : '35px'} height={isChew ? '20px' : '45px'} src={isChew ? theme?.images?.logos?.chewLogo : orderingTheme?.theme?.my_products?.components?.images?.components?.logo?.components?.image || (isHome ? theme?.images?.logos?.isotypeInvert : theme?.images?.logos?.isotype)} loading='lazy' />
236
+ <img alt='Isotype' width={isChew ? '70px' : '35px'} height={isChew ? '20px' : '45px'} src={isChew ? theme?.images?.logos?.chewLogo : (isHome && windowSize.width < 576 ? theme?.images?.logos?.isotypeInvert : orderingTheme?.theme?.my_products?.components?.images?.components?.logo?.components?.image || theme?.images?.logos?.isotype)} loading='lazy' />
229
237
  </LogoHeader>
230
238
  </LeftHeader>
231
239
  {isShowOrderOptions && !props.isCustomLayout && windowSize.width >= 576 && (
232
240
  <Menu id='center-side' className='left-header' isCustomerMode={isCustomerMode} isChew={isChew}>
233
- {windowSize.width > 820 && isFarAway && (
241
+ {windowSize.width > 850 && isFarAway && (
234
242
  <FarAwayMessage>
235
243
  <TiWarningOutline />
236
244
  <span>{t('YOU_ARE_FAR_FROM_ADDRESS', 'You are far from this address')}</span>
@@ -484,6 +492,10 @@ export const Header = (props) => {
484
492
  {modalSelected === 'moment' && (
485
493
  <MomentContent
486
494
  onClose={() => setModalIsOpen(false)}
495
+ cateringPreorder={!!cateringTypeString}
496
+ isHeader
497
+ business={pathname.includes('store') && business}
498
+ {...cateringValues}
487
499
  />
488
500
  )}
489
501
  {modalSelected === 'delivery' && (
@@ -62,6 +62,10 @@ export const LogoHeader = styled.div`
62
62
  margin-left: 0;
63
63
  `}
64
64
  @media (min-width: 769px) {
65
+ ${({ theme }) =>
66
+ ['center', 'right']?.includes(theme?.header?.components?.logo?.components?.layout?.position) && css`
67
+ margin-right: 30px;
68
+ `};
65
69
  width: ${props => props.imgW ?? '150px'};
66
70
  height: ${props => props.isChew && '35px'};
67
71
  }
@@ -101,7 +105,6 @@ export const Menu = styled.div`
101
105
  display: flex;
102
106
  align-items: center;
103
107
  margin-right: 10px;
104
-
105
108
  #select-input {
106
109
  border-radius: 7.6px;
107
110
  #list {
@@ -137,7 +140,7 @@ export const Menu = styled.div`
137
140
  justify-content: center;
138
141
  position: relative;
139
142
  height: 44px;
140
- @media (min-width: 821px) {
143
+ @media (min-width: 850px) {
141
144
  border: 1px solid #DEE2E6;
142
145
  justify-content: space-between;
143
146
  }
@@ -195,7 +198,7 @@ export const Menu = styled.div`
195
198
  padding: 0 20px;
196
199
  }
197
200
  }
198
- @media (min-width: 821px) {
201
+ @media (min-width: 850px) {
199
202
  .moment-popover,
200
203
  .address-popover {
201
204
  display: flex;
@@ -233,7 +236,7 @@ export const SubMenu = styled(InnerHeader)`
233
236
  box-sizing: border-box;
234
237
  margin: 0px;
235
238
  position: relative;
236
- @media (min-width: 821px) {
239
+ @media (min-width: 850px) {
237
240
  display: none;
238
241
  }
239
242
  `
@@ -326,7 +329,7 @@ export const MomentMenu = styled.div`
326
329
  width: 200px;
327
330
  display: none;
328
331
 
329
- @media (min-width: 821px) {
332
+ @media (min-width: 850px) {
330
333
  display: flex;
331
334
  }
332
335
  @media (min-width: 1175px) {
@@ -455,7 +458,7 @@ export const LeftSide = styled.div`
455
458
  width: 100%;
456
459
  @media (min-width: 769px){
457
460
  flex-direction: ${({ theme }) =>
458
- theme?.header?.components?.logo?.components?.layout?.position === 'center' ? 'row-reverse' : 'row'};
461
+ ['center', 'right']?.includes(theme?.header?.components?.logo?.components?.layout?.position) ? 'row-reverse' : 'row'};
459
462
  width: 60%;
460
463
  }
461
464
  `
@@ -101,10 +101,13 @@ const MultiCheckoutUI = (props) => {
101
101
  ? JSON.parse(configs?.driver_tip_options?.value) || []
102
102
  : configs?.driver_tip_options?.value || []
103
103
 
104
- const creditPointPlan = loyaltyPlansState?.result?.find((loyal) => loyal.type === 'credit_point')
105
- const businessIds = openCarts.map((cart) => cart.business_id)
106
- const loyalBusinessIds = creditPointPlan?.businesses?.filter((b) => b.accumulates).map((item) => item.business_id) ?? []
107
- const creditPointPlanOnBusiness = businessIds.every((bid) => loyalBusinessIds.includes(bid)) && creditPointPlan
104
+ const creditPointGeneralPlan = loyaltyPlansState?.result?.find((loyal) => loyal.type === 'credit_point')
105
+ const loyalBusinessAvailable = creditPointGeneralPlan?.businesses?.filter((b) => b.accumulates) ?? []
106
+
107
+ const accumulationRateBusiness = (businessId) => {
108
+ const value = loyalBusinessAvailable?.find((loyal) => loyal.business_id === businessId)?.accumulation_rate ?? 0
109
+ return value || (creditPointGeneralPlan?.accumulation_rate ?? 0)
110
+ }
108
111
 
109
112
  const getIncludedTaxes = (cart) => {
110
113
  if (cart?.taxes === null || !cart?.taxes) {
@@ -116,12 +119,8 @@ const MultiCheckoutUI = (props) => {
116
119
  }
117
120
  }
118
121
 
119
- const subtotalAmount = openCarts.reduce((sum, cart) => sum + (cart?.subtotal + getIncludedTaxes(cart)), 0) *
120
- creditPointPlanOnBusiness?.accumulation_rate
121
-
122
- const loyaltyRewardValue = (creditPointPlanOnBusiness?.accumulation_rate
123
- ? (Math.trunc(subtotalAmount * 100) / 100).toFixed(configs.format_number_decimal_length?.value ?? 2)
124
- : 0)
122
+ const clearAmount = (value) => parseFloat((Math.trunc(value * 100) / 100).toFixed(configs.format_number_decimal_length?.value ?? 2))
123
+ const loyaltyRewardValue = openCarts.reduce((sum, cart) => sum + clearAmount((cart?.subtotal + getIncludedTaxes(cart)) * accumulationRateBusiness(cart?.business_id)), 0)
125
124
 
126
125
  const handlePlaceOrder = () => {
127
126
  if (!userErrors.length) {
@@ -12,6 +12,7 @@ import AiFillExclamationCircle from '@meronex/icons/ai/AiFillExclamationCircle'
12
12
  import { Phone, Chat } from 'react-bootstrap-icons'
13
13
  import { Button } from '../../styles/Buttons'
14
14
  import { Modal } from '../Modal'
15
+ import { OrderEta } from '../OrderDetails/OrderEta'
15
16
 
16
17
  import {
17
18
  SingleOrderContainer,
@@ -47,6 +48,8 @@ const SingleOrderCardUI = (props) => {
47
48
  const [unreadAlert, setUnreadAlert] = useState({ business: false, driver: false })
48
49
  const hideIndividualButton = configs.multi_business_checkout_remove_individual_buttons?.value === '1'
49
50
 
51
+ const activeStatus = [0, 3, 4, 7, 8, 9, 14, 18, 19, 20, 21, 22, 23]
52
+
50
53
  const handleGoToOrderDetails = (uuid) => {
51
54
  events.emit('go_to_page', { page: 'order_detail', params: { orderId: uuid }, replace: !props.isMultiOrders })
52
55
  }
@@ -84,11 +87,11 @@ const SingleOrderCardUI = (props) => {
84
87
  {orderTypes?.find(type => order?.delivery_type === type?.value)?.text}:
85
88
  </p>
86
89
  <p className='date'>
87
- {
88
- order?.delivery_datetime_utc
89
- ? parseDate(order?.delivery_datetime_utc)
90
- : parseDate(order?.delivery_datetime, { utc: false })
91
- }
90
+ {activeStatus.includes(order?.status) ? (
91
+ <OrderEta order={order} />
92
+ ) : (
93
+ parseDate(order?.reporting_data?.at[`status:${order.status}`])
94
+ )}
92
95
  </p>
93
96
  </div>
94
97
  </div>
@@ -1,5 +1,5 @@
1
1
  import React, { useState } from 'react'
2
- import { useLanguage, useOrderingTheme } from 'ordering-components-external'
2
+ import { useLanguage } from 'ordering-components-external'
3
3
  import { ProfileOptions } from '../../../../../components/UserProfileForm/ProfileOptions'
4
4
  import { OrdersOption } from '../OrdersOption'
5
5
  import { Button } from '../../styles/Buttons'
@@ -13,19 +13,20 @@ import {
13
13
  MyOrdersMenuContainer
14
14
  } from './styles'
15
15
  import { Tab, Tabs } from '../../styles/Tabs'
16
+ import { useTheme } from 'styled-components'
16
17
 
17
18
  export const MyOrders = (props) => {
18
19
  const {
19
20
  hideOrders,
21
+ isFromBusinessListingSearch,
20
22
  businessesSearchList,
21
23
  onProductRedirect
22
24
  } = props
23
25
 
24
26
  const [, t] = useLanguage()
25
27
  const history = useHistory()
26
-
27
- const [orderingTheme] = useOrderingTheme()
28
- const layout = orderingTheme?.theme?.orders?.components?.layout?.type || 'original'
28
+ const theme = useTheme()
29
+ const layout = theme?.orders?.components?.layout?.type || 'original'
29
30
 
30
31
  const [isEmptyActive, setIsEmptyActive] = useState(false)
31
32
  const [isEmptyPast, setIsEmptyPast] = useState(false)
@@ -34,10 +35,13 @@ export const MyOrders = (props) => {
34
35
  const [isEmptyBusinesses, setIsEmptyBusinesses] = useState(false)
35
36
  const [businessOrderIds, setBusinessOrderIds] = useState([])
36
37
 
38
+ const hideProductsTab = theme?.orders?.components?.products_tab?.hidden
39
+ const hideBusinessTab = theme?.orders?.components?.business_tab?.hidden
40
+
37
41
  const MyOrdersMenu = [
38
- { key: 'orders', value: t('ORDERS', 'Orders') },
39
- { key: 'business', value: t('BUSINESS', 'Business') },
40
- { key: 'products', value: t('PRODUCTS', 'Products') }
42
+ { key: 'orders', value: t('ORDERS', 'Orders'), disabled: false},
43
+ { key: 'business', value: t('BUSINESS', 'Business'), disabled: hideBusinessTab },
44
+ { key: 'products', value: t('PRODUCTS', 'Products'), disabled: hideProductsTab }
41
45
  ]
42
46
 
43
47
  const notOrderOptions = ['business', 'products', 'professionals']
@@ -54,14 +58,14 @@ export const MyOrders = (props) => {
54
58
  {hideOrders && !allEmpty && (
55
59
  <h2>{t('PREVIOUSLY_ORDERED', 'Previously ordered')}</h2>
56
60
  )}
57
- <Container hideOrders={hideOrders}>
61
+ <Container hideOrders={hideOrders} initialHeight={isFromBusinessListingSearch}>
58
62
  {!hideOrders && (
59
63
  <h1>{layout === 'appointments' ? t('MY_APPOINTMENTS', 'My appointments') : t('MY_ORDERS', 'My orders')}</h1>
60
64
  )}
61
65
  {!allEmpty && (
62
66
  <MyOrdersMenuContainer className='category-lists'>
63
67
  <Tabs variant='primary'>
64
- {MyOrdersMenu.filter(option => !hideOrders || option.key !== 'orders').map(option => (
68
+ {MyOrdersMenu.filter(option => (!hideOrders || option.key !== 'orders') && !option.disabled).map(option => (
65
69
  <Tab
66
70
  key={option.key}
67
71
  onClick={() => setSelectedOption(option.key)}
@@ -7,7 +7,9 @@ export const Container = styled.div`
7
7
  width: 100%;
8
8
  box-sizing: border-box;
9
9
  position: relative;
10
- min-height: calc(100vh - 320px);
10
+ ${({ initialHeight }) => !initialHeight && css`
11
+ min-height: calc(100vh - 320px);
12
+ `}
11
13
 
12
14
  > h1 {
13
15
  font-weight: 600;
@@ -12,7 +12,7 @@ export const OrderEta = (props) => {
12
12
  const [estimatedDeliveryTime, setEstimatedDeliveryTime] = useState(null)
13
13
 
14
14
  const getEstimatedDeliveryTime = () => {
15
- let _estimatedTime
15
+ let _estimatedTime = null
16
16
  let totalEta = 0
17
17
  const _delivery = order?.delivery_datetime_utc
18
18
  ? order?.delivery_datetime_utc
@@ -40,7 +40,8 @@ export const OrderEta = (props) => {
40
40
  } else {
41
41
  _estimatedTime = moment.utc(_delivery).add(order?.eta_time, 'minutes')
42
42
  }
43
- _estimatedTime = outputFormat ? moment(_estimatedTime).format(outputFormat) : parseDate(_estimatedTime, { utc: false })
43
+ if (order?.delivered_in) { _estimatedTime = moment.utc(_delivery).add(order?.delivered_in, 'minutes')}
44
+ _estimatedTime = outputFormat ? moment(_estimatedTime).local().format(outputFormat) : parseDate(_estimatedTime, { utc: false })
44
45
  setEstimatedDeliveryTime(_estimatedTime)
45
46
  }
46
47
 
@@ -2,7 +2,7 @@ import React from 'react'
2
2
  import { useLanguage, useUtils } from 'ordering-components-external'
3
3
  import { ArrowRight, CheckCircleFill } from 'react-bootstrap-icons'
4
4
  import { Button } from '../../styles/Buttons'
5
- import { getTraduction } from '../../../../../utils'
5
+ import { formatSeconds, getTraduction } from '../../../../../utils'
6
6
  import {
7
7
  OrderHistoryContainer,
8
8
  HistoryItemWrapper,
@@ -127,7 +127,13 @@ export const OrderHistory = (props) => {
127
127
  <h3>
128
128
  {message.change?.attribute === 'logistic_status'
129
129
  ? getLogisticTagStatus(parseInt(message.change.new, 10))
130
- : t(getStatus(parseInt(message.change.new, 10)))
130
+ : message.change?.attribute === 'delivered_in' ? (
131
+ <h3>
132
+ <strong>{t('TIME_ADDED_BY_DRIVER', 'Time added by driver')}</strong><br />
133
+ {formatSeconds(parseInt(message.change.new, 10))}
134
+ </h3>
135
+ )
136
+ :t(getStatus(parseInt(message.change.new, 10)))
131
137
  }
132
138
  </h3>
133
139
  ) : (
@@ -127,7 +127,7 @@ const OrderDetailsUI = (props) => {
127
127
  const acceptedStatus = [1, 2, 5, 6, 10, 11, 12]
128
128
  const completedStatus = [1, 2, 5, 6, 10, 11, 12, 15, 16, 17]
129
129
  const placeSpotTypes = [3, 4, 5]
130
- const activeStatus = [0, 3, 4, 7, 8, 9, 14, 18, 19, 20, 21, 22, 23]
130
+ const activeStatus = [0, 3, 4, 7, 8, 9, 13, 14, 18, 19, 20, 21, 22, 23]
131
131
  const googleMapsApiKey = configs?.google_maps_api_key?.value
132
132
  const enabledPoweredByOrdering = configs?.powered_by_ordering_module?.value
133
133
 
@@ -515,7 +515,7 @@ const OrderDetailsUI = (props) => {
515
515
  </p>
516
516
  </PlaceSpotSection>
517
517
  )}
518
- {hideOrderActions && (
518
+ {!hideOrderActions && (
519
519
  <DirectionButtonWrapper>
520
520
  <Button
521
521
  color='primary'
@@ -1,7 +1,7 @@
1
1
  import styled, { css } from 'styled-components'
2
2
 
3
3
  export const Container = styled.div`
4
- padding-top: 5px;
4
+ padding-top: 25px;
5
5
  margin: 0px;
6
6
  ${props => props.theme.rtl && css`
7
7
  margin-left: 30px;
@@ -35,6 +35,7 @@ const OrderProgressUI = (props) => {
35
35
  const theme = useTheme()
36
36
  const [events] = useEvent()
37
37
  const [lastOrder, setLastOrder] = useState(null)
38
+ const statusToShow = [0, 3, 4, 7, 8, 9, 14, 18, 19, 20, 21]
38
39
 
39
40
  const isChew = theme?.header?.components?.layout?.type?.toLowerCase() === 'chew'
40
41
 
@@ -45,7 +46,15 @@ const OrderProgressUI = (props) => {
45
46
  useEffect(() => {
46
47
  if (orderList?.orders.length > 0) {
47
48
  const sortedOrders = orderList.orders.sort((a, b) => a.id > b.id ? -1 : 1)
48
- setLastOrder(sortedOrders[0])
49
+ const orderInProgress = sortedOrders.find(({ status }) => (statusToShow.includes(status)))
50
+
51
+ let _lastOrder = null
52
+ if (orderInProgress) {
53
+ _lastOrder = orderInProgress
54
+ } else {
55
+ _lastOrder = sortedOrders[0]
56
+ }
57
+ setLastOrder(_lastOrder)
49
58
  }
50
59
  }, [orderList?.orders])
51
60
 
@@ -66,8 +75,10 @@ const OrderProgressUI = (props) => {
66
75
  : isChew ? theme.images.logos.chewLogoReverse : theme.images.logos.logotype}
67
76
  />
68
77
  <ProgressDescriptionWrapper>
69
- <h2>{t('ORDER_IN_PROGRESS', 'Order in progress')}</h2>
70
- <p>{t('RESTAURANT_PREPARING_YOUR_ORDER', 'The restaurant is preparing your order')}</p>
78
+ <h2>{statusToShow.includes(lastOrder?.status) ? t('ORDER_IN_PROGRESS', 'Order in progress') : t('ORDER', 'Order')}</h2>
79
+ {statusToShow.includes(lastOrder?.status) && (
80
+ <p>{t('RESTAURANT_PREPARING_YOUR_ORDER', 'The restaurant is preparing your order')}</p>
81
+ )}
71
82
  <Button
72
83
  color='primaryContrast'
73
84
  naked
@@ -93,7 +104,7 @@ const OrderProgressUI = (props) => {
93
104
  <ProgressTextWrapper>
94
105
  <StatusWrapper>{getOrderStatus(lastOrder?.status)?.value}</StatusWrapper>
95
106
  <TimeWrapper>
96
- <span>{t('ESTIMATED_DELIVERY', 'Estimated delivery')}:&nbsp;</span>
107
+ <span>{lastOrder?.delivery_type === 1 ? t('ESTIMATED_DELIVERY', 'Estimated delivery') : t('ESTIMATED_TIME', 'Estimated time')}:&nbsp;</span>
97
108
  <span>
98
109
  {lastOrder?.delivery_datetime_utc
99
110
  ? parseTime(lastOrder?.delivery_datetime_utc, { outputFormat: 'hh:mm A', utc: false })
@@ -116,7 +127,7 @@ export const OrderProgress = (props) => {
116
127
  const orderProgressProps = {
117
128
  ...props,
118
129
  UIComponent: OrderProgressUI,
119
- orderStatus: [0, 3, 4, 7, 8, 9, 13, 14, 15, 18, 19, 20, 21, 22, 23],
130
+ orderStatus: [0, 3, 4, 7, 8, 9, 13, 14, 18, 19, 20, 21, 22, 23],
120
131
  useDefualtSessionManager: true,
121
132
  paginationSettings: {
122
133
  initialPage: 1,
@@ -28,7 +28,10 @@ export const OrderTypeSelectorContentUI = (props) => {
28
28
  handleChangeOrderType && handleChangeOrderType(orderType)
29
29
  }
30
30
 
31
- const orderTypeImage = (type) => theme?.header?.components?.order_types?.components?.[type]?.components?.image
31
+ const orderTypeImage = (type) => theme?.order_types?.components?.[type]?.components?.image
32
+ const orderTypeTitle = (type) => theme?.order_types?.components?.[type]?.components?.title
33
+ const orderTypeDescription = (type) => theme?.order_types?.components?.[type]?.components?.description
34
+ const orderTypeCallAction = (type) => theme?.order_types?.components?.[type]?.components?.call_to_action
32
35
 
33
36
  return (
34
37
  <div className='order-type' style={{ overflow: 'hidden' }}>
@@ -48,10 +51,10 @@ export const OrderTypeSelectorContentUI = (props) => {
48
51
  onClick={() => handleClickOrderType(item.value)}
49
52
  active={orderStatus?.options?.type === item?.value}
50
53
  >
51
- <OrderTypeTitle>{item.text}</OrderTypeTitle>
52
- <OrderTypeDescription>{item.description}</OrderTypeDescription>
54
+ <OrderTypeTitle>{orderTypeTitle(item?.text?.replace(' ', '_')?.toLowerCase()) || item.text}</OrderTypeTitle>
55
+ <OrderTypeDescription>{orderTypeDescription(item?.text?.replace(' ', '_')?.toLowerCase()) || item.description}</OrderTypeDescription>
53
56
  <OrderStartWrapper>
54
- <span>{t('START_MY_ORDER', 'start my order')}</span>
57
+ <span>{orderTypeCallAction(item?.text?.replace(' ', '_')?.toLowerCase()) || t('START_MY_ORDER', 'start my order')}</span>
55
58
  <BsArrowRight />
56
59
  </OrderStartWrapper>
57
60
  <OrderTypeOverlay />
@@ -43,7 +43,7 @@ export const BannerContainer = styled.div`
43
43
  export const ImageWrapper = styled.div`
44
44
  cursor: pointer;
45
45
  width: 100%;
46
- padding-top: 260px;
46
+ padding-top: 18%;
47
47
  position: relative;
48
48
  .banner-img {
49
49
  position: absolute;
@@ -53,7 +53,4 @@ export const ImageWrapper = styled.div`
53
53
  height: 100%;
54
54
  object-fit: cover;
55
55
  }
56
- @media (min-width: 768px) {
57
- padding-top: 18%;
58
- }
59
56
  `