@lanaco/lnc-react-ui 4.0.142 → 4.0.144
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/Button.cjs +5 -5
- package/dist/Button.js +31 -31
- package/dist/DetailedProductsSection.cjs +2 -2
- package/dist/DetailedProductsSection.js +11 -11
- package/dist/IconButton.cjs +6 -6
- package/dist/IconButton.js +27 -27
- package/dist/SalesCampaignsSection.cjs +102 -51
- package/dist/SalesCampaignsSection.js +430 -403
- package/dist/UrgentSaleProductsSection.cjs +1 -1
- package/dist/UrgentSaleProductsSection.js +1 -1
- package/dist/{suspense-product-card-detailed-BA06QK8a.cjs → suspense-product-card-detailed-B7gioG73.cjs} +1 -1
- package/dist/{suspense-product-card-detailed-CUd-EI3U.js → suspense-product-card-detailed-FUKF_Pyc.js} +1 -1
- package/package.json +1 -1
|
@@ -1,20 +1,18 @@
|
|
|
1
|
-
"use strict";const t=require("react/jsx-runtime"),
|
|
1
|
+
"use strict";const t=require("react/jsx-runtime"),d=require("react"),p=require("./emotion-styled.browser.esm-BtEseadx.cjs"),x=require("./utils-Dl9xPH4c.cjs"),S=require("./consts-goSZX3xP.cjs"),se=require("./motion-B_VPZaJq.cjs"),a=require("./index-BpbMKBf_.cjs"),oe=require("./Icon.cjs"),Q=require("./ShopAvatar-CV3lj34D.cjs"),ve=require("./Badge.cjs"),F=require("./emotion-element-f0de968e.browser.esm-B7k6i6lC.cjs"),ee=require("./IconButton.cjs"),ie=require("./useDetectMobile-zkbzoOGV.cjs"),_e=p.styled.div`
|
|
2
2
|
cursor: pointer;
|
|
3
3
|
display: flex;
|
|
4
4
|
gap: 1rem;
|
|
5
5
|
padding: 1.25rem;
|
|
6
|
-
border-radius:
|
|
7
|
-
border: 1px solid var(--gray-
|
|
6
|
+
border-radius: 1.25rem;
|
|
7
|
+
border: 1px solid var(--gray-200, #e4e9f0);
|
|
8
8
|
|
|
9
|
-
@media (max-width: ${
|
|
9
|
+
@media (max-width: ${S.MOBILE_SIZE_PX+"px"}) {
|
|
10
10
|
flex-direction: column;
|
|
11
|
-
padding:
|
|
11
|
+
padding: 1rem;
|
|
12
12
|
gap: 0;
|
|
13
|
-
border: none;
|
|
14
|
-
border-radius: 0;
|
|
15
13
|
}
|
|
16
|
-
`,
|
|
17
|
-
border-radius: ${e=>
|
|
14
|
+
`,je=p.styled.div`
|
|
15
|
+
border-radius: ${e=>x.getBorderRadiusValueWithUnits(e.theme,"edged")};
|
|
18
16
|
height: 13.75rem;
|
|
19
17
|
width: 13.75rem;
|
|
20
18
|
min-width: 13.75rem;
|
|
@@ -37,12 +35,11 @@
|
|
|
37
35
|
}
|
|
38
36
|
}
|
|
39
37
|
|
|
40
|
-
@media (max-width: ${
|
|
38
|
+
@media (max-width: ${S.MOBILE_SIZE_PX+"px"}) {
|
|
41
39
|
width: 100%;
|
|
42
|
-
|
|
43
|
-
height: 23.438rem;
|
|
40
|
+
height: 100%;
|
|
44
41
|
}
|
|
45
|
-
`,
|
|
42
|
+
`,Se=p.styled.div`
|
|
46
43
|
flex: 1;
|
|
47
44
|
display: flex;
|
|
48
45
|
flex-direction: column;
|
|
@@ -55,6 +52,7 @@
|
|
|
55
52
|
& .campaign-title {
|
|
56
53
|
font-weight: 500;
|
|
57
54
|
font-size: 0.75rem;
|
|
55
|
+
line-height: 1rem;
|
|
58
56
|
letter-spacing: 0.1rem;
|
|
59
57
|
color: var(--teal-500, #009ea8);
|
|
60
58
|
}
|
|
@@ -62,7 +60,8 @@
|
|
|
62
60
|
& .campaign-title-text {
|
|
63
61
|
font-weight: 600;
|
|
64
62
|
font-size: 1.375rem;
|
|
65
|
-
|
|
63
|
+
leading-trim: none;
|
|
64
|
+
line-height: 1.75rem;
|
|
66
65
|
}
|
|
67
66
|
|
|
68
67
|
& .text-block-wrapper {
|
|
@@ -75,6 +74,7 @@
|
|
|
75
74
|
display: flex;
|
|
76
75
|
flex-direction: column;
|
|
77
76
|
gap: 0.1875rem;
|
|
77
|
+
padding-top: 0.5rem;
|
|
78
78
|
}
|
|
79
79
|
|
|
80
80
|
& .timestamp-text {
|
|
@@ -114,11 +114,30 @@
|
|
|
114
114
|
background-color: transparent;
|
|
115
115
|
}
|
|
116
116
|
|
|
117
|
-
|
|
118
|
-
|
|
117
|
+
& .campaign-date {
|
|
118
|
+
font-weight: 400;
|
|
119
|
+
font-size: 0.875rem;
|
|
120
|
+
leading-trim: none;
|
|
121
|
+
line-height: 1.25rem;
|
|
122
|
+
color: var(--gray-600, #676e79);
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
@media (max-width: ${S.MOBILE_SIZE_PX+"px"}) {
|
|
126
|
+
padding: 1rem 0 0 0;
|
|
127
|
+
|
|
128
|
+
& .campaign-title-text {
|
|
129
|
+
font-weight: 600;
|
|
130
|
+
font-size: 1rem;
|
|
131
|
+
line-height: 1.5rem;
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
& .campaign-date {
|
|
135
|
+
display: none;
|
|
136
|
+
}
|
|
119
137
|
|
|
120
|
-
& .
|
|
121
|
-
|
|
138
|
+
& .timestamp-text {
|
|
139
|
+
line-height: 1rem;
|
|
140
|
+
padding-top: 0.5rem;
|
|
122
141
|
}
|
|
123
142
|
|
|
124
143
|
& .text-block-wrapper {
|
|
@@ -128,13 +147,13 @@
|
|
|
128
147
|
gap: 0.25rem;
|
|
129
148
|
}
|
|
130
149
|
}
|
|
131
|
-
`,
|
|
150
|
+
`,re=(e=!1,n=!1,s=!1)=>`
|
|
132
151
|
display: flex;
|
|
133
152
|
${n?"flex-wrap: wrap;":""}
|
|
134
153
|
${n?"":"flex-wrap: nowrap;"}
|
|
135
154
|
${e?"align-items: center;":""}
|
|
136
|
-
${
|
|
137
|
-
`,
|
|
155
|
+
${s?"justify-content: center;":""}
|
|
156
|
+
`,Te=p.styled(se.motion.div)`
|
|
138
157
|
text-decoration: none;
|
|
139
158
|
${e=>e.hasPermission===!0&&"cursor: pointer"};
|
|
140
159
|
|
|
@@ -151,14 +170,14 @@
|
|
|
151
170
|
text-decoration: none;
|
|
152
171
|
}
|
|
153
172
|
|
|
154
|
-
${
|
|
173
|
+
${re(!0)}
|
|
155
174
|
gap: 0.5rem;
|
|
156
175
|
padding: 0.5rem;
|
|
157
|
-
color: var(--gray-950);
|
|
176
|
+
color: var(--gray-950, #14161a);
|
|
158
177
|
font-weight: 500;
|
|
159
|
-
font-size:
|
|
160
|
-
line-height: 1.
|
|
161
|
-
border-radius: ${e=>
|
|
178
|
+
font-size: 1rem;
|
|
179
|
+
line-height: 1.5rem;
|
|
180
|
+
border-radius: ${e=>x.getBorderRadiusValueWithUnits(e.theme,"slight")};
|
|
162
181
|
transition: all 0.25s ease;
|
|
163
182
|
& .description {
|
|
164
183
|
font-size: 0.85rem;
|
|
@@ -167,7 +186,7 @@
|
|
|
167
186
|
font-weight: 400;
|
|
168
187
|
}
|
|
169
188
|
& .logo-wrapper {
|
|
170
|
-
${
|
|
189
|
+
${re(!0,!1,!0)}
|
|
171
190
|
flex-shrink: 0;
|
|
172
191
|
border-radius: 999px;
|
|
173
192
|
|
|
@@ -205,14 +224,19 @@
|
|
|
205
224
|
cursor: pointer;
|
|
206
225
|
background-color: var(--gray-95080, #14161acc);
|
|
207
226
|
}
|
|
208
|
-
|
|
227
|
+
|
|
228
|
+
@media (max-width: ${S.MOBILE_SIZE_PX+"px"}) {
|
|
229
|
+
padding: 0;
|
|
230
|
+
font-size: 0.875rem;
|
|
231
|
+
}
|
|
232
|
+
`,$e=p.styled.div`
|
|
209
233
|
position: absolute;
|
|
210
234
|
top: 0.5rem;
|
|
211
235
|
${e=>e.alignToLeft===!0?"left: 0.5rem;":"right: 0.5rem;"}
|
|
212
236
|
display: flex;
|
|
213
237
|
gap: 0.25rem;
|
|
214
|
-
`,Pe=
|
|
215
|
-
border-radius: ${e=>
|
|
238
|
+
`,Pe=p.styled.div`
|
|
239
|
+
border-radius: ${e=>x.getBorderRadiusValueWithUnits(e.theme,e.borderRadius||"slight")};
|
|
216
240
|
background-color: ${e=>e==null?void 0:e.color};
|
|
217
241
|
color: white;
|
|
218
242
|
height: 1.5rem;
|
|
@@ -227,7 +251,7 @@
|
|
|
227
251
|
& i {
|
|
228
252
|
font-size: 0.813rem;
|
|
229
253
|
}
|
|
230
|
-
`,
|
|
254
|
+
`,Ie=d.forwardRef(({src:e,...n},s)=>{const o=d.useRef();return d.useEffect(()=>{var u;const l=i=>{i.target.src=Q.DefaultShopImage,i.onerror=null};return(u=o==null?void 0:o.current)==null||u.addEventListener("error",l),()=>{var i;(i=o==null?void 0:o.current)==null||i.removeEventListener("error",l)}},[]),t.jsx(d.Fragment,{ref:s,children:x.isDefinedNotEmptyString(e)?t.jsx("img",{ref:o,src:e,...n}):t.jsx("img",{src:Q.DefaultShopImage,...n})})}),le=e=>{const{uuid:n,hasPermission:s=!0,isUser:o,image:l,imageComponent:u,name:i,notifications:m=0,color:c="primary",size:y="large",style:P,disabled:I,onClick:_=()=>{},isActive:C,className:w,shopCategory:b,themeData:v}=e,T={theme:F.useTheme(),color:c,size:y,style:P,disabled:I};return d.createElement(Te,{onClick:g=>{g.stopPropagation(),s===!0&&(_==null||_())},...T,key:i,className:`profile-item ${w}`,hasPermission:s,isActive:C,themeColor:(v==null?void 0:v.code)||"transparent"},t.jsx("div",{className:"logo-wrapper",children:x.isDefined(u)?u:l}),t.jsxs("div",{children:[t.jsx("div",{className:"name",children:i}),!o&&t.jsx("div",{className:"description",children:b}),m>0&&t.jsx("div",{className:"notifications-number",children:t.jsx(ve,{className:"badge",color:"danger",size:"small",children:m>99?"99+":m})})]}))};le.propTypes={id:a.PropTypes.any,isUserProfile:a.PropTypes.bool,themeColor:a.PropTypes.string,image:a.PropTypes.any,name:a.PropTypes.string,notifications:a.PropTypes.number,style:a.PropTypes.object,className:a.PropTypes.string,color:a.PropTypes.oneOf(["primary","secondary","success","warning","danger","information","neutral"]),size:a.PropTypes.oneOf(["large"]),onSelect:a.PropTypes.func,hasPermission:a.PropTypes.bool};const te=(e,n)=>{if(!e||!n)return null;const s=e.getTime()-n.getTime(),o=24*60*60*1e3;return s>=0?Math.ceil(s/o):Math.floor(s/o)},ne=e=>{if(e!==void 0){const n=new Date(e),s=n.getFullYear(),o=n.getMonth()+1;return`${String(n.getDate()).padStart(2)}. ${o}. ${s}.`}},ce=d.forwardRef((e,n)=>{var K;const s=F.useTheme(),{shopUuid:o,title:l="",coverPhoto:u,onSelect:i,startDate:m,endDate:c,salesPackages:y,shopName:P,shopCategory:I,shopImage:_,shopImageComponent:C,className:w,onSelectCard:b=()=>{},onSelectShop:v=()=>{},upcoming:k=!1,upcomingCampaignText:T,campaignSingleText:g,salesCampaignTypes:h=[],startsInPrefixTextPlural:U,startsinSuffixTextPlural:B,startsInPrefixTextSingular:q,startsinSuffixTextSingular:A,endsInPrefixTextPlural:W,endsinSuffixTextPlural:G,endsInPrefixTextSingular:N,endsinSuffixTextSingular:V,themeData:E,numberOfListings:r,numberOfListingsTextSingular:X,numberOfListingsTextPlural:me,...pe}=e,H=m?new Date(m)<=new Date:!1,he=te(m?new Date(m):null,new Date),M=te(c?new Date(c):null,new Date),ue=M!==null&&M<=2&&M>0,Y=c?new Date(c).getTime():null,fe=Date.now(),Z=Y!==null?Y-fe:null,z=Z!==null&&Z>0&&Z<24*60*60*1e3,J=(j,R,f,D,$)=>f===1?`${j} ${f} ${D}`:`${R} ${f} ${$}`,xe=()=>{if(!c)return null;const j=ye,f=new Date(c).getTime()-j.getTime();if(f<=0)return null;const D=Math.floor(f/(1e3*60*60)),$=Math.floor(f%(1e3*60*60)/(1e3*60)),be=Math.floor(f%(1e3*60)/1e3);return{hours:D,minutes:$,seconds:be}},[ye,we]=d.useState(new Date);d.useEffect(()=>{if(!z)return;const j=setInterval(()=>{we(new Date)},1e3);return()=>clearInterval(j)},[z]);const L=z?xe():null;return t.jsxs(_e,{ref:n,theme:s,className:w,onClick:b,...pe,children:[t.jsxs(je,{theme:s,onClick:()=>i==null?void 0:i(),children:[t.jsx("img",{src:u}),t.jsx($e,{children:y==null?void 0:y.map((j,R)=>{var f,D;return t.jsx(Pe,{color:(f=h==null?void 0:h.find($=>$.value===j))==null?void 0:f.color,theme:s,children:t.jsx(oe,{icon:(D=h==null?void 0:h.find($=>$.value===j))==null?void 0:D.icon})},`package__${R}`)})})]}),t.jsxs(Se,{theme:s,children:[t.jsx("div",{className:"text-block-wrapper",children:t.jsxs("div",{className:"title-block-wrapper",children:[t.jsx("div",{className:"campaign-title",children:(K=k?T:g)==null?void 0:K.toUpperCase()}),t.jsx("div",{className:"campaign-title-text",children:l}),c&&m&&t.jsxs("div",{className:"campaign-date",children:[ne(m)," - ",ne(c)]}),t.jsxs("div",{className:"timestamp-text",children:[r>0&&t.jsxs("span",{className:"listings-text",children:[r," ",r===1?X:me," ","∙"," "]}),t.jsx("span",{className:`duration-text ${ue?"urgent":""} ${H?"":"starts-in"}`,children:z&&L?t.jsxs("div",{className:"countdown-timer",children:[N," ",L.hours.toString().padStart(2,"0"),":",L.minutes.toString().padStart(2,"0"),":",L.seconds.toString().padStart(2,"0")]}):H?J(N,W,M,V,G):J(q,U,he,A,B)})]})]})}),t.jsx(le,{hasPermission:!0,image:t.jsx(Ie,{src:_}),imageComponent:C,themeData:E,isActive:!0,isUser:!1,name:P,shopCategory:I,onClick:()=>v(o)})]})]})});ce.propTypes={title:a.PropTypes.oneOfType([a.PropTypes.string,a.PropTypes.element]),numberOfListings:a.PropTypes.number,dropdown:a.PropTypes.any,color:a.PropTypes.string};p.styled.div`
|
|
231
255
|
display: flex;
|
|
232
256
|
flex-direction: column;
|
|
233
257
|
gap: 1.5rem;
|
|
@@ -258,26 +282,26 @@
|
|
|
258
282
|
}
|
|
259
283
|
}
|
|
260
284
|
|
|
261
|
-
@media (max-width: ${
|
|
285
|
+
@media (max-width: ${S.MOBILE_SIZE_PX+"px"}) {
|
|
262
286
|
& .campaign-item {
|
|
263
287
|
min-width: 100%;
|
|
264
288
|
width: 100%;
|
|
265
289
|
margin-right: 0;
|
|
266
290
|
}
|
|
267
291
|
}
|
|
268
|
-
`;const
|
|
292
|
+
`;const O=p.styled.div`
|
|
269
293
|
width: ${e=>e.width||"100%"};
|
|
270
294
|
height: ${e=>(e.heightCoeff||1)*1.125}rem;
|
|
271
295
|
background-color: var(--gray-200, #dddfe4);
|
|
272
296
|
|
|
273
|
-
${
|
|
274
|
-
`,
|
|
297
|
+
${x.linearGradientAnimation("-90deg")}
|
|
298
|
+
`,Ce=p.styled.div`
|
|
275
299
|
display: flex;
|
|
276
300
|
flex-direction: ${e=>e!=null&&e.row?"row":"column"};
|
|
277
301
|
gap: ${e=>(e==null?void 0:e.gap)??"0.5rem"};
|
|
278
302
|
width: ${e=>(e==null?void 0:e.width)??"100%"};
|
|
279
|
-
`,ae=
|
|
280
|
-
border-radius: ${e=>
|
|
303
|
+
`,ae=p.styled.div`
|
|
304
|
+
border-radius: ${e=>x.getBorderRadiusValueWithUnits(e.theme,(e==null?void 0:e.borderRadius)??"regular")};
|
|
281
305
|
background: var(--gray-200, #dddfe4);
|
|
282
306
|
position: relative;
|
|
283
307
|
max-height: ${e=>(e==null?void 0:e.height)??"5rem"};
|
|
@@ -286,10 +310,10 @@
|
|
|
286
310
|
width: ${e=>(e==null?void 0:e.width)??"5rem"};
|
|
287
311
|
flex-shrink: 0;
|
|
288
312
|
|
|
289
|
-
${
|
|
290
|
-
`,
|
|
313
|
+
${x.linearGradientAnimation()}
|
|
314
|
+
`,ke=p.styled.div`
|
|
291
315
|
background: var(--white, #fff);
|
|
292
|
-
border-radius: ${e=>
|
|
316
|
+
border-radius: ${e=>x.getBorderRadiusValueWithUnits(e.theme,"edged")};
|
|
293
317
|
box-shadow: 0px 1px 3px rgba(0, 0, 0, 0.1), 0px 1px 2px rgba(0, 0, 0, 0.06);
|
|
294
318
|
border: 1px solid var(--gray-95012, #14161a1f);
|
|
295
319
|
|
|
@@ -316,17 +340,17 @@
|
|
|
316
340
|
gap: 0.5rem;
|
|
317
341
|
}
|
|
318
342
|
|
|
319
|
-
@media (max-width: ${
|
|
343
|
+
@media (max-width: ${S.MOBILE_SIZE_PX+"px"}) {
|
|
320
344
|
flex-direction: column;
|
|
321
345
|
|
|
322
346
|
& .campaign__user {
|
|
323
347
|
margin-top: 1rem;
|
|
324
348
|
}
|
|
325
349
|
}
|
|
326
|
-
`,Ne=
|
|
350
|
+
`,Ne=p.styled.div`
|
|
327
351
|
display: flex;
|
|
328
352
|
gap: 1.5rem;
|
|
329
|
-
`,
|
|
353
|
+
`,De=d.forwardRef(({},e)=>{const n=F.useTheme();return t.jsxs(ke,{ref:e,theme:n,children:[t.jsx("div",{className:"campaign__left-section",children:t.jsx(ae,{theme:n,width:"15rem",height:"15rem",borderRadius:"edged"})}),t.jsxs("div",{className:"campaign__right-section",children:[t.jsxs(Ce,{theme:n,children:[t.jsx(O,{heightCoeff:.75,theme:n,width:"35%"}),t.jsx(O,{heightCoeff:1.25,theme:n}),t.jsx(O,{heightCoeff:3,theme:n})]}),t.jsxs("div",{className:"campaign__user",children:[t.jsx(ae,{theme:n,width:"2.5rem",height:"2.5rem",borderRadius:"curved"}),t.jsx(O,{theme:n,width:"75%"})]})]})]})}),Ee=({itemsCount:e=5,keyPrefix:n})=>t.jsx(Ne,{children:Array.from({length:e},(s,o)=>t.jsx(De,{},`${n}-skeleton-campaign-card-${o}`))}),Me=({children:e,fallbackComponent:n=t.jsx(t.Fragment,{}),isLoading:s=!1,itemsCount:o=5,keyPrefix:l})=>t.jsx(d.Suspense,{fallback:n,children:s===!0?t.jsx(Ee,{itemsCount:o,keyPrefix:l}):e}),ze=p.styled.div`
|
|
330
354
|
margin: 0 auto;
|
|
331
355
|
display: flex;
|
|
332
356
|
flex-direction: column;
|
|
@@ -346,9 +370,6 @@
|
|
|
346
370
|
align-items: center;
|
|
347
371
|
gap: 0.5rem;
|
|
348
372
|
|
|
349
|
-
& .title__icon {
|
|
350
|
-
}
|
|
351
|
-
|
|
352
373
|
& .title__text {
|
|
353
374
|
color: var(--gray-950, #14161a);
|
|
354
375
|
font-size: 1.5rem;
|
|
@@ -367,16 +388,46 @@
|
|
|
367
388
|
top: 0;
|
|
368
389
|
right: 0;
|
|
369
390
|
}
|
|
370
|
-
|
|
391
|
+
|
|
392
|
+
@media (max-width: ${S.MOBILE_SIZE_PX+"px"}) {
|
|
393
|
+
& .scrollable-section__header {
|
|
394
|
+
& .scrollable-section__title {
|
|
395
|
+
& .title__text {
|
|
396
|
+
font-size: 1.375rem;
|
|
397
|
+
line-height: 1.75rem;
|
|
398
|
+
}
|
|
399
|
+
}
|
|
400
|
+
}
|
|
401
|
+
}
|
|
402
|
+
`,Le=p.styled(se.motion.div)`
|
|
371
403
|
display: grid;
|
|
372
404
|
grid-template-columns: repeat(${e=>e==null?void 0:e.numOfColumns}, 1fr);
|
|
373
405
|
gap: 1.5rem;
|
|
374
406
|
width: 100%;
|
|
375
407
|
|
|
376
|
-
@media (max-width: ${
|
|
377
|
-
|
|
408
|
+
@media (max-width: ${S.MOBILE_SIZE_PX+"px"}) {
|
|
409
|
+
display: flex;
|
|
410
|
+
flex-wrap: nowrap;
|
|
411
|
+
overflow-x: scroll;
|
|
412
|
+
justify-content: flex-start;
|
|
413
|
+
gap: 1rem;
|
|
414
|
+
|
|
415
|
+
-webkit-overflow-scrolling: touch;
|
|
416
|
+
::-webkit-scrollbar {
|
|
417
|
+
-webkit-appearance: none;
|
|
418
|
+
}
|
|
419
|
+
|
|
420
|
+
-ms-overflow-style: none;
|
|
421
|
+
/* Internet Explorer 10+ */
|
|
422
|
+
scrollbar-width: none;
|
|
423
|
+
/* Firefox */
|
|
424
|
+
|
|
425
|
+
&::-webkit-scrollbar {
|
|
426
|
+
display: none;
|
|
427
|
+
/* Safari and Chrome */
|
|
428
|
+
}
|
|
378
429
|
}
|
|
379
|
-
`,
|
|
430
|
+
`,de=d.forwardRef(({icon:e,title:n,numOfSlides:s=2,showNavigation:o=!0,children:l},u)=>{const[i,m]=d.useState(0),[c,y]=d.useState(1),[P,I]=d.useState(null),[_,C]=d.useState(null),w=ie.useDetectMobile(),b=(l==null?void 0:l.length)??1;d.useEffect(()=>{const g=()=>{y(s)};return window.addEventListener("resize",g),g(),()=>window.removeEventListener("resize",g)},[]);const v=w?l:l==null?void 0:l.slice(i,i+c),k=g=>{var h;(h=g==null?void 0:g.target)==null||h.blur(),i+c<b&&m(i+c)},T=g=>{var h;(h=g==null?void 0:g.target)==null||h.blur(),i-c>=0&&m(i-c)};return t.jsxs(ze,{ref:u,children:[t.jsx("div",{className:"scrollable-section__header",children:t.jsxs("div",{className:"scrollable-section__title",children:[x.isDefinedNotEmptyString(e)&&t.jsx(oe,{icon:e,color:"primary",sizeInUnits:"1.5rem",className:"title__icon"}),x.isDefinedNotEmptyString(n)&&t.jsx("div",{className:"title__text",children:n})]})}),t.jsx(Le,{numOfColumns:s,...!w&&{animate:{x:0,opacity:1},initial:{x:10,opacity:0}},children:v},`scrollable-section__content-${i}`),o&&b>c&&!w&&t.jsxs("div",{className:"scrollable-section__navigation",children:[t.jsx(ee,{icon:"angle-left",borderRadius:"curved",btnType:"tinted",color:"neutral",className:"navigation__arrow",disabled:i===0,onClick:T}),t.jsx(ee,{icon:"angle-right",borderRadius:"curved",btnType:"tinted",color:"neutral",className:"navigation__arrow",disabled:i+c>=b,onClick:k})]})]})});de.propTypes={icon:a.PropTypes.string,title:a.PropTypes.string,numOfSlides:a.PropTypes.number,numOfSlidesForMobile:a.PropTypes.number,showNavigation:a.PropTypes.bool};const Re=p.styled.div`
|
|
380
431
|
display: flex;
|
|
381
432
|
flex: 1;
|
|
382
433
|
width: 100%;
|
|
@@ -393,4 +444,4 @@
|
|
|
393
444
|
border-radius: 1.25rem;
|
|
394
445
|
object-fit: cover;
|
|
395
446
|
}
|
|
396
|
-
`,
|
|
447
|
+
`,ge=d.forwardRef(({sectionName:e,imageUrl:n,maxHeight:s="16.25rem",className:o="",handleClick:l=()=>{}})=>t.jsx(Re,{maxHeight:s,onClick:l,className:`itemless-banner ${o}`,children:t.jsx("img",{src:n,alt:`itemless-banner__${e}`})}));ge.propTypes={sectionName:a.PropTypes.string,imageUrl:a.PropTypes.string,maxHeight:a.PropTypes.string,className:a.PropTypes.string,handleClick:a.PropTypes.func};const Oe=d.memo(ce),Ue=d.forwardRef(({sellerType:e="Shop",items:n=[],title:s,icon:o,isLoading:l,onSelectCard:u=()=>{},onSelectShop:i=()=>{},getImage:m=()=>{},campaignSingleText:c,upcomingCampaignText:y,salesCampaignTypes:P=[],startsInPrefixTextPlural:I,startsinSuffixTextPlural:_,startsInPrefixTextSingular:C,startsinSuffixTextSingular:w,endsInPrefixTextPlural:b,endsinSuffixTextPlural:v,endsInPrefixTextSingular:k,endsinSuffixTextSingular:T,numOfSlides:g=2,showNavigation:h=!0,numberOfListingsTextSingular:U,numberOfListingsTextPlural:B,itemlessImageUrl:q,itemlessLink:A,handleItemlessLink:W=()=>{}},G)=>{const N=ie.useDetectMobile(),V=d.useMemo(()=>{let E=n==null?void 0:n.map((r,X)=>t.jsx(Oe,{className:"campaign-item",coverPhoto:m(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:()=>u(r==null?void 0:r.campaignUuid,r==null?void 0:r.shopUuid),onSelectShop:()=>i(r==null?void 0:r.shopUuid),campaignSingleText:c,upcomingCampaignText:y,upcoming:r==null?void 0:r.upcoming,salesCampaignTypes:P,startsInPrefixTextPlural:I,startsinSuffixTextPlural:_,startsInPrefixTextSingular:C,startsinSuffixTextSingular:w,endsInPrefixTextPlural:b,endsinSuffixTextPlural:v,endsInPrefixTextSingular:k,endsinSuffixTextSingular:T,themeData:r==null?void 0:r.themeData,numberOfListings:r==null?void 0:r.numberOfListings,numberOfListingsTextSingular:U,numberOfListingsTextPlural:B},`campaign__item__${X}__${r==null?void 0:r.startDate}___${r==null?void 0:r.endDate}`));return(n==null?void 0:n.length)<2&&!N?[...E,t.jsx(ge,{imageUrl:q,className:"campaign-item",handleClick:W})]:E},[n]);return t.jsx(Me,{isLoading:l,itemsCount:N?1:2,keyPrefix:"sales-camp",children:t.jsx(de,{icon:o,title:s,numOfSlides:g,showNavigation:h,children:V},`sales-campaign-section__${N}`)})});module.exports=Ue;
|