@lanaco/lnc-react-ui 4.0.160 → 4.0.162
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/dist/BlogCardsSponsoredSection.cjs +4 -2
- package/dist/BlogCardsSponsoredSection.js +4 -2
- package/dist/BlogListSection.cjs +1 -1
- package/dist/BlogListSection.js +1 -1
- package/dist/BlogsSectionDetailed.cjs +1 -1
- package/dist/BlogsSectionDetailed.js +1 -1
- package/dist/BlogsSectionSimple.cjs +1 -1
- package/dist/BlogsSectionSimple.js +1 -1
- package/dist/BlogsSectionWithFilters.cjs +1 -1
- package/dist/BlogsSectionWithFilters.js +2 -2
- package/dist/DetailedProductsInfinitiveSection.cjs +2 -0
- package/dist/DetailedProductsInfinitiveSection.js +2 -0
- package/dist/DetailedProductsSection.cjs +1 -1
- package/dist/DetailedProductsSection.js +2 -2
- package/dist/FieldOfInterestsMasonrySection.cjs +20 -12
- package/dist/FieldOfInterestsMasonrySection.js +35 -27
- package/dist/FieldOfInterestsWithTagsCardsSection.cjs +2 -0
- package/dist/FieldOfInterestsWithTagsCardsSection.js +5 -3
- package/dist/GiftCardsSection.cjs +1 -1
- package/dist/GiftCardsSection.js +1 -1
- package/dist/LocationSearchSection.cjs +1 -1
- package/dist/LocationSearchSection.js +1 -1
- package/dist/MasonryGeneralCardsSection.cjs +1 -3
- package/dist/MasonryGeneralCardsSection.js +9 -11
- package/dist/ProductsWithBannerSection.cjs +17 -24
- package/dist/ProductsWithBannerSection.js +60 -67
- package/dist/QuattroCardsSection.cjs +2 -0
- package/dist/QuattroCardsSection.js +2 -0
- package/dist/SalesCampaignsSection.cjs +35 -33
- package/dist/SalesCampaignsSection.js +272 -249
- package/dist/ShopCardsSection.cjs +3 -1
- package/dist/ShopCardsSection.js +2 -0
- package/dist/SimpleCategoriesSection.cjs +1 -1
- package/dist/SimpleCategoriesSection.js +1 -1
- package/dist/index-Be-_NM9Q.cjs +4 -0
- package/dist/index-BvQx3xAm.cjs +95 -0
- package/dist/index-C0LcDEqa.js +47 -0
- package/dist/index-dXWRbvgi.js +345 -0
- package/dist/{style-BLuyU97E.js → style-DKAOBWn3.js} +1 -0
- package/dist/{style-lSjkOR95.cjs → style-Db3VFbfP.cjs} +1 -0
- package/package.json +1 -1
- package/dist/index-D0xXo7W6.cjs +0 -98
- package/dist/index-Dweo-G3H.js +0 -384
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";const
|
|
1
|
+
"use strict";const n=require("react/jsx-runtime"),c=require("react"),p=require("./emotion-styled.browser.esm-BtEseadx.cjs"),w=require("./utils-Dl9xPH4c.cjs"),D=require("./consts-goSZX3xP.cjs"),ce=require("./motion-B_VPZaJq.cjs"),s=require("./index-BpbMKBf_.cjs"),de=require("./Icon.cjs"),te=require("./ShopAvatar-CV3lj34D.cjs"),je=require("./Badge.cjs"),J=require("./emotion-element-f0de968e.browser.esm-B7k6i6lC.cjs"),se=require("./IconButton.cjs"),ge=require("./useDetectMobile-zkbzoOGV.cjs"),$e=require("./index-Be-_NM9Q.cjs"),Te=p.styled.div`
|
|
2
2
|
cursor: pointer;
|
|
3
3
|
display: flex;
|
|
4
4
|
gap: 1rem;
|
|
@@ -6,13 +6,13 @@
|
|
|
6
6
|
border-radius: 1.25rem;
|
|
7
7
|
border: 1px solid var(--gray-200, #e4e9f0);
|
|
8
8
|
|
|
9
|
-
@media (max-width: ${
|
|
9
|
+
@media (max-width: ${D.MOBILE_SIZE_PX+"px"}) {
|
|
10
10
|
flex-direction: column;
|
|
11
11
|
padding: 1rem;
|
|
12
12
|
gap: 0;
|
|
13
13
|
}
|
|
14
|
-
`,
|
|
15
|
-
border-radius: ${e=>
|
|
14
|
+
`,Pe=p.styled.div`
|
|
15
|
+
border-radius: ${e=>w.getBorderRadiusValueWithUnits(e.theme,"edged")};
|
|
16
16
|
height: 13.75rem;
|
|
17
17
|
width: 13.75rem;
|
|
18
18
|
min-width: 13.75rem;
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
transform: scale(1.25);
|
|
35
35
|
}
|
|
36
36
|
}
|
|
37
|
-
|
|
37
|
+
`,Se=p.styled.div`
|
|
38
38
|
flex: 1;
|
|
39
39
|
display: flex;
|
|
40
40
|
flex-direction: column;
|
|
@@ -117,7 +117,7 @@
|
|
|
117
117
|
color: var(--gray-600, #676e79);
|
|
118
118
|
}
|
|
119
119
|
|
|
120
|
-
@media (max-width: ${
|
|
120
|
+
@media (max-width: ${D.MOBILE_SIZE_PX+"px"}) {
|
|
121
121
|
padding: 1rem 0 0 0;
|
|
122
122
|
|
|
123
123
|
& .campaign-title-text {
|
|
@@ -142,13 +142,13 @@
|
|
|
142
142
|
gap: 0.25rem;
|
|
143
143
|
}
|
|
144
144
|
}
|
|
145
|
-
`,ae=(e=!1,
|
|
145
|
+
`,ae=(e=!1,t=!1,a=!1)=>`
|
|
146
146
|
display: flex;
|
|
147
|
-
${
|
|
148
|
-
${
|
|
147
|
+
${t?"flex-wrap: wrap;":""}
|
|
148
|
+
${t?"":"flex-wrap: nowrap;"}
|
|
149
149
|
${e?"align-items: center;":""}
|
|
150
150
|
${a?"justify-content: center;":""}
|
|
151
|
-
`,
|
|
151
|
+
`,Ie=p.styled(ce.motion.div)`
|
|
152
152
|
text-decoration: none;
|
|
153
153
|
${e=>e.hasPermission===!0&&"cursor: pointer"};
|
|
154
154
|
|
|
@@ -172,7 +172,7 @@
|
|
|
172
172
|
font-weight: 500;
|
|
173
173
|
font-size: 1rem;
|
|
174
174
|
line-height: 1.5rem;
|
|
175
|
-
border-radius: ${e=>
|
|
175
|
+
border-radius: ${e=>w.getBorderRadiusValueWithUnits(e.theme,"slight")};
|
|
176
176
|
transition: all 0.25s ease;
|
|
177
177
|
& .description {
|
|
178
178
|
font-size: 0.85rem;
|
|
@@ -220,18 +220,18 @@
|
|
|
220
220
|
background-color: var(--gray-95080, #14161acc);
|
|
221
221
|
}
|
|
222
222
|
|
|
223
|
-
@media (max-width: ${
|
|
223
|
+
@media (max-width: ${D.MOBILE_SIZE_PX+"px"}) {
|
|
224
224
|
padding: 0;
|
|
225
225
|
font-size: 0.875rem;
|
|
226
226
|
}
|
|
227
|
-
`,
|
|
227
|
+
`,Ce=p.styled.div`
|
|
228
228
|
position: absolute;
|
|
229
229
|
top: 0.5rem;
|
|
230
230
|
${e=>e.alignToLeft===!0?"left: 0.5rem;":"right: 0.5rem;"}
|
|
231
231
|
display: flex;
|
|
232
232
|
gap: 0.25rem;
|
|
233
|
-
`,
|
|
234
|
-
border-radius: ${e=>
|
|
233
|
+
`,ke=p.styled.div`
|
|
234
|
+
border-radius: ${e=>w.getBorderRadiusValueWithUnits(e.theme,e.borderRadius||"slight")};
|
|
235
235
|
background-color: ${e=>e==null?void 0:e.color};
|
|
236
236
|
color: white;
|
|
237
237
|
height: 1.5rem;
|
|
@@ -246,7 +246,7 @@
|
|
|
246
246
|
& i {
|
|
247
247
|
font-size: 0.813rem;
|
|
248
248
|
}
|
|
249
|
-
`,
|
|
249
|
+
`,De=c.forwardRef(({src:e,...t},a)=>{const o=c.useRef();return c.useEffect(()=>{var m;const d=i=>{i.target.src=te.DefaultShopImage,i.onerror=null};return(m=o==null?void 0:o.current)==null||m.addEventListener("error",d),()=>{var i;(i=o==null?void 0:o.current)==null||i.removeEventListener("error",d)}},[]),n.jsx(c.Fragment,{ref:a,children:w.isDefinedNotEmptyString(e)?n.jsx("img",{ref:o,src:e,...t}):n.jsx("img",{src:te.DefaultShopImage,...t})})}),pe=e=>{const{uuid:t,hasPermission:a=!0,isUser:o,image:d,imageComponent:m,name:i,notifications:h=0,color:l="primary",size:b="large",style:u,disabled:P,onClick:f=()=>{},isActive:v,className:S,shopCategory:I,themeData:j}=e,x={theme:J.useTheme(),color:l,size:b,style:u,disabled:P};return c.createElement(Ie,{onClick:$=>{$.stopPropagation(),a===!0&&(f==null||f())},...x,key:i,className:`profile-item ${S}`,hasPermission:a,isActive:v,themeColor:(j==null?void 0:j.code)||"transparent"},n.jsx("div",{className:"logo-wrapper",children:w.isDefined(m)?m:d}),n.jsxs("div",{children:[n.jsx("div",{className:"name",children:i}),!o&&n.jsx("div",{className:"description",children:I}),h>0&&n.jsx("div",{className:"notifications-number",children:n.jsx(je,{className:"badge",color:"danger",size:"small",children:h>99?"99+":h})})]}))};pe.propTypes={id:s.PropTypes.any,isUserProfile:s.PropTypes.bool,themeColor:s.PropTypes.string,image:s.PropTypes.any,name:s.PropTypes.string,notifications:s.PropTypes.number,style:s.PropTypes.object,className:s.PropTypes.string,color:s.PropTypes.oneOf(["primary","secondary","success","warning","danger","information","neutral"]),size:s.PropTypes.oneOf(["large"]),onSelect:s.PropTypes.func,hasPermission:s.PropTypes.bool};const oe=(e,t)=>{if(!e||!t)return null;const a=e.getTime()-t.getTime(),o=24*60*60*1e3;return Math.floor(a/o)},ie=e=>{if(e!==void 0){const t=new Date(e),a=t.getFullYear(),o=t.getMonth()+1;return`${String(t.getDate()).padStart(2)}. ${o}. ${a}.`}},me=c.forwardRef((e,t)=>{var ne;const a=J.useTheme(),{shopUuid:o,title:d="",coverPhoto:m,onSelect:i,startDate:h,endDate:l,salesPackages:b,shopName:u,shopCategory:P,shopImage:f,shopImageComponent:v,className:S,onSelectCard:I=()=>{},onSelectShop:j=()=>{},upcoming:g=!1,upcomingCampaignText:x,campaignSingleText:$,salesCampaignTypes:T=[],startsInPrefixTextPlural:q,startsinSuffixTextPlural:W,startsInPrefixTextSingular:V,startsinSuffixTextSingular:K,endsInPrefixTextPlural:F,endsinSuffixTextPlural:X,endsInPrefixTextSingular:E,endsinSuffixTextSingular:Z,themeData:Q,numberOfListings:C,numberOfListingsTextSingular:A,numberOfListingsTextPlural:M,metadata:r,...G}=e,H=c.useRef(),z=h?new Date(h)<=new Date:!1,fe=oe(h?new Date(h):null,new Date),R=oe(l?new Date(l):null,new Date),xe=R!==null&&R<=2&&R>0,ee=l?new Date(l).getTime():null,ye=Date.now(),Y=ee!==null?ee-ye:null,L=Y!==null&&Y>0&&Y<24*60*60*1e3,re=(_,U,y,N,k)=>y===1?`${_} ${y} ${N}`:`${U} ${y} ${k}`,we=()=>{if(!l)return null;const _=be,y=new Date(l).getTime()-_.getTime();if(y<=0)return null;const N=Math.floor(y/(1e3*60*60)),k=Math.floor(y%(1e3*60*60)/(1e3*60)),_e=Math.floor(y%(1e3*60)/1e3);return{hours:N,minutes:k,seconds:_e}},[be,ve]=c.useState(new Date);c.useEffect(()=>{if(!L)return;const _=setInterval(()=>{ve(new Date)},1e3);return()=>clearInterval(_)},[L]);const O=L?we():null;return n.jsxs(Te,{ref:H,theme:a,className:S,name:r==null?void 0:r.name,"data-accessor":r==null?void 0:r.accessor,onClick:_=>I(_,H),...G,children:[n.jsxs(Pe,{theme:a,onClick:()=>i==null?void 0:i(),children:[n.jsx("img",{src:m}),n.jsx(Ce,{children:b==null?void 0:b.map((_,U)=>{var y,N;return n.jsx(ke,{color:(y=T==null?void 0:T.find(k=>k.value===_))==null?void 0:y.color,theme:a,children:n.jsx(de,{icon:(N=T==null?void 0:T.find(k=>k.value===_))==null?void 0:N.icon})},`package__${U}`)})})]}),n.jsxs(Se,{theme:a,children:[n.jsx("div",{className:"text-block-wrapper",children:n.jsxs("div",{className:"title-block-wrapper",children:[n.jsx("div",{className:"campaign-title",children:(ne=g?x:$)==null?void 0:ne.toUpperCase()}),n.jsx("div",{className:"campaign-title-text",children:d}),l&&h&&n.jsxs("div",{className:"campaign-date",children:[ie(h)," - ",ie(l)]}),n.jsxs("div",{className:"timestamp-text",children:[C>0&&n.jsxs("span",{className:"listings-text",children:[C," ",C===1?A:M," ","∙"," "]}),n.jsx("span",{className:`duration-text ${xe?"urgent":""} ${z?"":"starts-in"}`,children:L&&O?n.jsxs("div",{className:"countdown-timer",children:[E," ",O.hours.toString().padStart(2,"0"),":",O.minutes.toString().padStart(2,"0"),":",O.seconds.toString().padStart(2,"0")]}):z?re(E,F,R,Z,X):re(V,q,fe,K,W)})]})]})}),n.jsx(pe,{hasPermission:!0,image:n.jsx(De,{src:f}),imageComponent:v,themeData:Q,isActive:!0,isUser:!1,name:u,shopCategory:P,onClick:()=>j(o)})]})]})});me.propTypes={title:s.PropTypes.oneOfType([s.PropTypes.string,s.PropTypes.element]),numberOfListings:s.PropTypes.number,dropdown:s.PropTypes.any,color:s.PropTypes.string};p.styled.div`
|
|
250
250
|
display: flex;
|
|
251
251
|
flex-direction: column;
|
|
252
252
|
gap: 1.5rem;
|
|
@@ -277,26 +277,26 @@
|
|
|
277
277
|
}
|
|
278
278
|
}
|
|
279
279
|
|
|
280
|
-
@media (max-width: ${
|
|
280
|
+
@media (max-width: ${D.MOBILE_SIZE_PX+"px"}) {
|
|
281
281
|
& .campaign-item {
|
|
282
282
|
min-width: 100%;
|
|
283
283
|
width: 100%;
|
|
284
284
|
margin-right: 0;
|
|
285
285
|
}
|
|
286
286
|
}
|
|
287
|
-
`;const
|
|
287
|
+
`;const B=p.styled.div`
|
|
288
288
|
width: ${e=>e.width||"100%"};
|
|
289
289
|
height: ${e=>(e.heightCoeff||1)*1.125}rem;
|
|
290
290
|
background-color: var(--gray-200, #dddfe4);
|
|
291
291
|
|
|
292
|
-
${
|
|
293
|
-
`,Ne=
|
|
292
|
+
${w.linearGradientAnimation("-90deg")}
|
|
293
|
+
`,Ne=p.styled.div`
|
|
294
294
|
display: flex;
|
|
295
295
|
flex-direction: ${e=>e!=null&&e.row?"row":"column"};
|
|
296
296
|
gap: ${e=>(e==null?void 0:e.gap)??"0.5rem"};
|
|
297
297
|
width: ${e=>(e==null?void 0:e.width)??"100%"};
|
|
298
|
-
`,le=
|
|
299
|
-
border-radius: ${e=>
|
|
298
|
+
`,le=p.styled.div`
|
|
299
|
+
border-radius: ${e=>w.getBorderRadiusValueWithUnits(e.theme,(e==null?void 0:e.borderRadius)??"regular")};
|
|
300
300
|
background: var(--gray-200, #dddfe4);
|
|
301
301
|
position: relative;
|
|
302
302
|
max-height: ${e=>(e==null?void 0:e.height)??"5rem"};
|
|
@@ -305,10 +305,10 @@
|
|
|
305
305
|
width: ${e=>(e==null?void 0:e.width)??"5rem"};
|
|
306
306
|
flex-shrink: 0;
|
|
307
307
|
|
|
308
|
-
${
|
|
309
|
-
`,
|
|
308
|
+
${w.linearGradientAnimation()}
|
|
309
|
+
`,Ee=p.styled.div`
|
|
310
310
|
background: var(--white, #fff);
|
|
311
|
-
border-radius: ${e=>
|
|
311
|
+
border-radius: ${e=>w.getBorderRadiusValueWithUnits(e.theme,"edged")};
|
|
312
312
|
box-shadow: 0px 1px 3px rgba(0, 0, 0, 0.1), 0px 1px 2px rgba(0, 0, 0, 0.06);
|
|
313
313
|
border: 1px solid var(--gray-95012, #14161a1f);
|
|
314
314
|
|
|
@@ -335,17 +335,17 @@
|
|
|
335
335
|
gap: 0.5rem;
|
|
336
336
|
}
|
|
337
337
|
|
|
338
|
-
@media (max-width: ${
|
|
338
|
+
@media (max-width: ${D.MOBILE_SIZE_PX+"px"}) {
|
|
339
339
|
flex-direction: column;
|
|
340
340
|
|
|
341
341
|
& .campaign__user {
|
|
342
342
|
margin-top: 1rem;
|
|
343
343
|
}
|
|
344
344
|
}
|
|
345
|
-
`,
|
|
345
|
+
`,Me=p.styled.div`
|
|
346
346
|
display: flex;
|
|
347
347
|
gap: 1.5rem;
|
|
348
|
-
`,
|
|
348
|
+
`,ze=c.forwardRef(({},e)=>{const t=J.useTheme();return n.jsxs(Ee,{ref:e,theme:t,children:[n.jsx("div",{className:"campaign__left-section",children:n.jsx(le,{theme:t,width:"15rem",height:"15rem",borderRadius:"edged"})}),n.jsxs("div",{className:"campaign__right-section",children:[n.jsxs(Ne,{theme:t,children:[n.jsx(B,{heightCoeff:.75,theme:t,width:"35%"}),n.jsx(B,{heightCoeff:1.25,theme:t}),n.jsx(B,{heightCoeff:3,theme:t})]}),n.jsxs("div",{className:"campaign__user",children:[n.jsx(le,{theme:t,width:"2.5rem",height:"2.5rem",borderRadius:"curved"}),n.jsx(B,{theme:t,width:"75%"})]})]})]})}),Re=({itemsCount:e=5,keyPrefix:t})=>n.jsx(Me,{children:Array.from({length:e},(a,o)=>n.jsx(ze,{},`${t}-skeleton-campaign-card-${o}`))}),Le=({children:e,fallbackComponent:t=n.jsx(n.Fragment,{}),isLoading:a=!1,itemsCount:o=5,keyPrefix:d})=>n.jsx(c.Suspense,{fallback:t,children:a===!0?n.jsx(Re,{itemsCount:o,keyPrefix:d}):e}),Oe=p.styled.div`
|
|
349
349
|
margin: 0 auto;
|
|
350
350
|
display: flex;
|
|
351
351
|
flex-direction: column;
|
|
@@ -384,7 +384,9 @@
|
|
|
384
384
|
right: 0;
|
|
385
385
|
}
|
|
386
386
|
|
|
387
|
-
@media (max-width: ${
|
|
387
|
+
@media (max-width: ${D.MOBILE_SIZE_PX+"px"}) {
|
|
388
|
+
gap: 1.25rem;
|
|
389
|
+
|
|
388
390
|
& .scrollable-section__header {
|
|
389
391
|
& .scrollable-section__title {
|
|
390
392
|
& .title__text {
|
|
@@ -394,13 +396,13 @@
|
|
|
394
396
|
}
|
|
395
397
|
}
|
|
396
398
|
}
|
|
397
|
-
`,
|
|
399
|
+
`,Ue=p.styled(ce.motion.div)`
|
|
398
400
|
display: grid;
|
|
399
401
|
grid-template-columns: repeat(${e=>e==null?void 0:e.numOfColumns}, 1fr);
|
|
400
402
|
gap: 1.5rem;
|
|
401
403
|
width: 100%;
|
|
402
404
|
|
|
403
|
-
@media (max-width: ${
|
|
405
|
+
@media (max-width: ${D.MOBILE_SIZE_PX+"px"}) {
|
|
404
406
|
display: flex;
|
|
405
407
|
flex-wrap: nowrap;
|
|
406
408
|
overflow-x: scroll;
|
|
@@ -422,7 +424,7 @@
|
|
|
422
424
|
/* Safari and Chrome */
|
|
423
425
|
}
|
|
424
426
|
}
|
|
425
|
-
`,he=c.forwardRef(({icon:e,title:
|
|
427
|
+
`,he=c.forwardRef(({icon:e,title:t,numOfSlides:a=2,showNavigation:o=!0,hasNextPage:d=!1,handleFetchNextPage:m=()=>{},children:i},h)=>{const[l,b]=c.useState(0),[u,P]=c.useState(1),f=ge.useDetectMobile(),v=(i==null?void 0:i.length)??1;c.useEffect(()=>{const g=()=>{P(a)};return window.addEventListener("resize",g),g(),()=>window.removeEventListener("resize",g)},[]);const S=f?i:i==null?void 0:i.slice(l,l+u),I=g=>{var $;($=g==null?void 0:g.target)==null||$.blur();const x=l+u;x<v&&b(x),x+u>=v&&d&&m()},j=g=>{var x;(x=g==null?void 0:g.target)==null||x.blur(),l-u>=0&&b(l-u)};return n.jsxs(Oe,{ref:h,children:[n.jsx("div",{className:"scrollable-section__header",children:n.jsxs("div",{className:"scrollable-section__title",children:[w.isDefinedNotEmptyString(e)&&n.jsx(de,{icon:e,color:"primary",sizeInUnits:"1.5rem",className:"title__icon"}),w.isDefinedNotEmptyString(t)&&n.jsxs("div",{className:"title__text",children:[" ",t]})]})}),n.jsxs(Ue,{numOfColumns:a,...!f&&{animate:{x:0,opacity:1},initial:{x:10,opacity:0}},children:[S,f&&d&&n.jsx($e.InfiniteScrollEndElement,{onIsVisible:m})]},`scrollable-section__content-${l}`),o&&v>u&&!f&&n.jsxs("div",{className:"scrollable-section__navigation",children:[n.jsx(se,{icon:"angle-left",borderRadius:"curved",btnType:"tinted",color:"neutral",className:"navigation__arrow",disabled:l===0,onClick:j}),n.jsx(se,{icon:"angle-right",borderRadius:"curved",btnType:"tinted",color:"neutral",className:"navigation__arrow",disabled:l+u>=v,onClick:I})]})]})});he.propTypes={icon:s.PropTypes.string,title:s.PropTypes.string,numOfSlides:s.PropTypes.number,numOfSlidesForMobile:s.PropTypes.number,handleFetchNextPage:s.PropTypes.func,showNavigation:s.PropTypes.bool};const Be=p.styled.div`
|
|
426
428
|
display: flex;
|
|
427
429
|
flex: 1;
|
|
428
430
|
width: 100%;
|
|
@@ -439,4 +441,4 @@
|
|
|
439
441
|
border-radius: 1.25rem;
|
|
440
442
|
object-fit: cover;
|
|
441
443
|
}
|
|
442
|
-
`,ue=c.forwardRef(({sectionName:e,imageUrl:
|
|
444
|
+
`,ue=c.forwardRef(({sectionName:e,imageUrl:t,maxHeight:a="16.25rem",className:o="",handleClick:d=()=>{}},m)=>n.jsx(Be,{ref:m,maxHeight:a,onClick:d,className:`itemless-banner ${o}`,children:n.jsx("img",{src:t,alt:`itemless-banner__${e}`})}));ue.propTypes={sectionName:s.PropTypes.string,imageUrl:s.PropTypes.string,maxHeight:s.PropTypes.string,className:s.PropTypes.string,handleClick:s.PropTypes.func};const qe=c.memo(me),We=c.forwardRef(({sellerType:e="Shop",items:t=[],title:a,icon:o,isLoading:d,onSelectCard:m=()=>{},onSelectShop:i=()=>{},getImage:h=()=>{},campaignSingleText:l,upcomingCampaignText:b,salesCampaignTypes:u=[],startsInPrefixTextPlural:P,startsinSuffixTextPlural:f,startsInPrefixTextSingular:v,startsinSuffixTextSingular:S,endsInPrefixTextPlural:I,endsinSuffixTextPlural:j,endsInPrefixTextSingular:g,endsinSuffixTextSingular:x,numOfSlides:$=2,showNavigation:T=!0,numberOfListingsTextSingular:q,numberOfListingsTextPlural:W,itemlessImageUrl:V,itemlessLink:K,handleItemlessLink:F=()=>{},componentName:X,hasNextPage:E=!1,handleFetchNextPage:Z=()=>{}},Q)=>{const C=ge.useDetectMobile(),A=c.useMemo(()=>{let M=t==null?void 0:t.map((r,G)=>n.jsx(qe,{className:"campaign-item",coverPhoto:h(r==null?void 0:r.coverPhoto,(r==null?void 0:r.uuid)||(r==null?void 0:r.campaignUuid)),description:r==null?void 0:r.description,endDate:r==null?void 0:r.endDate,salesPackages:r==null?void 0:r.salesPackages,sellerType:e,shopImage:r==null?void 0:r.profileImage,shopImageComponent:r==null?void 0:r.profileImageComponent,shopName:r==null?void 0:r.shopName,shopUuid:r==null?void 0:r.shopUuid,shopCategory:r==null?void 0:r.shopCategory,startDate:r==null?void 0:r.startDate,title:r==null?void 0:r.name,uuid:r==null?void 0:r.campaignUuid,onSelectCard:(H,z)=>m(r==null?void 0:r.campaignUuid,r==null?void 0:r.shopUuid,z),onSelectShop:()=>i(r==null?void 0:r.shopUuid),campaignSingleText:l,upcomingCampaignText:b,upcoming:r==null?void 0:r.upcoming,salesCampaignTypes:u,startsInPrefixTextPlural:P,startsinSuffixTextPlural:f,startsInPrefixTextSingular:v,startsinSuffixTextSingular:S,endsInPrefixTextPlural:I,endsinSuffixTextPlural:j,endsInPrefixTextSingular:g,endsinSuffixTextSingular:x,themeData:r==null?void 0:r.themeData,numberOfListings:r==null?void 0:r.numberOfListings,numberOfListingsTextSingular:q,numberOfListingsTextPlural:W,metadata:{name:X,accessor:r==null?void 0:r.accessor}},`campaign__item__${G}__${r==null?void 0:r.startDate}___${r==null?void 0:r.endDate}`));return(t==null?void 0:t.length)<2&&!C?[...M,n.jsx(ue,{imageUrl:V,className:"campaign-item",handleClick:F},"itemless-campaign-section-banner")]:M},[t]);return n.jsx(Le,{isLoading:d,itemsCount:C?1:2,keyPrefix:"sales-camp",children:n.jsx(he,{icon:o,title:a,numOfSlides:$,showNavigation:T,hasNextPage:E,handleFetchNextPage:Z,children:A},`sales-campaign-section__${C}`)})});module.exports=We;
|