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.
- package/_bundles/{0.ordering-ui.ff2158785c5abf7d9a26.js → 0.ordering-ui.5a3714c3be025beef39b.js} +0 -0
- package/_bundles/{1.ordering-ui.ff2158785c5abf7d9a26.js → 1.ordering-ui.5a3714c3be025beef39b.js} +0 -0
- package/_bundles/{3.ordering-ui.ff2158785c5abf7d9a26.js → 3.ordering-ui.5a3714c3be025beef39b.js} +0 -0
- package/_bundles/{4.ordering-ui.ff2158785c5abf7d9a26.js → 4.ordering-ui.5a3714c3be025beef39b.js} +0 -0
- package/_bundles/{5.ordering-ui.ff2158785c5abf7d9a26.js → 5.ordering-ui.5a3714c3be025beef39b.js} +0 -0
- package/_bundles/{6.ordering-ui.ff2158785c5abf7d9a26.js → 6.ordering-ui.5a3714c3be025beef39b.js} +0 -0
- package/_bundles/{7.ordering-ui.ff2158785c5abf7d9a26.js → 7.ordering-ui.5a3714c3be025beef39b.js} +1 -1
- package/_bundles/{7.ordering-ui.ff2158785c5abf7d9a26.js.LICENSE.txt → 7.ordering-ui.5a3714c3be025beef39b.js.LICENSE.txt} +0 -0
- package/_bundles/{8.ordering-ui.ff2158785c5abf7d9a26.js → 8.ordering-ui.5a3714c3be025beef39b.js} +0 -0
- package/_bundles/{9.ordering-ui.ff2158785c5abf7d9a26.js → 9.ordering-ui.5a3714c3be025beef39b.js} +0 -0
- package/_bundles/ordering-ui.5a3714c3be025beef39b.js +2 -0
- package/_bundles/{ordering-ui.ff2158785c5abf7d9a26.js.LICENSE.txt → ordering-ui.5a3714c3be025beef39b.js.LICENSE.txt} +0 -0
- package/_modules/themes/five/index.js +8 -0
- package/_modules/themes/five/src/components/BusinessBasicInformation/index.js +33 -1
- package/_modules/themes/five/src/components/BusinessBasicInformation/styles.js +3 -1
- package/_modules/themes/five/src/components/BusinessInformation/styles.js +2 -2
- package/_modules/themes/five/src/components/BusinessProductsCategories/index.js +27 -11
- package/_modules/themes/five/src/components/BusinessProductsCategories/styles.js +1 -1
- package/_modules/themes/five/src/components/BusinessProductsListing/index.js +5 -3
- package/_modules/themes/five/src/components/BusinessesListing/layouts/OriginalBusinessesListing/index.js +3 -7
- package/_modules/themes/five/src/components/Cart/index.js +14 -3
- package/_modules/themes/five/src/components/Cart/styles.js +9 -3
- package/_modules/themes/five/src/components/Checkout/index.js +1 -10
- package/_modules/themes/five/src/components/Checkout/styles.js +1 -1
- package/_modules/themes/five/src/components/Modal/styles.js +1 -1
- package/_modules/themes/five/src/components/MomentControl/styles.js +1 -1
- package/_modules/themes/five/src/components/MultiCheckout/index.js +4 -0
- package/_modules/themes/five/src/components/OrderItAgain/index.js +60 -0
- package/_modules/themes/five/src/components/OrderItAgain/styles.js +46 -0
- package/_modules/themes/five/src/components/ProductForm/index.js +5 -0
- package/_modules/themes/five/src/components/ProfessionalFilter/index.js +4 -2
- package/_modules/themes/five/src/components/ProfessionalFilter/styles.js +20 -8
- package/_modules/themes/five/src/components/RenderProductsLayout/index.js +20 -6
- package/_modules/themes/five/src/components/RenderProductsLayout/styles.js +29 -24
- package/_modules/themes/five/src/components/ReviewProduct/styles.js +6 -6
- package/_modules/themes/five/src/components/ServiceForm/index.js +5 -7
- package/_modules/themes/five/src/components/ServiceForm/styles.js +9 -5
- package/_modules/themes/five/src/components/SidebarMenu/index.js +13 -2
- package/_modules/themes/five/src/components/SingleOrderCard/index.js +1 -1
- package/_modules/themes/five/src/components/SingleProductCard/index.js +17 -9
- package/_modules/themes/five/src/components/SingleProductCard/styles.js +60 -48
- package/_modules/themes/four/src/components/BusinessBasicInformation/index.js +1 -1
- package/package.json +1 -1
- package/src/themes/five/index.js +2 -0
- package/src/themes/five/src/components/BusinessBasicInformation/index.js +29 -1
- package/src/themes/five/src/components/BusinessBasicInformation/styles.js +11 -0
- package/src/themes/five/src/components/BusinessInformation/styles.js +3 -3
- package/src/themes/five/src/components/BusinessProductsCategories/index.js +21 -11
- package/src/themes/five/src/components/BusinessProductsCategories/styles.js +3 -3
- package/src/themes/five/src/components/BusinessProductsListing/index.js +2 -2
- package/src/themes/five/src/components/BusinessesListing/layouts/OriginalBusinessesListing/index.js +2 -4
- package/src/themes/five/src/components/Cart/index.js +37 -2
- package/src/themes/five/src/components/Cart/styles.js +17 -0
- package/src/themes/five/src/components/Checkout/index.js +1 -5
- package/src/themes/five/src/components/Checkout/styles.js +5 -1
- package/src/themes/five/src/components/Modal/styles.js +5 -0
- package/src/themes/five/src/components/MomentControl/index.js +48 -48
- package/src/themes/five/src/components/MomentControl/styles.js +0 -1
- package/src/themes/five/src/components/MultiCheckout/index.js +2 -0
- package/src/themes/five/src/components/OrderItAgain/index.js +46 -0
- package/src/themes/five/src/components/OrderItAgain/styles.js +60 -0
- package/src/themes/five/src/components/ProductForm/index.js +1 -0
- package/src/themes/five/src/components/ProfessionalFilter/index.js +10 -2
- package/src/themes/five/src/components/ProfessionalFilter/styles.js +24 -9
- package/src/themes/five/src/components/RenderProductsLayout/index.js +20 -3
- package/src/themes/five/src/components/RenderProductsLayout/styles.js +12 -5
- package/src/themes/five/src/components/ReviewProduct/styles.js +14 -0
- package/src/themes/five/src/components/ServiceForm/index.js +31 -22
- package/src/themes/five/src/components/ServiceForm/styles.js +16 -0
- package/src/themes/five/src/components/SidebarMenu/index.js +32 -1
- package/src/themes/five/src/components/SingleOrderCard/index.js +1 -1
- package/src/themes/five/src/components/SingleProductCard/index.js +10 -6
- package/src/themes/five/src/components/SingleProductCard/styles.js +21 -7
- package/src/themes/four/src/components/BusinessBasicInformation/index.js +15 -17
- 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
|
|
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 =
|
|
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 &&
|
|
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
|
-
|
|
6
|
-
|
|
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% -
|
|
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% -
|
|
33
|
+
width: calc(100% - 20px);
|
|
32
34
|
}
|
|
33
35
|
${({ isCartOnProductsList }) => isCartOnProductsList ? css`
|
|
34
36
|
@media (min-width: 993px) {
|
|
35
|
-
width: calc(50% -
|
|
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% -
|
|
45
|
+
width: calc(49% - 20px);
|
|
44
46
|
}
|
|
45
47
|
@media (min-width: 1440px) {
|
|
46
|
-
width: calc(33% -
|
|
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
|
-
|
|
163
|
-
<
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
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
|