@riosst100/pwa-marketplace 1.6.9 → 1.7.1

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 (64) hide show
  1. package/package.json +1 -1
  2. package/src/componentOverrideMapping.js +4 -0
  3. package/src/components/CollectibleGameSets/collectibleGameSets.js +0 -4
  4. package/src/components/FilterTop/filterTop.js +0 -2
  5. package/src/components/FilterTopBackup/CustomFilters/customFilters.js +0 -1
  6. package/src/components/ProductLabel/index.js +47 -0
  7. package/src/components/ProductListTab/productListTab.js +51 -5
  8. package/src/components/ProductListTab/productListTab.module.css +1 -1
  9. package/src/components/RelatedProduct/relatedProduct.js +1 -1
  10. package/src/components/ShopBy/shopBy copy.js +172 -0
  11. package/src/components/ShopBy/shopBy.js +0 -1
  12. package/src/components/ShopBySets/shopBySets.js +0 -3
  13. package/src/components/SportCardsSets/index.js +2 -0
  14. package/src/components/SportCardsSets/sportCardsSets.js +372 -0
  15. package/src/components/SportCardsSets/sportCardsSets.module.css +76 -0
  16. package/src/components/SportCardsSets/sportCardsSets.shimmer.js +50 -0
  17. package/src/overwrites/pagebuilder/lib/ContentTypes/Products/Carousel/__fixtures__/apolloMocks.js +33 -0
  18. package/src/overwrites/pagebuilder/lib/ContentTypes/Products/Carousel/carousel.gql.ce.js +16 -0
  19. package/src/overwrites/pagebuilder/lib/ContentTypes/Products/Carousel/carousel.gql.ee.js +17 -0
  20. package/src/overwrites/pagebuilder/lib/ContentTypes/Products/Carousel/carousel.js +38 -0
  21. package/src/overwrites/pagebuilder/lib/ContentTypes/Products/Carousel/index.js +1 -0
  22. package/src/overwrites/pagebuilder/lib/ContentTypes/Products/Carousel/useCarousel.js +25 -0
  23. package/src/overwrites/pagebuilder/lib/ContentTypes/Products/configAggregator.js +26 -0
  24. package/src/overwrites/pagebuilder/lib/ContentTypes/Products/index.js +1 -0
  25. package/src/overwrites/pagebuilder/lib/ContentTypes/Products/products.js +369 -0
  26. package/src/overwrites/pagebuilder/lib/ContentTypes/Products/products.module.css +0 -0
  27. package/src/overwrites/pagebuilder/lib/ContentTypes/Slider/banner.module.css +103 -0
  28. package/src/overwrites/pagebuilder/lib/ContentTypes/Slider/configAggregator.js +17 -0
  29. package/src/overwrites/pagebuilder/lib/ContentTypes/Slider/index.js +2 -0
  30. package/src/overwrites/pagebuilder/lib/ContentTypes/Slider/slider.js +221 -0
  31. package/src/overwrites/pagebuilder/lib/ContentTypes/Slider/slider.module.css +231 -0
  32. package/src/overwrites/pagebuilder/lib/ContentTypes/Slider/slider.shimmer.js +126 -0
  33. package/src/overwrites/pagebuilder/lib/ContentTypes/Slider/slider.shimmer.module.css +5 -0
  34. package/src/overwrites/pagebuilder/lib/utils.js +224 -0
  35. package/src/overwrites/peregrine/lib/talons/FilterSidebar/useFilterSidebar.js +60 -0
  36. package/src/overwrites/peregrine/lib/talons/ProductFullDetail/useProductFullDetail.js +4 -1
  37. package/src/overwrites/peregrine/lib/talons/RootComponents/Category/categoryFragments.gql.js +8 -0
  38. package/src/overwrites/peregrine/lib/talons/RootComponents/Product/productDetailFragment.gql.js +44 -0
  39. package/src/overwrites/venia-ui/lib/RootComponents/CMS/cms.js +73 -0
  40. package/src/overwrites/venia-ui/lib/RootComponents/CMS/cms.module.css +25 -0
  41. package/src/overwrites/venia-ui/lib/RootComponents/CMS/cms.shimmer.js +18 -0
  42. package/src/overwrites/venia-ui/lib/RootComponents/CMS/index.js +7 -0
  43. package/src/overwrites/venia-ui/lib/RootComponents/Category/category.js +12 -1
  44. package/src/overwrites/venia-ui/lib/RootComponents/Category/categoryContent.js +3 -3
  45. package/src/overwrites/venia-ui/lib/components/App/app.js +131 -0
  46. package/src/overwrites/venia-ui/lib/components/Breadcrumbs/breadcrumbs.module.css +1 -0
  47. package/src/overwrites/venia-ui/lib/components/FilterModal/CurrentFilters/currentFilters.js +1 -1
  48. package/src/overwrites/venia-ui/lib/components/FilterSidebar/filterSidebar.js +4 -1
  49. package/src/overwrites/venia-ui/lib/components/Gallery/item.js +13 -3
  50. package/src/overwrites/venia-ui/lib/components/Gallery/item.module.css +1 -1
  51. package/src/overwrites/venia-ui/lib/components/ProductFullDetail/components/auctionDetail.js +176 -138
  52. package/src/overwrites/venia-ui/lib/components/ProductFullDetail/components/preOrderDetail.js +19 -10
  53. package/src/overwrites/venia-ui/lib/components/ProductFullDetail/productFullDetail.js +5 -26
  54. package/src/overwrites/venia-ui/lib/components/RichContent/richContent.module.css +3 -3
  55. package/src/overwrites/venia-ui/lib/components/SearchBar/searchBar.js +0 -1
  56. package/src/overwrites/venia-ui/lib/index.module.css +137 -0
  57. package/src/overwrites/venia-ui/lib/tokens.module.css +167 -0
  58. package/src/talons/CollectibleGameSets/collectibleGameSets.gql.js +15 -1
  59. package/src/talons/CollectibleGameSets/useCollectibleGameSets.js +0 -11
  60. package/src/talons/FilterTop/useFilterTop.js +0 -2
  61. package/src/talons/ShopBy/useShopBy.js +0 -22
  62. package/src/talons/SportCardsSets/sportCardsSets.gql.js +46 -0
  63. package/src/talons/SportCardsSets/useSportCardsSets.js +170 -0
  64. package/src/talons/SubCategoryPage/useSubCategoryPage.js +0 -3
