ordering-ui-external 1.1.6 → 1.2.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 (75) hide show
  1. package/_bundles/{0.ordering-ui.ff2158785c5abf7d9a26.js → 0.ordering-ui.5a3714c3be025beef39b.js} +0 -0
  2. package/_bundles/{1.ordering-ui.ff2158785c5abf7d9a26.js → 1.ordering-ui.5a3714c3be025beef39b.js} +0 -0
  3. package/_bundles/{3.ordering-ui.ff2158785c5abf7d9a26.js → 3.ordering-ui.5a3714c3be025beef39b.js} +0 -0
  4. package/_bundles/{4.ordering-ui.ff2158785c5abf7d9a26.js → 4.ordering-ui.5a3714c3be025beef39b.js} +0 -0
  5. package/_bundles/{5.ordering-ui.ff2158785c5abf7d9a26.js → 5.ordering-ui.5a3714c3be025beef39b.js} +0 -0
  6. package/_bundles/{6.ordering-ui.ff2158785c5abf7d9a26.js → 6.ordering-ui.5a3714c3be025beef39b.js} +0 -0
  7. package/_bundles/{7.ordering-ui.ff2158785c5abf7d9a26.js → 7.ordering-ui.5a3714c3be025beef39b.js} +1 -1
  8. package/_bundles/{7.ordering-ui.ff2158785c5abf7d9a26.js.LICENSE.txt → 7.ordering-ui.5a3714c3be025beef39b.js.LICENSE.txt} +0 -0
  9. package/_bundles/{8.ordering-ui.ff2158785c5abf7d9a26.js → 8.ordering-ui.5a3714c3be025beef39b.js} +0 -0
  10. package/_bundles/{9.ordering-ui.ff2158785c5abf7d9a26.js → 9.ordering-ui.5a3714c3be025beef39b.js} +0 -0
  11. package/_bundles/ordering-ui.5a3714c3be025beef39b.js +2 -0
  12. package/_bundles/{ordering-ui.ff2158785c5abf7d9a26.js.LICENSE.txt → ordering-ui.5a3714c3be025beef39b.js.LICENSE.txt} +0 -0
  13. package/_modules/themes/five/index.js +8 -0
  14. package/_modules/themes/five/src/components/BusinessBasicInformation/index.js +33 -1
  15. package/_modules/themes/five/src/components/BusinessBasicInformation/styles.js +3 -1
  16. package/_modules/themes/five/src/components/BusinessInformation/styles.js +2 -2
  17. package/_modules/themes/five/src/components/BusinessProductsCategories/index.js +27 -11
  18. package/_modules/themes/five/src/components/BusinessProductsCategories/styles.js +1 -1
  19. package/_modules/themes/five/src/components/BusinessProductsListing/index.js +5 -3
  20. package/_modules/themes/five/src/components/BusinessesListing/layouts/OriginalBusinessesListing/index.js +3 -7
  21. package/_modules/themes/five/src/components/Cart/index.js +14 -3
  22. package/_modules/themes/five/src/components/Cart/styles.js +9 -3
  23. package/_modules/themes/five/src/components/Checkout/index.js +1 -10
  24. package/_modules/themes/five/src/components/Checkout/styles.js +1 -1
  25. package/_modules/themes/five/src/components/Modal/styles.js +1 -1
  26. package/_modules/themes/five/src/components/MomentControl/styles.js +1 -1
  27. package/_modules/themes/five/src/components/MultiCheckout/index.js +4 -0
  28. package/_modules/themes/five/src/components/OrderItAgain/index.js +60 -0
  29. package/_modules/themes/five/src/components/OrderItAgain/styles.js +46 -0
  30. package/_modules/themes/five/src/components/ProductForm/index.js +5 -0
  31. package/_modules/themes/five/src/components/ProfessionalFilter/index.js +4 -2
  32. package/_modules/themes/five/src/components/ProfessionalFilter/styles.js +20 -8
  33. package/_modules/themes/five/src/components/RenderProductsLayout/index.js +20 -6
  34. package/_modules/themes/five/src/components/RenderProductsLayout/styles.js +29 -24
  35. package/_modules/themes/five/src/components/ReviewProduct/styles.js +6 -6
  36. package/_modules/themes/five/src/components/ServiceForm/index.js +5 -7
  37. package/_modules/themes/five/src/components/ServiceForm/styles.js +9 -5
  38. package/_modules/themes/five/src/components/SidebarMenu/index.js +13 -2
  39. package/_modules/themes/five/src/components/SingleOrderCard/index.js +1 -1
  40. package/_modules/themes/five/src/components/SingleProductCard/index.js +17 -9
  41. package/_modules/themes/five/src/components/SingleProductCard/styles.js +60 -48
  42. package/_modules/themes/four/src/components/BusinessBasicInformation/index.js +1 -1
  43. package/package.json +1 -1
  44. package/src/themes/five/index.js +2 -0
  45. package/src/themes/five/src/components/BusinessBasicInformation/index.js +29 -1
  46. package/src/themes/five/src/components/BusinessBasicInformation/styles.js +11 -0
  47. package/src/themes/five/src/components/BusinessInformation/styles.js +3 -3
  48. package/src/themes/five/src/components/BusinessProductsCategories/index.js +21 -11
  49. package/src/themes/five/src/components/BusinessProductsCategories/styles.js +3 -3
  50. package/src/themes/five/src/components/BusinessProductsListing/index.js +2 -2
  51. package/src/themes/five/src/components/BusinessesListing/layouts/OriginalBusinessesListing/index.js +2 -4
  52. package/src/themes/five/src/components/Cart/index.js +37 -2
  53. package/src/themes/five/src/components/Cart/styles.js +17 -0
  54. package/src/themes/five/src/components/Checkout/index.js +1 -5
  55. package/src/themes/five/src/components/Checkout/styles.js +5 -1
  56. package/src/themes/five/src/components/Modal/styles.js +5 -0
  57. package/src/themes/five/src/components/MomentControl/index.js +48 -48
  58. package/src/themes/five/src/components/MomentControl/styles.js +0 -1
  59. package/src/themes/five/src/components/MultiCheckout/index.js +2 -0
  60. package/src/themes/five/src/components/OrderItAgain/index.js +46 -0
  61. package/src/themes/five/src/components/OrderItAgain/styles.js +60 -0
  62. package/src/themes/five/src/components/ProductForm/index.js +1 -0
  63. package/src/themes/five/src/components/ProfessionalFilter/index.js +10 -2
  64. package/src/themes/five/src/components/ProfessionalFilter/styles.js +24 -9
  65. package/src/themes/five/src/components/RenderProductsLayout/index.js +20 -3
  66. package/src/themes/five/src/components/RenderProductsLayout/styles.js +12 -5
  67. package/src/themes/five/src/components/ReviewProduct/styles.js +14 -0
  68. package/src/themes/five/src/components/ServiceForm/index.js +31 -22
  69. package/src/themes/five/src/components/ServiceForm/styles.js +16 -0
  70. package/src/themes/five/src/components/SidebarMenu/index.js +32 -1
  71. package/src/themes/five/src/components/SingleOrderCard/index.js +1 -1
  72. package/src/themes/five/src/components/SingleProductCard/index.js +10 -6
  73. package/src/themes/five/src/components/SingleProductCard/styles.js +21 -7
  74. package/src/themes/four/src/components/BusinessBasicInformation/index.js +15 -17
  75. package/_bundles/ordering-ui.ff2158785c5abf7d9a26.js +0 -2
