@riosst100/pwa-marketplace 1.7.0 → 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.
- package/package.json +1 -1
- package/src/componentOverrideMapping.js +4 -0
- package/src/components/CollectibleGameSets/collectibleGameSets.js +0 -4
- package/src/components/FilterTop/filterTop.js +0 -2
- package/src/components/FilterTopBackup/CustomFilters/customFilters.js +0 -1
- package/src/components/ProductLabel/index.js +13 -5
- package/src/components/ProductListTab/productListTab.js +1 -3
- package/src/components/RelatedProduct/relatedProduct.js +1 -1
- package/src/components/ShopBy/shopBy copy.js +0 -1
- package/src/components/ShopBy/shopBy.js +0 -1
- package/src/components/ShopBySets/shopBySets.js +0 -3
- package/src/components/SportCardsSets/index.js +2 -0
- package/src/components/SportCardsSets/sportCardsSets.js +372 -0
- package/src/components/SportCardsSets/sportCardsSets.module.css +76 -0
- package/src/components/SportCardsSets/sportCardsSets.shimmer.js +50 -0
- package/src/overwrites/pagebuilder/lib/ContentTypes/Products/Carousel/__fixtures__/apolloMocks.js +33 -0
- package/src/overwrites/pagebuilder/lib/ContentTypes/Products/Carousel/carousel.gql.ce.js +16 -0
- package/src/overwrites/pagebuilder/lib/ContentTypes/Products/Carousel/carousel.gql.ee.js +17 -0
- package/src/overwrites/pagebuilder/lib/ContentTypes/Products/Carousel/carousel.js +38 -0
- package/src/overwrites/pagebuilder/lib/ContentTypes/Products/Carousel/index.js +1 -0
- package/src/overwrites/pagebuilder/lib/ContentTypes/Products/Carousel/useCarousel.js +25 -0
- package/src/overwrites/pagebuilder/lib/ContentTypes/Products/configAggregator.js +26 -0
- package/src/overwrites/pagebuilder/lib/ContentTypes/Products/index.js +1 -0
- package/src/overwrites/pagebuilder/lib/ContentTypes/Products/products.js +369 -0
- package/src/overwrites/pagebuilder/lib/ContentTypes/Products/products.module.css +0 -0
- package/src/overwrites/pagebuilder/lib/ContentTypes/Slider/banner.module.css +103 -0
- package/src/overwrites/pagebuilder/lib/ContentTypes/Slider/configAggregator.js +17 -0
- package/src/overwrites/pagebuilder/lib/ContentTypes/Slider/index.js +2 -0
- package/src/overwrites/pagebuilder/lib/ContentTypes/Slider/slider.js +221 -0
- package/src/overwrites/pagebuilder/lib/ContentTypes/Slider/slider.module.css +231 -0
- package/src/overwrites/pagebuilder/lib/ContentTypes/Slider/slider.shimmer.js +126 -0
- package/src/overwrites/pagebuilder/lib/ContentTypes/Slider/slider.shimmer.module.css +5 -0
- package/src/overwrites/pagebuilder/lib/utils.js +224 -0
- package/src/overwrites/peregrine/lib/talons/FilterSidebar/useFilterSidebar.js +1 -1
- package/src/overwrites/peregrine/lib/talons/ProductFullDetail/useProductFullDetail.js +3 -1
- package/src/overwrites/peregrine/lib/talons/RootComponents/Category/categoryFragments.gql.js +3 -0
- package/src/overwrites/peregrine/lib/talons/RootComponents/Product/productDetailFragment.gql.js +39 -0
- package/src/overwrites/venia-ui/lib/RootComponents/CMS/cms.js +73 -0
- package/src/overwrites/venia-ui/lib/RootComponents/CMS/cms.module.css +25 -0
- package/src/overwrites/venia-ui/lib/RootComponents/CMS/cms.shimmer.js +18 -0
- package/src/overwrites/venia-ui/lib/RootComponents/CMS/index.js +7 -0
- package/src/overwrites/venia-ui/lib/RootComponents/Category/category.js +12 -1
- package/src/overwrites/venia-ui/lib/RootComponents/Category/categoryContent.js +1 -13
- package/src/overwrites/venia-ui/lib/components/App/app.js +131 -0
- package/src/overwrites/venia-ui/lib/components/FilterModal/CurrentFilters/currentFilters.js +1 -1
- package/src/overwrites/venia-ui/lib/components/FilterSidebar/filterSidebar.js +1 -1
- package/src/overwrites/venia-ui/lib/components/Gallery/item.js +9 -2
- package/src/overwrites/venia-ui/lib/components/Gallery/item.module.css +1 -1
- package/src/overwrites/venia-ui/lib/components/ProductFullDetail/components/auctionDetail.js +176 -138
- package/src/overwrites/venia-ui/lib/components/ProductFullDetail/components/preOrderDetail.js +1 -4
- package/src/overwrites/venia-ui/lib/components/ProductFullDetail/productFullDetail.js +1 -1
- package/src/overwrites/venia-ui/lib/components/RichContent/richContent.module.css +3 -3
- package/src/overwrites/venia-ui/lib/components/SearchBar/searchBar.js +0 -1
- package/src/overwrites/venia-ui/lib/index.module.css +137 -0
- package/src/overwrites/venia-ui/lib/tokens.module.css +167 -0
- package/src/talons/CollectibleGameSets/collectibleGameSets.gql.js +15 -1
- package/src/talons/CollectibleGameSets/useCollectibleGameSets.js +0 -11
- package/src/talons/FilterTop/useFilterTop.js +0 -2
- package/src/talons/ShopBy/useShopBy.js +0 -22
- package/src/talons/SportCardsSets/sportCardsSets.gql.js +46 -0
- package/src/talons/SportCardsSets/useSportCardsSets.js +170 -0
- package/src/talons/SubCategoryPage/useSubCategoryPage.js +0 -3
package/package.json
CHANGED
|
@@ -45,4 +45,8 @@ module.exports = componentOverrideMapping = {
|
|
|
45
45
|
[`@magento/venia-ui/lib/components/Main/index.js`]: '@riosst100/pwa-marketplace/src/overwrites/venia-ui/lib/components/Main/index.js',
|
|
46
46
|
[`@magento/venia-ui/lib/components/Footer/index.js`]: '@riosst100/pwa-marketplace/src/overwrites/venia-ui/lib/components/Footer/index.js',
|
|
47
47
|
[`@magento/venia-ui/lib/components/Newsletter/index.js`]: '@riosst100/pwa-marketplace/src/overwrites/venia-ui/lib/components/Newsletter/index.js',
|
|
48
|
+
[`@magento/pagebuilder/lib/ContentTypes/Products/index.js`]: '@riosst100/pwa-marketplace/src/overwrites/pagebuilder/lib/ContentTypes/Products/index.js',
|
|
49
|
+
[`@magento/venia-ui/lib/RootComponents/CMS/index.js`]: '@riosst100/pwa-marketplace/src/overwrites/venia-ui/lib/RootComponents/CMS/index.js',
|
|
50
|
+
[`@magento/pagebuilder/lib/ContentTypes/Slider/index.js`]: '@riosst100/pwa-marketplace/src/overwrites/pagebuilder/lib/ContentTypes/Slider/index.js',
|
|
51
|
+
[`@magento/venia-ui/lib/components/App/app.js`]: '@riosst100/pwa-marketplace/src/overwrites/venia-ui/lib/components/App/app.js',
|
|
48
52
|
};
|
|
@@ -51,16 +51,12 @@ const CollectibleGameSets = props => {
|
|
|
51
51
|
// value: 'all'
|
|
52
52
|
// });
|
|
53
53
|
|
|
54
|
-
// console.log(currentSort)
|
|
55
|
-
|
|
56
54
|
const classes = useStyle(defaultClasses);
|
|
57
55
|
|
|
58
56
|
const talonProps = useCollectibleGameSets({ searchQuery, setActive, currentSort });
|
|
59
57
|
|
|
60
58
|
const { error, loading, collectibleGameSets, categoryUrlSuffix, categoryUrlKey, productType, filteredCollectibleGameSets, availableGroups } = talonProps;
|
|
61
59
|
|
|
62
|
-
console.log(availableGroups)
|
|
63
|
-
|
|
64
60
|
if (loading && !collectibleGameSets)
|
|
65
61
|
return <CollectibleGameSetsShimmer />;
|
|
66
62
|
if (error && !collectibleGameSets) return <ErrorView />;
|
|
@@ -84,8 +84,6 @@ const FilterTop = props => {
|
|
|
84
84
|
// });
|
|
85
85
|
// const allowedFiltersArr = ['card_rarity','card_print_version','card_set', 'card_product_type'];
|
|
86
86
|
|
|
87
|
-
// console.log(customFilters)
|
|
88
|
-
|
|
89
87
|
const filtersList = useMemo(
|
|
90
88
|
() =>
|
|
91
89
|
Array.from(filterItems, ([group, items], iteration) => {
|
|
@@ -9,6 +9,14 @@ const ProductLabel = (props) => {
|
|
|
9
9
|
|
|
10
10
|
const preorderData = item ? item.preorder : null;
|
|
11
11
|
const isPreOrder = preorderData && preorderData.is_preorder ? true : false;
|
|
12
|
+
|
|
13
|
+
const auctionData = item ? item.auction_data : null;
|
|
14
|
+
const isAuction = auctionData && auctionData.is_auction ? true : false;
|
|
15
|
+
|
|
16
|
+
const priceRangeData = item?.price_range;
|
|
17
|
+
|
|
18
|
+
const salePrice = priceRangeData?.maximum_price?.discount?.amount_off;
|
|
19
|
+
const regularPrice = priceRangeData?.maximum_price?.regular_price?.value;
|
|
12
20
|
|
|
13
21
|
return (
|
|
14
22
|
<div
|
|
@@ -17,21 +25,21 @@ const ProductLabel = (props) => {
|
|
|
17
25
|
rootClassName
|
|
18
26
|
)}
|
|
19
27
|
>
|
|
20
|
-
{
|
|
28
|
+
{salePrice > 0 && <div className='bg-yellow-400 rounded px-2.5 py-[6px] w-fit top-0 left-0'>
|
|
21
29
|
<span className='text-white text-xs font-medium'>
|
|
22
|
-
|
|
30
|
+
{salePrice/regularPrice*100}% off
|
|
23
31
|
</span>
|
|
24
|
-
</div>
|
|
32
|
+
</div>}
|
|
25
33
|
{isPreOrder && <div className='bg-darkblue-900 rounded px-2.5 py-[6px] w-fit top-0 left-0'>
|
|
26
34
|
<span className='text-white text-xs font-medium'>
|
|
27
35
|
Pre Order
|
|
28
36
|
</span>
|
|
29
37
|
</div>}
|
|
30
|
-
{
|
|
38
|
+
{isAuction && <div className='bg-blue-700 rounded px-2.5 py-[6px] w-fit top-0 left-0'>
|
|
31
39
|
<span className='text-white text-xs font-medium'>
|
|
32
40
|
Auction
|
|
33
41
|
</span>
|
|
34
|
-
</div>
|
|
42
|
+
</div>}
|
|
35
43
|
</div>
|
|
36
44
|
)
|
|
37
45
|
}
|
|
@@ -33,7 +33,7 @@ const ProductListTab = props => {
|
|
|
33
33
|
},
|
|
34
34
|
{
|
|
35
35
|
'label': 'Sale',
|
|
36
|
-
'value': '
|
|
36
|
+
'value': 'special_price'
|
|
37
37
|
},
|
|
38
38
|
{
|
|
39
39
|
'label': 'Pre Order',
|
|
@@ -46,8 +46,6 @@ const ProductListTab = props => {
|
|
|
46
46
|
];
|
|
47
47
|
|
|
48
48
|
const handleClickremove = useCallback((group, item) => {
|
|
49
|
-
console.log(group)
|
|
50
|
-
console.log(item)
|
|
51
49
|
removeItem({ group, item });
|
|
52
50
|
if (typeof handleApply === 'function') {
|
|
53
51
|
handleApply(group, item);
|
|
@@ -54,7 +54,6 @@ const ShopBySets = props => {
|
|
|
54
54
|
// value: 'all'
|
|
55
55
|
// });
|
|
56
56
|
|
|
57
|
-
// console.log(currentSort)
|
|
58
57
|
|
|
59
58
|
const classes = useStyle(defaultClasses);
|
|
60
59
|
|
|
@@ -113,7 +112,6 @@ const ShopBySets = props => {
|
|
|
113
112
|
})
|
|
114
113
|
}
|
|
115
114
|
|
|
116
|
-
// console.log('setsResult: '+setsResult.length);
|
|
117
115
|
let setsResultSplitted = [];
|
|
118
116
|
if (active == release_type || newCollectibleGameSets.length == 1) {
|
|
119
117
|
setsResultSplitted = splitToNChunks(setsResult, 3);
|
|
@@ -201,7 +199,6 @@ const ShopBySets = props => {
|
|
|
201
199
|
title = "By Year";
|
|
202
200
|
}
|
|
203
201
|
|
|
204
|
-
console.log(availableGroups)
|
|
205
202
|
|
|
206
203
|
return (
|
|
207
204
|
<Fragment>
|
|
@@ -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;
|