@@ -0,0 +1,372 @@
1
+ import React, { Fragment, useEffect, useMemo, useState } from 'react';
2
+ import ErrorView from '@magento/venia-ui/lib/components/ErrorView';
3
+ import { StoreTitle, Meta } from '@magento/venia-ui/lib/components/Head';
4
+ import { useSportCardsSets } from '@riosst100/pwa-marketplace/src/talons/SportCardsSets/useSportCardsSets';
5
+ import { Link } from 'react-router-dom';
6
+ import resourceUrl from '@magento/peregrine/lib/util/makeUrl';
7
+ import defaultClasses from './sportCardsSets.module.css';
8
+ import { useStyle } from '@magento/venia-ui/lib/classify';
9
+ import cn from 'classnames';
10
+ import Divider from '@riosst100/pwa-marketplace/src/components/Divider';
11
+ import { SportCardsSetsShimmer } from '@riosst100/pwa-marketplace/src/components/SportCardsSets';
12
+ import CustomSortBy from '@riosst100/pwa-marketplace/src/components/CustomSortBy';
13
+ import ArraySearchInput from '@riosst100/pwa-marketplace/src/components/ArraySearchInput';
14
+ import { useCustomSort } from '@riosst100/pwa-marketplace/src/hooks/useCustomSort';
15
+ import Breadcrumbs from '@magento/venia-ui/lib/components/Breadcrumbs';
16
+
17
+ const SportCardsSets = props => {
18
+ const { categoryId } = props
19
+
20
+ const [active, setActive] = useState('all');
21
+ const [activeTab, setActiveTab] = useState('leagues');
22
+ const [activeFilter, setActiveFilter] = useState('all');
23
+
24
+ const [searchQuery, setSearchQuery] = useState('');
25
+
26
+ let availableLeagues = [];
27
+
28
+ const { location } = globalThis;
29
+
30
+ const query = new URLSearchParams(location.search);
31
+ const shopby = query.get('shopby') || null;
32
+ const setType = query.get('set_type') || null;
33
+
34
+ let defaultSort = {
35
+ sortText: 'All (A-Z)',
36
+ value: 'all'
37
+ };
38
+
39
+ if (shopby == "release_year") {
40
+ defaultSort = {
41
+ sortText: 'All (By Year)',
42
+ value: 'date'
43
+ };
44
+ }
45
+
46
+ // if (productType == "expansion_sets") {
47
+ // defaultSort = {
48
+ // sortText: 'All (Expansion Sets)',
49
+ // value: 'all'
50
+ // };
51
+ // }
52
+
53
+ const sortProps = useCustomSort({ sortFromSearch: false, defaultSort: defaultSort});
54
+
55
+ const [currentSort] = sortProps;
56
+
57
+ // const [sortBy, setSortBy] = useState({
58
+ // sortText: 'All (A-Z)',
59
+ // value: 'all'
60
+ // });
61
+
62
+
63
+ const classes = useStyle(defaultClasses);
64
+
65
+ const talonProps = useSportCardsSets({ searchQuery, setActive, currentSort, shopby, setType, categoryId, activeTab });
66
+
67
+ const { error, loading, sportCardsSets, categoryUrlSuffix, categoryUrlKey, productType, filteredSportCardsSets, availableGroups, category } = talonProps;
68
+
69
+ if (loading && !sportCardsSets)
70
+ return <SportCardsSetsShimmer />;
71
+ if (error && !sportCardsSets) return <ErrorView />;
72
+
73
+ if (!sportCardsSets && !loading && !error) {
74
+ return <SportCardsSetsShimmer />;
75
+ }
76
+
77
+ const setsLengthArr = [];
78
+
79
+ const newSportCardsSets = searchQuery ? filteredSportCardsSets : sportCardsSets;
80
+
81
+ // useEffect(() => {
82
+ if (sportCardsSets && sportCardsSets.length) {
83
+ sportCardsSets.map((setRelease, index) => {
84
+ const { group, sets } = setRelease;
85
+
86
+ if (sets.length) {
87
+ sets.map((set, index) => {
88
+ // console.log(set)
89
+ if (set.sc_league) {
90
+ if (!availableLeagues.includes(set.sc_league)) {
91
+ availableLeagues.push(set.sc_league)
92
+ }
93
+ }
94
+ })
95
+ }
96
+
97
+ setsLengthArr[group] = sets.length
98
+ })
99
+ }
100
+ // }, [sportCardsSets])
101
+
102
+ const splitToNChunks = (array, n) => {
103
+ let result = [];
104
+ for (let i = n; i > 0; i--) {
105
+ result.push(array.splice(0, Math.ceil(array.length / i)));
106
+ }
107
+ return result;
108
+ }
109
+
110
+ // console.log(category)
111
+
112
+ const setRelases = newSportCardsSets.length && newSportCardsSets.map((setRelease, index) => {
113
+ const { group, sets } = setRelease;
114
+
115
+ const setsResult = [];
116
+
117
+ if (sets.length) {
118
+ sets.map((set, index) => {
119
+ const { set_name, option_id, release_year } = set;
120
+
121
+ const categoryUrl = resourceUrl(
122
+ `/${category?.url_path}${categoryUrlSuffix || ''}?sc_${category?.url_key}_release[filter]=${set_name},${option_id}`
123
+ );
124
+
125
+ setsResult.push(<li className='list-none'>
126
+ <Link to={categoryUrl} className="hover_bg-darkblue-900 hover_text-white w-full block text-[14px] py-[2px] px-2">
127
+ {set_name}
128
+ </Link>
129
+ </li>)
130
+ })
131
+ }
132
+
133
+ let setsResultSplitted = [];
134
+ if (active == group || newSportCardsSets.length == 1) {
135
+ setsResultSplitted = splitToNChunks(setsResult, 3);
136
+ }
137
+
138
+ return (
139
+ <>
140
+ {active == "all" && newSportCardsSets.length > 1 ?
141
+ <div className={cn('singles_group-wrapper mb-4 px-2 inline-block', classes.singlesGroupWrapper)}>
142
+ <div className='singles_item_group_letter text-xl font-semibold border-b border-gray-100 pb-1 mb-2' >
143
+ {group}
144
+ </div>
145
+ <div className={cn('singles_item-list flex flex-col')}>{setsResult}</div>
146
+ </div> : ''}
147
+ {active == group || newSportCardsSets.length == 1 ? setsResultSplitted && setsResultSplitted.length && setsResultSplitted.map((setsResult, index) =>
148
+ <div key={index} className={cn('singles_group-wrapper mb-4 px-2 inline-block', classes.singlesGroupWrapper)}>
149
+ {index == 0 ? <div className='singles_item_group_letter text-xl font-semibold border-b border-gray-100 pb-1 mb-2'>{group}</div> :
150
+ <div className='singles_item_group_letter text-xl font-semibold pb-1 mb-2' style={{"marginTop":"35px"}}></div>}
151
+ <div className={cn('singles_item-list flex flex-col')}>{setsResult}</div>
152
+ </div>
153
+ )
154
+ : ''}
155
+ </>
156
+ );
157
+ });
158
+
159
+ const handleActive = (val) => {
160
+ setActive(val);
161
+
162
+ availableLeagues = [];
163
+ //
164
+
165
+
166
+ setSearchQuery('')
167
+ }
168
+
169
+ const handleActiveTab = (val) => {
170
+ setActiveTab(val);
171
+
172
+ setSearchQuery('')
173
+ }
174
+
175
+ const handleActiveFilter = (val) => {
176
+ setActiveFilter(val);
177
+
178
+ setSearchQuery('')
179
+ }
180
+
181
+ let alpha = ['#', 'A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z'];
182
+
183
+ let availableSortBy = [
184
+ {
185
+ 'label': 'All (A-Z)',
186
+ 'value': 'all'
187
+ },
188
+ {
189
+ 'label': 'Latest Sets',
190
+ 'value': 'newest'
191
+ }
192
+ ];
193
+
194
+ if (shopby == "release_year") {
195
+ availableSortBy = [
196
+ {
197
+ 'label': 'All (By Year)',
198
+ 'value': 'date'
199
+ },
200
+ {
201
+ 'label': 'Latest Sets',
202
+ 'value': 'newest'
203
+ }
204
+ ];
205
+
206
+ // alpha = availableGroups;
207
+ }
208
+
209
+ if (productType == "expansion_sets") {
210
+ // availableSortBy = [
211
+ // {
212
+ // 'label': 'All (Expansion Sets)',
213
+ // 'value': 'all'
214
+ // },
215
+ // {
216
+ // 'label': 'Latest Sets',
217
+ // 'value': 'newest'
218
+ // }
219
+ // ];
220
+
221
+ // alpha = availableGroups
222
+ }
223
+
224
+ let title = "By Release/Set";
225
+ if (activeTab == "year") {
226
+ title = "By Year";
227
+ } else if (activeTab == "leagues") {
228
+ title = "By Leagues";
229
+ } else if (activeTab == "brand") {
230
+ title = "By Brand";
231
+ }
232
+
233
+ // console.log(availableLeagues)
234
+
235
+
236
+ return (
237
+ <Fragment>
238
+ <StoreTitle>{title}</StoreTitle>
239
+ <Breadcrumbs categoryId={categoryId} customPage={shopby == "expansion_sets" ? "Expansion Sets" : (shopby == "release_year" ? "By Year" : "By Release/Set")} />
240
+ {shopby == "release" ? <ul className={classes.nav}>
241
+ <li className={classes.nav_item}>
242
+ <button
243
+ onClick={() => {
244
+ handleActiveTab('year')
245
+ }}
246
+ >
247
+ {activeTab == 'year' ? <b>By Year</b> : 'By Year'}
248
+ </button>
249
+ </li>
250
+ <li className={classes.nav_item}>
251
+ <button
252
+ onClick={() => {
253
+ handleActiveTab('brand')
254
+ }}
255
+ >
256
+ {activeTab == 'brand' ? <b>By Brand</b> : 'By Brand'}
257
+ </button>
258
+ </li>
259
+ <li className={classes.nav_item}>
260
+ <button
261
+ onClick={() => {
262
+ handleActiveTab('leagues')
263
+ }}
264
+ >
265
+ {activeTab == 'leagues' ? <b>By Leagues</b> : 'By Leagues'}
266
+ </button>
267
+ </li>
268
+ </ul> : ''}
269
+ {shopby != "release_year" && productType != "expansion_sets" && <h1 className='mx-auto relative block text-xl font-bold text-center pt-10 pb-4'>
270
+ {title}
271
+ </h1>}
272
+ {shopby == "release" ? <ul className={classes.nav}>
273
+ {availableGroups.map((group, index) => (
274
+ <li key={index} className={classes.nav_item}>
275
+ <button
276
+ onClick={() => {
277
+ handleActive(group)
278
+ }}
279
+ >
280
+ {active == group ? <b>{group}</b> : group}
281
+ </button>
282
+ </li>
283
+ ))}
284
+ <li className={classes.nav_item}>
285
+ <button
286
+ onClick={() => {
287
+ handleActive('all')
288
+ }}
289
+ >
290
+ {active == 'all' ? <b>All</b> : 'All'}
291
+ </button>
292
+ </li>
293
+ </ul> : ''}
294
+ {availableLeagues ? <ul className={classes.nav}>
295
+ {availableLeagues.map((group, index) => (
296
+ <li key={index} className={classes.nav_item}>
297
+ <button
298
+ onClick={() => {
299
+ handleActiveFilter(group)
300
+ }}
301
+ >
302
+ {activeFilter == group ? <b>{group}</b> : group}
303
+ </button>
304
+ </li>
305
+ ))}
306
+ <li className={classes.nav_item}>
307
+ <button
308
+ onClick={() => {
309
+ handleActiveFilter('all')
310
+ }}
311
+ >
312
+ {activeFilter == 'all' ? <b>All</b> : 'All'}
313
+ </button>
314
+ </li>
315
+ </ul> : ''}
316
+ <div className='border border-gray-100 px-6'>
317
+ {sportCardsSets ? (
318
+ <div
319
+ className={classes.toolbar}
320
+ >
321
+ <div style={{"width":"35%"}}><ArraySearchInput active={active} searchQuery={searchQuery} placeholder="Search sets..." isOpen={true} setSearchQuery={setSearchQuery} /></div>
322
+ {/* <CustomSortBy sortProps={sortProps} availableSortMethods={availableSortBy} /> */}
323
+ </div>
324
+ ) : ''}
325
+ {shopby == "sets" && <>
326
+ <section className='single_list-indexing-container relative m-auto pt-5'>
327
+ <ul className='flex gap-2 justify-center flex-wrap'>
328
+ <li>
329
+ <button
330
+ className={cn(
331
+ 'rounded-md border border-solid border-gray-100 p-2 min-w-[28px]',
332
+ 'leading-4 font-medium text-base hover_bg-gray-50'
333
+ )}
334
+ onClick={() => {
335
+ handleActive('all')
336
+ }}
337
+ >
338
+ {active == 'all' ? <b>All</b> : 'All'}
339
+ </button>
340
+ </li>
341
+ {alpha.map((letter, index) => (
342
+ <li key={index}>
343
+ <button
344
+ className={cn(
345
+ 'rounded-md border border-solid border-gray-100 p-2 min-w-[28px]',
346
+ 'leading-4 font-medium text-base ',
347
+ setsLengthArr[letter] > 0 ? 'hover_bg-gray-50' : 'bg-gray-100 text-gray-400',
348
+ )}
349
+ onClick={() => {
350
+ handleActive(letter)
351
+ }}
352
+ disabled={setsLengthArr[letter] > 0 ? false : true}
353
+ >
354
+ {active == letter ? <b>{letter}</b> : letter}
355
+ </button>
356
+ </li>
357
+ ))}
358
+ </ul>
359
+ </section>
360
+ </>}
361
+ <Divider className="mb-5 px-4 mt-5" />
362
+ <section className='singles-container'>
363
+ <div className={cn('singles-wrapper block -mx-4', classes.singlesWrapper)}>
364
+ {newSportCardsSets && newSportCardsSets.length ? setRelases : (searchQuery ? <div className='singles_group-wrapper mb-4 px-2 inline-block w-full'>No sets found for <b>{searchQuery}</b> search query.</div> : <div className='singles_group-wrapper mb-4 px-2 inline-block w-full'>No sets found.</div>)}
365
+ </div>
366
+ </section>
367
+ </div>
368
+ </Fragment>
369
+ );
370
+ }
371
+
372
+ export default SportCardsSets;
@@ -0,0 +1,76 @@
1
+ .nav {
2
+ composes: flex from global;
3
+ composes: flex-wrap from global;
4
+ margin: 50px 0 30px 0;
5
+ composes: gap-[10px] from global;
6
+ }
7
+
8
+ .nav_item {
9
+ composes: px-4 from global;
10
+ composes: py-2 from global;
11
+ composes: transition-colors from global;
12
+ composes: duration-150 from global;
13
+ composes: border from global;
14
+ composes: border-solid from global;
15
+ composes: leading-normal from global;
16
+ composes: text-base from global;
17
+ composes: text-colorDefault from global;
18
+ composes: bg-white from global;
19
+ composes: border-gray-100 from global;
20
+ border-radius: 5px;
21
+ }
22
+
23
+ .toolbar {
24
+ composes: relative from global;
25
+ composes: ml-2xs from global;
26
+ display: flex;
27
+ justify-content: space-between;
28
+ margin-top: 20px;
29
+ }
30
+
31
+ .tabs {
32
+ composes: flex from global;
33
+ composes: flex-wrap from global;
34
+ composes: mt-3 from global;
35
+ composes: gap-[15px] from global;
36
+ margin-bottom: 30px;
37
+ }
38
+
39
+ .tabs_item {
40
+ composes: px-4 from global;
41
+ composes: py-2 from global;
42
+ composes: transition-colors from global;
43
+ composes: duration-150 from global;
44
+ composes: border from global;
45
+ composes: border-solid from global;
46
+ composes: leading-normal from global;
47
+ composes: text-base from global;
48
+ composes: text-colorDefault from global;
49
+ composes: bg-white from global;
50
+ composes: border-gray-100 from global;
51
+ border-radius: 5px;
52
+ }
53
+
54
+ .singlesWrapper {
55
+ column-count: 1;
56
+ display: flex;
57
+ width: 100%;
58
+ flex-wrap: wrap;
59
+ flex-direction: row;
60
+ }
61
+
62
+ .singlesGroupWrapper {
63
+ width: 100%;
64
+ }
65
+
66
+ @media screen and (min-width: 768px) {
67
+ .singlesGroupWrapper {
68
+ width: 50%;
69
+ }
70
+ }
71
+
72
+ @media screen and (min-width: 1023px) {
73
+ .singlesGroupWrapper {
74
+ width: 33.33%;
75
+ }
76
+ }
@@ -0,0 +1,50 @@
1
+ import React from 'react';
2
+ import { shape, string } from 'prop-types';
3
+ import { useStyle } from '@magento/venia-ui/lib/classify';
4
+
5
+ import Shimmer from '@magento/venia-ui/lib/components/Shimmer';
6
+ import defaultClasses from './sportCardsSets.module.css';
7
+ import cn from 'classnames';
8
+ import Divider from '@riosst100/pwa-marketplace/src/components/Divider';
9
+
10
+ const SportCardsSets = props => {
11
+ const classes = useStyle(defaultClasses, props.classes);
12
+
13
+ return (
14
+ <>
15
+ <h1 className='mx-auto relative block text-xl font-bold text-center pt-10 pb-4'><Shimmer width="25%" height="6vh" /></h1>
16
+ <div className='border border-gray-100 px-6'>
17
+ <center>
18
+ <section className='single_list-indexing-container relative m-auto pt-5'>
19
+ <Shimmer width="95%" height="6vh" />
20
+ </section>
21
+ </center>
22
+ <Divider className="mb-5 px-4" />
23
+ <section className='singles-container'>
24
+ <div className={cn('singles-wrapper block -mx-4', classes.singlesWrapper)}>
25
+ <div className='singles_group-wrapper mb-4 px-2 inline-block w-full'>
26
+ <div className='singles_item_group_letter text-xl font-semibold border-b border-gray-100 pb-1 mb-2' ><Shimmer width="95%" height="100vh" /></div>
27
+ </div>
28
+ <div className='singles_group-wrapper mb-4 px-2 inline-block w-full'>
29
+ <div className='singles_item_group_letter text-xl font-semibold border-b border-gray-100 pb-1 mb-2' ><Shimmer width="95%" height="100vh" /></div>
30
+ </div>
31
+ <div className='singles_group-wrapper mb-4 px-2 inline-block w-full'>
32
+ <div className='singles_item_group_letter text-xl font-semibold border-b border-gray-100 pb-1 mb-2' ><Shimmer width="95%" height="100vh" /></div>
33
+ </div>
34
+ <div className='singles_group-wrapper mb-4 px-2 inline-block w-full'>
35
+ <div className='singles_item_group_letter text-xl font-semibold border-b border-gray-100 pb-1 mb-2' ><Shimmer width="95%" height="100vh" /></div>
36
+ </div>
37
+ <div className='singles_group-wrapper mb-4 px-2 inline-block w-full'>
38
+ <div className='singles_item_group_letter text-xl font-semibold border-b border-gray-100 pb-1 mb-2' ><Shimmer width="95%" height="100vh" /></div>
39
+ </div>
40
+ <div className='singles_group-wrapper mb-4 px-2 inline-block w-full'>
41
+ <div className='singles_item_group_letter text-xl font-semibold border-b border-gray-100 pb-1 mb-2' ><Shimmer width="95%" height="100vh" /></div>
42
+ </div>
43
+ </div>
44
+ </section>
45
+ </div>
46
+ </>
47
+ );
48
+ };
49
+
50
+ export default SportCardsSets;
@@ -0,0 +1,33 @@
1
+ import acOperations from '../carousel.gql.ee';
2
+ import mosOperations from '../carousel.gql.ce';
3
+
4
+ export const mockGetStoreConfigAC = {
5
+ request: {
6
+ query: acOperations.getStoreConfigQuery
7
+ },
8
+ result: {
9
+ data: {
10
+ storeConfig: {
11
+ store_code: 'default',
12
+ magento_wishlist_general_is_enabled: '1',
13
+ enable_multiple_wishlists: '1',
14
+ product_url_suffix: '.html'
15
+ }
16
+ }
17
+ }
18
+ };
19
+
20
+ export const mockGetStoreConfigMOS = {
21
+ request: {
22
+ query: mosOperations.getStoreConfigQuery
23
+ },
24
+ result: {
25
+ data: {
26
+ storeConfig: {
27
+ store_code: 'default',
28
+ magento_wishlist_general_is_enabled: '1',
29
+ product_url_suffix: '.html'
30
+ }
31
+ }
32
+ }
33
+ };
@@ -0,0 +1,16 @@
1
+ import { gql } from '@apollo/client';
2
+
3
+ export const GET_STORE_CONFIG = gql`
4
+ query GetStoreConfigForCarouselMOS {
5
+ # eslint-disable-next-line @graphql-eslint/require-id-when-available
6
+ storeConfig {
7
+ store_code
8
+ product_url_suffix
9
+ magento_wishlist_general_is_enabled
10
+ }
11
+ }
12
+ `;
13
+
14
+ export default {
15
+ getStoreConfigQuery: GET_STORE_CONFIG
16
+ };
@@ -0,0 +1,17 @@
1
+ import { gql } from '@apollo/client';
2
+
3
+ export const GET_STORE_CONFIG = gql`
4
+ query GetStoreConfigForCarouselAC {
5
+ # eslint-disable-next-line @graphql-eslint/require-id-when-available
6
+ storeConfig {
7
+ store_code
8
+ product_url_suffix
9
+ magento_wishlist_general_is_enabled
10
+ enable_multiple_wishlists
11
+ }
12
+ }
13
+ `;
14
+
15
+ export default {
16
+ getStoreConfigQuery: GET_STORE_CONFIG
17
+ };
@@ -0,0 +1,38 @@
1
+ import React from 'react';
2
+ import Slider from "react-slick";
3
+ import GalleryItem from '@riosst100/pwa-marketplace/src/overwrites/venia-ui/lib/components/Gallery/item';
4
+ import { useCarousel } from './useCarousel';
5
+
6
+ const Carousel = props => {
7
+ const { settings, items } = props;
8
+ const { storeConfig } = useCarousel();
9
+
10
+ const galleryItems = items.map((item, index) => {
11
+ return (
12
+ <GalleryItem key={index} item={item} storeConfig={storeConfig} rootClassName="px-2 block product-item max-w-[240px]" />
13
+ );
14
+ });
15
+
16
+ return (
17
+ <>
18
+ <Slider {...settings} className='product-carousel -mx-2'>
19
+ {galleryItems}
20
+ </Slider>
21
+ <style global jsx>
22
+ {`
23
+ .product-carousel .slick-slide a {
24
+ text-decoration: none !important;
25
+ }
26
+ // article[class*="cms-root"] {
27
+ // padding: 0;
28
+ // }
29
+ .product-carousel .item-product img {
30
+ margin: 0 !important;
31
+ }
32
+ `}
33
+ </style>
34
+ </>
35
+ );
36
+ };
37
+
38
+ export default Carousel;
@@ -0,0 +1 @@
1
+ export { default } from './carousel';
@@ -0,0 +1,25 @@
1
+ import { useQuery } from '@apollo/client';
2
+
3
+ import { useCustomerWishlistSkus } from '@magento/peregrine/lib/hooks/useCustomerWishlistSkus/useCustomerWishlistSkus';
4
+
5
+ import mergeOperations from '@magento/peregrine/lib/util/shallowMerge';
6
+ import defaultOperations from './carousel.gql';
7
+
8
+ /**
9
+ * This is a duplicate of @magento/peregrine/lib/talons/Gallery/useGallery.js
10
+ */
11
+ export const useCarousel = (props = {}) => {
12
+ const operations = mergeOperations(defaultOperations, props.operations);
13
+
14
+ useCustomerWishlistSkus();
15
+
16
+ const { data: storeConfigData } = useQuery(operations.getStoreConfigQuery, {
17
+ fetchPolicy: 'cache-and-network'
18
+ });
19
+
20
+ const storeConfig = storeConfigData ? storeConfigData.storeConfig : null;
21
+
22
+ return {
23
+ storeConfig
24
+ };
25
+ };
@@ -0,0 +1,26 @@
1
+ import { getAdvanced } from '../../utils';
2
+
3
+ export default (node, props) => {
4
+ const forms = node.querySelectorAll(
5
+ '.product-item-details > .product-item-name > a.product-item-link'
6
+ );
7
+ let carouselConfig = {};
8
+
9
+ if (props.appearance === 'carousel') {
10
+ carouselConfig = {
11
+ autoplay: node.getAttribute('data-autoplay') === 'true',
12
+ autoplaySpeed: parseInt(node.getAttribute('data-autoplay-speed')),
13
+ infinite: node.getAttribute('data-infinite-loop') === 'true',
14
+ arrows: node.getAttribute('data-show-arrows') === 'true',
15
+ dots: node.getAttribute('data-show-dots') === 'true',
16
+ carouselMode: node.getAttribute('data-carousel-mode'),
17
+ centerPadding: node.getAttribute('data-center-padding')
18
+ };
19
+ }
20
+
21
+ return {
22
+ pathNames: [...forms].map(form => form.getAttribute('href')),
23
+ ...carouselConfig,
24
+ ...getAdvanced(node)
25
+ };
26
+ };
@@ -0,0 +1 @@
1
+ export { default } from './products';