@@ -11,7 +11,7 @@ import BiStore from '@meronex/icons/bi/BiStore'
11
11
  import FaUserCircle from '@meronex/icons/fa/FaUserCircle'
12
12
  import BiHelpCircle from '@meronex/icons/bi/BiHelpCircle'
13
13
  import SiJsonwebtokens from '@meronex/icons/si/SiJsonwebtokens'
14
- import { Heart } from 'react-bootstrap-icons'
14
+ import { Heart, Tag } from 'react-bootstrap-icons'
15
15
 
16
16
  import { useEvent, useLanguage, useOrder, useSession, useConfig } from 'ordering-components-external'
17
17
  import { useTheme } from 'styled-components'
@@ -50,6 +50,7 @@ export const SidebarMenu = (props) => {
50
50
  const [modalPageToShow, setModalPageToShow] = useState(null)
51
51
 
52
52
  const isWalletEnabled = configs?.cash_wallet?.value && configs?.wallet_enabled?.value === '1' && (configs?.wallet_cash_enabled?.value === '1' || configs?.wallet_credit_point_enabled?.value === '1')
53
+ const isPromotionsEnabled = configs?.advanced_offers_module?.value === '1' || configs?.advanced_offers_module?.value === true
53
54
 
54
55
  const closeModal = () => {
55
56
  setModalIsOpen(false)
@@ -251,6 +252,36 @@ export const SidebarMenu = (props) => {
251
252
  </WrappContent>
252
253
  </MenuLink>
253
254
  )}
255
+ {isPromotionsEnabled && (
256
+ <MenuLink
257
+ onClick={() => handleGoToPage({ page: 'promotions' })}
258
+ >
259
+ <WrappContent>
260
+ <MenuLinkIcon
261
+ active={
262
+ window.location.pathname === '/promotions'
263
+ }
264
+ >
265
+ <Tag />
266
+ </MenuLinkIcon>
267
+ <MenuLinkText>
268
+ <TextInfo
269
+ active={
270
+ window.location.pathname === '/promotions'
271
+ }
272
+ >
273
+ {t('PROMOTIONS', 'Promotions')}
274
+ </TextInfo>
275
+ </MenuLinkText>
276
+ <MenuLinkSeparator>
277
+ <div>
278
+ <hr />
279
+ </div>
280
+ </MenuLinkSeparator>
281
+ </WrappContent>
282
+ </MenuLink>
283
+ )}
284
+
254
285
  <MenuLink
255
286
  onClick={() => handleGoToPage({ page: 'help' })}
256
287
  >
@@ -28,7 +28,7 @@ import {
28
28
  import {
29
29
  BusinessInformation
30
30
  } from '../OrdersOption/styles'
31
- import { useOrderingTheme } from 'ordering-components-external/_modules/contexts/OrderingThemeContext'
31
+ import { useOrderingTheme } from 'ordering-components/_modules/contexts/OrderingThemeContext'
32
32
 
33
33
  const SingleOrderCardUI = (props) => {
34
34
  const {
@@ -20,6 +20,7 @@ import {
20
20
  QuantityContainer,
21
21
  RibbonBox,
22
22
  TitleWrapper,
23
+ LastOrder,
23
24
  SkeletonCardInfo,
24
25
  SkeletonCardLogo
25
26
  } from './styles'
@@ -39,13 +40,14 @@ const SingleProductCardUI = (props) => {
39
40
  useKioskApp,
40
41
  productAddedToCartLength,
41
42
  handleFavoriteProduct,
42
- isFavorite
43
+ isFavorite,
44
+ isPreviously
43
45
  } = props
44
46
 
45
47
  const [, t] = useLanguage()
46
48
  const [$element, isObserved] = useIntersectionObserver()
47
49
  const [stateConfig] = useConfig()
48
- const [{ parsePrice, optimizeImage }] = useUtils()
50
+ const [{ parsePrice, optimizeImage, parseDate }] = useUtils()
49
51
  const [orderState] = useOrder()
50
52
  const [{ auth }, { login }] = useSession()
51
53
  const [orderingTheme] = useOrderingTheme()
@@ -67,7 +69,7 @@ const SingleProductCardUI = (props) => {
67
69
 
68
70
  const maxCartProductConfig = (stateConfig.configs.max_product_amount ? parseInt(stateConfig.configs.max_product_amount) : 100) - totalBalance
69
71
 
70
- const hideAddButton = orderingTheme?.theme?.business_view?.components?.products?.components?.add_to_cart_button?.hidden
72
+ const hideAddButton = theme?.business_view?.components?.products?.components?.add_to_cart_button?.hidden ?? true
71
73
  // const productsRows = theme?.layouts?.business_view?.components?.products?.components?.layout?.rows
72
74
 
73
75
  let maxCartProductInventory = (product?.inventoried ? product?.quantity : undefined) - totalBalance
@@ -127,6 +129,7 @@ const SingleProductCardUI = (props) => {
127
129
  isCartOnProductsList={isCartOnProductsList}
128
130
  style={useCustomFunctionality && customStyle}
129
131
  className='product-card'
132
+ isShowAddButt={!useCustomFunctionality && !hideAddButton && !isSkeleton}
130
133
  // productsRows={productsRows}
131
134
  >
132
135
  {isObservedValidation ? (
@@ -138,10 +141,10 @@ const SingleProductCardUI = (props) => {
138
141
  <span>{productAddedToCartLength}</span>
139
142
  </QuantityContainer>
140
143
  )}
141
- <CardInfo soldOut={isSoldOut || maxProductQuantity <= 0} isBgimage={optimizeImage(product?.images, 'h_86,c_limit')}>
144
+ <CardInfo soldOut={isSoldOut || maxProductQuantity <= 0} isBgimage={optimizeImage(product?.images, 'h_86,c_limit')} oneLine={isPreviously}>
142
145
  <TitleWrapper>
143
146
  {!isSkeleton ? (<h1>{product?.name}</h1>) : (<Skeleton width={100} />)}
144
- {!useKioskApp && (
147
+ {!useKioskApp && !isPreviously && (
145
148
  !isSkeleton ? (
146
149
  <span onClick={() => handleChangeFavorite()} ref={favoriteRef}>
147
150
  {product?.favorite ? <Like /> : <DisLike />}
@@ -160,6 +163,7 @@ const SingleProductCardUI = (props) => {
160
163
  <Skeleton width={100} />
161
164
  )}
162
165
  {!isSkeleton ? (<p>{product?.description}</p>) : (<Skeleton width={100} />)}
166
+ {isPreviously && (!isSkeleton ? (<LastOrder>{t('LAST_ORDERED_ON', 'Last ordered on')} {parseDate(product?.last_ordered_date, { outputFormat: 'MMM DD, YYYY' })}</LastOrder>) : (<Skeleton width={80} />))}
163
167
  </CardInfo>
164
168
  {!isSkeleton ? (
165
169
  <WrapLogo isBgimage={optimizeImage(product?.images, 'h_86,c_limit')}>
@@ -200,7 +204,7 @@ const SingleProductCardUI = (props) => {
200
204
  </SkeletonCardLogo>
201
205
  </div>
202
206
  )}
203
- {!useCustomFunctionality && typeof hideAddButton !== 'undefined' && !hideAddButton && !isSkeleton && (
207
+ {!useCustomFunctionality && !hideAddButton && !isSkeleton && (
204
208
  <Button outline color='primary'>
205
209
  {t('ADD', 'Add')}
206
210
  </Button>
@@ -2,8 +2,10 @@ import React from 'react'
2
2
  import styled, { css } from 'styled-components'
3
3
 
4
4
  export const CardContainer = styled.div`
5
- min-height: 162px;
6
- max-height: 162px;
5
+ ${({ isShowAddButt }) => css`
6
+ min-height: ${isShowAddButt ? '162px' : '110px'};
7
+ max-height: ${isShowAddButt ? '162px' : '110px'};
8
+ `}
7
9
  background: ${({ soldOut }) => soldOut ? '#6c757d33' : '#FFF'};
8
10
  border: 1px solid #E9ECEF;
9
11
  padding: 10px;
@@ -21,18 +23,18 @@ export const CardContainer = styled.div`
21
23
  margin-top: 10px;
22
24
  }
23
25
  ${({ productsRows }) => productsRows ? css`
24
- width: ${() => productsRows === 3 ? 'calc(33% - 40px)' : 'calc(50% - 40px)'};
26
+ width: ${() => productsRows === 3 ? 'calc(33% - 20px)' : 'calc(50% - 20px)'};
25
27
  margin: 10px;
26
28
  ` : css`
27
29
  width: 100%;
28
30
  margin: 10px 0px;
29
31
  @media (min-width: 576px) {
30
32
  margin: 10px;
31
- width: calc(100% - 40px);
33
+ width: calc(100% - 20px);
32
34
  }
33
35
  ${({ isCartOnProductsList }) => isCartOnProductsList ? css`
34
36
  @media (min-width: 993px) {
35
- width: calc(50% - 40px);
37
+ width: calc(50% - 20px);
36
38
  margin: 10px 20px 10px 0px;
37
39
  ${props => props.theme?.rtl && css`
38
40
  margin: 10px 0px 10px 20px;
@@ -40,10 +42,10 @@ export const CardContainer = styled.div`
40
42
  }
41
43
  ` : css`
42
44
  @media (min-width: 681px) {
43
- width: calc(49% - 40px);
45
+ width: calc(49% - 20px);
44
46
  }
45
47
  @media (min-width: 1440px) {
46
- width: calc(33% - 40px);
48
+ width: calc(33% - 20px);
47
49
  margin: 10px 20px 10px 0px;
48
50
  ${props => props.theme?.rtl && css`
49
51
  margin: 10px 0px 10px 20px;
@@ -103,6 +105,11 @@ export const CardInfo = styled.div`
103
105
  color: ${props => props.theme.colors.darkTextColor};
104
106
  font-size: 14px;
105
107
  }
108
+ ${({ oneLine }) => oneLine && css`
109
+ p {
110
+ -webkit-line-clamp: 1;
111
+ }
112
+ `}
106
113
  @media (min-width: 1024px) {
107
114
  p {
108
115
  font-size: 12px;
@@ -216,6 +223,13 @@ export const RibbonBox = styled.div`
216
223
  `}
217
224
  `
218
225
 
226
+ export const LastOrder = styled.span`
227
+ color: ${props => props.theme.colors.primary};
228
+ font-weight: 400;
229
+ font-size: 10px !important;
230
+ margin: 0px 3px;
231
+ `
232
+
219
233
  export const TitleWrapper = styled.div`
220
234
  display: flex;
221
235
  align-items: center;
@@ -159,23 +159,21 @@ export const BusinessBasicInformation = (props) => {
159
159
  </BusinessInfoItem>
160
160
  </BusinessInfo>
161
161
  </BusinessContent>
162
- {!errorQuantityProducts && (
163
- <WrapperSearch>
164
- <SearchBar
165
- onSearch={handleChangeSearch}
166
- search={searchValue}
167
- placeholder={t('SEARCH_PRODUCTS', theme?.defaultLanguages?.SEARCH_PRODUCTS || 'Search Products')}
168
- lazyLoad={businessState?.business?.lazy_load_products_recommended}
169
- />
170
- <Select
171
- notAsync
172
- notReload
173
- options={sortByOptions}
174
- defaultValue={sortByValue}
175
- onChange={(val) => handleChangeSortBy && handleChangeSortBy(val)}
176
- />
177
- </WrapperSearch>
178
- )}
162
+ <WrapperSearch>
163
+ <SearchBar
164
+ onSearch={handleChangeSearch}
165
+ search={searchValue}
166
+ placeholder={t('SEARCH_PRODUCTS', theme?.defaultLanguages?.SEARCH_PRODUCTS || 'Search Products')}
167
+ lazyLoad={businessState?.business?.lazy_load_products_recommended}
168
+ />
169
+ <Select
170
+ notAsync
171
+ notReload
172
+ options={sortByOptions}
173
+ defaultValue={sortByValue}
174
+ onChange={(val) => handleChangeSortBy && handleChangeSortBy(val)}
175
+ />
176
+ </WrapperSearch>
179
177
  </BusinessInnerContainer>
180
178
 
181
179
  <Modal