@riosst100/pwa-marketplace 1.6.4 → 1.6.6
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/components/CollectibleGameSets/collectibleGameSets.js +88 -40
- package/src/components/CollectibleGameSets/collectibleGameSets.shimmer.js +1 -1
- package/src/components/CustomSubCategoryPage/subCategoryPage.js +1 -1
- package/src/components/ProductListTab/productListTab.js +28 -15
- package/src/components/ProductListTab/productListTab.module.css +0 -1
- package/src/components/ShopBy/shopBy.js +2 -2
- package/src/components/ShopBy/shopBy.shimmer.js +1 -1
- package/src/overwrites/venia-ui/lib/RootComponents/Category/categoryContent.js +2 -1
- package/src/talons/CollectibleGameSets/useCollectibleGameSets.js +6 -3
package/package.json
CHANGED
|
@@ -18,11 +18,31 @@ const CollectibleGameSets = props => {
|
|
|
18
18
|
|
|
19
19
|
const [searchQuery, setSearchQuery] = useState('');
|
|
20
20
|
|
|
21
|
-
|
|
22
|
-
|
|
21
|
+
const { location } = globalThis;
|
|
22
|
+
|
|
23
|
+
const query = new URLSearchParams(location.search);
|
|
24
|
+
const shopby = query.get('shopby') || null;
|
|
25
|
+
|
|
26
|
+
let defaultSort = {
|
|
23
27
|
sortText: 'All (A-Z)',
|
|
24
28
|
value: 'all'
|
|
25
|
-
}
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
if (shopby == "release_year") {
|
|
32
|
+
defaultSort = {
|
|
33
|
+
sortText: 'All (By Year)',
|
|
34
|
+
value: 'date'
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
// if (productType == "expansion-sets") {
|
|
39
|
+
// defaultSort = {
|
|
40
|
+
// sortText: 'All (Expansion Sets)',
|
|
41
|
+
// value: 'all'
|
|
42
|
+
// };
|
|
43
|
+
// }
|
|
44
|
+
|
|
45
|
+
const sortProps = useCustomSort({ sortFromSearch: false, defaultSort: defaultSort});
|
|
26
46
|
|
|
27
47
|
const [currentSort] = sortProps;
|
|
28
48
|
|
|
@@ -37,7 +57,9 @@ const CollectibleGameSets = props => {
|
|
|
37
57
|
|
|
38
58
|
const talonProps = useCollectibleGameSets({ searchQuery, setActive, currentSort });
|
|
39
59
|
|
|
40
|
-
const { error, loading, collectibleGameSets, categoryUrlSuffix, categoryUrlKey, productType, filteredCollectibleGameSets } = talonProps;
|
|
60
|
+
const { error, loading, collectibleGameSets, categoryUrlSuffix, categoryUrlKey, productType, filteredCollectibleGameSets, availableGroups } = talonProps;
|
|
61
|
+
|
|
62
|
+
console.log(availableGroups)
|
|
41
63
|
|
|
42
64
|
if (loading && !collectibleGameSets)
|
|
43
65
|
return <CollectibleGameSetsShimmer />;
|
|
@@ -104,9 +126,9 @@ const CollectibleGameSets = props => {
|
|
|
104
126
|
setSearchQuery('')
|
|
105
127
|
}
|
|
106
128
|
|
|
107
|
-
|
|
129
|
+
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'];
|
|
108
130
|
|
|
109
|
-
|
|
131
|
+
let availableSortBy = [
|
|
110
132
|
{
|
|
111
133
|
'label': 'All (A-Z)',
|
|
112
134
|
'value': 'all'
|
|
@@ -114,18 +136,46 @@ const CollectibleGameSets = props => {
|
|
|
114
136
|
{
|
|
115
137
|
'label': 'Latest Sets',
|
|
116
138
|
'value': 'newest'
|
|
117
|
-
},
|
|
118
|
-
{
|
|
119
|
-
'label': 'By Date',
|
|
120
|
-
'value': 'date'
|
|
121
139
|
}
|
|
122
140
|
];
|
|
123
141
|
|
|
142
|
+
if (shopby == "release_year") {
|
|
143
|
+
availableSortBy = [
|
|
144
|
+
{
|
|
145
|
+
'label': 'All (By Year)',
|
|
146
|
+
'value': 'date'
|
|
147
|
+
},
|
|
148
|
+
{
|
|
149
|
+
'label': 'Latest Sets',
|
|
150
|
+
'value': 'newest'
|
|
151
|
+
}
|
|
152
|
+
];
|
|
153
|
+
|
|
154
|
+
alpha = availableGroups;
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
if (productType == "expansion-sets") {
|
|
158
|
+
// availableSortBy = [
|
|
159
|
+
// {
|
|
160
|
+
// 'label': 'All (Expansion Sets)',
|
|
161
|
+
// 'value': 'all'
|
|
162
|
+
// },
|
|
163
|
+
// {
|
|
164
|
+
// 'label': 'Latest Sets',
|
|
165
|
+
// 'value': 'newest'
|
|
166
|
+
// }
|
|
167
|
+
// ];
|
|
168
|
+
|
|
169
|
+
alpha = availableGroups
|
|
170
|
+
}
|
|
171
|
+
|
|
124
172
|
let title = "All Sets";
|
|
125
173
|
if (productType == "expansion-sets") {
|
|
126
174
|
title = "Expansion Sets";
|
|
127
175
|
} else if (productType == "artist") {
|
|
128
|
-
title = "Artist";
|
|
176
|
+
title = "By Artist";
|
|
177
|
+
} else if (shopby == "release_year") {
|
|
178
|
+
title = "By Year";
|
|
129
179
|
}
|
|
130
180
|
|
|
131
181
|
return (
|
|
@@ -143,44 +193,42 @@ const CollectibleGameSets = props => {
|
|
|
143
193
|
<CustomSortBy sortProps={sortProps} availableSortMethods={availableSortBy} />
|
|
144
194
|
</div>
|
|
145
195
|
) : ''}
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
<
|
|
149
|
-
<
|
|
150
|
-
<
|
|
196
|
+
<>
|
|
197
|
+
<section className='single_list-indexing-container relative m-auto pt-5'>
|
|
198
|
+
<ul className='flex gap-2 justify-center flex-wrap'>
|
|
199
|
+
<li>
|
|
200
|
+
<button
|
|
201
|
+
className={cn(
|
|
202
|
+
'rounded-md border border-solid border-gray-100 p-2 min-w-[28px]',
|
|
203
|
+
'leading-4 font-medium text-base hover_bg-gray-50'
|
|
204
|
+
)}
|
|
205
|
+
onClick={() => {
|
|
206
|
+
handleActive('all')
|
|
207
|
+
}}
|
|
208
|
+
>
|
|
209
|
+
{active == 'all' ? <b>All</b> : 'All'}
|
|
210
|
+
</button>
|
|
211
|
+
</li>
|
|
212
|
+
{alpha.map((letter, index) => (
|
|
213
|
+
<li key={index}>
|
|
151
214
|
<button
|
|
152
215
|
className={cn(
|
|
153
216
|
'rounded-md border border-solid border-gray-100 p-2 min-w-[28px]',
|
|
154
|
-
'leading-4 font-medium text-base
|
|
217
|
+
'leading-4 font-medium text-base ',
|
|
218
|
+
setsLengthArr[letter] > 0 ? 'hover_bg-gray-50' : 'bg-gray-100 text-gray-400',
|
|
155
219
|
)}
|
|
156
220
|
onClick={() => {
|
|
157
|
-
handleActive(
|
|
221
|
+
handleActive(letter)
|
|
158
222
|
}}
|
|
223
|
+
disabled={setsLengthArr[letter] > 0 ? false : true}
|
|
159
224
|
>
|
|
160
|
-
{active ==
|
|
225
|
+
{active == letter ? <b>{letter}</b> : letter}
|
|
161
226
|
</button>
|
|
162
227
|
</li>
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
'rounded-md border border-solid border-gray-100 p-2 min-w-[28px]',
|
|
168
|
-
'leading-4 font-medium text-base ',
|
|
169
|
-
setsLengthArr[letter] > 0 ? 'hover_bg-gray-50' : 'bg-gray-100 text-gray-400',
|
|
170
|
-
)}
|
|
171
|
-
onClick={() => {
|
|
172
|
-
handleActive(letter)
|
|
173
|
-
}}
|
|
174
|
-
disabled={setsLengthArr[letter] > 0 ? false : true}
|
|
175
|
-
>
|
|
176
|
-
{active == letter ? <b>{letter}</b> : letter}
|
|
177
|
-
</button>
|
|
178
|
-
</li>
|
|
179
|
-
))}
|
|
180
|
-
</ul>
|
|
181
|
-
</section>
|
|
182
|
-
</>
|
|
183
|
-
) : ''}
|
|
228
|
+
))}
|
|
229
|
+
</ul>
|
|
230
|
+
</section>
|
|
231
|
+
</>
|
|
184
232
|
<Divider className="mb-5 px-4 mt-5" />
|
|
185
233
|
<section className='singles-container'>
|
|
186
234
|
<div className={cn('singles-wrapper block -mx-4', classes.singlesWrapper)}>
|
|
@@ -15,7 +15,7 @@ const CollectibleGameSets = props => {
|
|
|
15
15
|
<h1 className='mx-auto relative block text-xl font-bold text-center pt-10 pb-4'><Shimmer width="25%" height="6vh" /></h1>
|
|
16
16
|
<div className='border border-gray-100 px-6'>
|
|
17
17
|
<center>
|
|
18
|
-
<section className='single_list-indexing-container relative m-auto
|
|
18
|
+
<section className='single_list-indexing-container relative m-auto pt-5'>
|
|
19
19
|
<Shimmer width="95%" height="6vh" />
|
|
20
20
|
</section>
|
|
21
21
|
</center>
|
|
@@ -83,7 +83,7 @@ const SubCategoryPage = props => {
|
|
|
83
83
|
</div>
|
|
84
84
|
) : ''}
|
|
85
85
|
<>
|
|
86
|
-
<section className='single_list-indexing-container relative m-auto
|
|
86
|
+
<section className='single_list-indexing-container relative m-auto pt-5'>
|
|
87
87
|
<ul className='flex gap-2 justify-center flex-wrap'>
|
|
88
88
|
<li>
|
|
89
89
|
<button
|
|
@@ -6,32 +6,45 @@ import defaultClasses from './productListTab.module.css';
|
|
|
6
6
|
|
|
7
7
|
const ProductListTab = props => {
|
|
8
8
|
|
|
9
|
-
const
|
|
9
|
+
const { activeTab, setActiveTab } = props
|
|
10
10
|
|
|
11
|
-
const
|
|
11
|
+
const classes = useStyle(defaultClasses, props.classes);
|
|
12
12
|
|
|
13
13
|
let allProductClass = classes.firstButton;
|
|
14
14
|
if (!activeTab) {
|
|
15
15
|
allProductClass = classes.activeFirstButton;
|
|
16
16
|
}
|
|
17
17
|
|
|
18
|
+
const productTabs = [
|
|
19
|
+
{
|
|
20
|
+
'label': 'All Products',
|
|
21
|
+
'value': 'all'
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
'label': 'Sale',
|
|
25
|
+
'value': 'sale'
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
'label': 'Pre Order',
|
|
29
|
+
'value': 'preorder'
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
'label': 'Auction',
|
|
33
|
+
'value': 'auction'
|
|
34
|
+
}
|
|
35
|
+
];
|
|
36
|
+
|
|
18
37
|
return (
|
|
19
38
|
<div className={classes.root} aria-busy="true">
|
|
20
|
-
{/* <FormattedMessage
|
|
21
|
-
id={'searchPage.sortContainer'}
|
|
22
|
-
defaultMessage={'Items sorted by '}
|
|
23
|
-
/>
|
|
24
|
-
<span className={classes.sortText}>
|
|
25
|
-
<FormattedMessage
|
|
26
|
-
id={currentSort.sortId}
|
|
27
|
-
defaultMessage={currentSort.sortText}
|
|
28
|
-
/>
|
|
29
|
-
</span> */}
|
|
30
39
|
<nav>
|
|
31
40
|
<ul className={classes.buttonContainer}>
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
41
|
+
{productTabs.map(({label, value}, index) =>
|
|
42
|
+
<li key={index}>
|
|
43
|
+
<button onClick={() => setActiveTab(value)} className={
|
|
44
|
+
(index == 0 ? classes.firstButton : (index == productTabs.length-1 ? classes.lastButton : classes.middleButton)) + (activeTab == value ? ' ' + classes.activeButton : '')
|
|
45
|
+
}>{label}</button>
|
|
46
|
+
</li>
|
|
47
|
+
)}
|
|
35
48
|
</ul>
|
|
36
49
|
</nav>
|
|
37
50
|
</div>
|
|
@@ -174,7 +174,7 @@ const ShopBy = props => {
|
|
|
174
174
|
<Fragment>
|
|
175
175
|
<StoreTitle>{attributeData ? category.name + ' | ' + attributeData.label : 'Shop By'}</StoreTitle>
|
|
176
176
|
<h1 className='mx-auto relative block text-xl font-bold text-center pt-10 pb-4'>
|
|
177
|
-
{attributeData ?
|
|
177
|
+
{attributeData ? 'By ' + attributeData.label : 'Shop By'}
|
|
178
178
|
</h1>
|
|
179
179
|
<div className='border border-gray-100 px-6'>
|
|
180
180
|
{dataResult ? (
|
|
@@ -187,7 +187,7 @@ const ShopBy = props => {
|
|
|
187
187
|
) : ''}
|
|
188
188
|
{productType != "expansion-sets" ? (
|
|
189
189
|
<>
|
|
190
|
-
<section className='single_list-indexing-container relative m-auto
|
|
190
|
+
<section className='single_list-indexing-container relative m-auto pt-5'>
|
|
191
191
|
<ul className='flex gap-2 justify-center flex-wrap'>
|
|
192
192
|
<li>
|
|
193
193
|
<button
|
|
@@ -15,7 +15,7 @@ const ShopBy = props => {
|
|
|
15
15
|
<h1 className='mx-auto relative block text-xl font-bold text-center pt-10 pb-4'><Shimmer width="25%" height="6vh" /></h1>
|
|
16
16
|
<div className='border border-gray-100 px-6'>
|
|
17
17
|
<center>
|
|
18
|
-
<section className='single_list-indexing-container relative m-auto
|
|
18
|
+
<section className='single_list-indexing-container relative m-auto pt-5'>
|
|
19
19
|
<Shimmer width="95%" height="6vh" />
|
|
20
20
|
</section>
|
|
21
21
|
</center>
|
|
@@ -75,6 +75,7 @@ const CategoryContent = props => {
|
|
|
75
75
|
} = talonProps;
|
|
76
76
|
|
|
77
77
|
const [activeLetter, setActiveLetter] = useState('all')
|
|
78
|
+
const [activeTab, setActiveTab] = useState('all');
|
|
78
79
|
|
|
79
80
|
const handleActiveLetter = (val) => {
|
|
80
81
|
setActiveLetter(val);
|
|
@@ -164,7 +165,7 @@ const CategoryContent = props => {
|
|
|
164
165
|
) : null;
|
|
165
166
|
|
|
166
167
|
const maybeProductsTabContainer = shouldShowProductListTab ? (
|
|
167
|
-
<ProductListTab />
|
|
168
|
+
<ProductListTab activeTab={activeTab} setActiveTab={setActiveTab} />
|
|
168
169
|
) : shouldShowProductListTabShimmer ? (
|
|
169
170
|
<ProductListTabShimmer />
|
|
170
171
|
) : null;
|
|
@@ -76,7 +76,7 @@ export const useCollectibleGameSets = props => {
|
|
|
76
76
|
if (result) {
|
|
77
77
|
result.sets.push(set)
|
|
78
78
|
} else {
|
|
79
|
-
if (sortby == "date" || sortby == "newest" && sortbyData.length
|
|
79
|
+
if (sortby == "date" || sortby == "newest" && sortbyData.length < 2) {
|
|
80
80
|
sortbyData.push({
|
|
81
81
|
'release_type': release_year,
|
|
82
82
|
'sets': [set]
|
|
@@ -92,6 +92,8 @@ export const useCollectibleGameSets = props => {
|
|
|
92
92
|
return sortby != "all" ? sortbyData && sortbyData.length ? sortbyData.sort((a, b) => b.release_type.toLowerCase().localeCompare(a.release_type.toLowerCase())) : sortbyData : collectibleGameSets.slice().sort((a, b) => a.release_type.toLowerCase().localeCompare(b.release_type.toLowerCase()));
|
|
93
93
|
}, [data, sortby]);
|
|
94
94
|
|
|
95
|
+
const availableGroups = collectibleGameSets.map(({ release_type }) => release_type);
|
|
96
|
+
|
|
95
97
|
// console.log(collectibleGameSets)
|
|
96
98
|
|
|
97
99
|
const filteredCollectibleGameSets = useMemo(() => {
|
|
@@ -115,7 +117,7 @@ export const useCollectibleGameSets = props => {
|
|
|
115
117
|
|
|
116
118
|
if (newSets && newSets.length) {
|
|
117
119
|
filteredSets.push({
|
|
118
|
-
'release_type':
|
|
120
|
+
'release_type': release_type,
|
|
119
121
|
'sets': newSets
|
|
120
122
|
})
|
|
121
123
|
}
|
|
@@ -138,6 +140,7 @@ export const useCollectibleGameSets = props => {
|
|
|
138
140
|
filteredCollectibleGameSets,
|
|
139
141
|
categoryUrlSuffix,
|
|
140
142
|
categoryUrlKey,
|
|
141
|
-
productType
|
|
143
|
+
productType,
|
|
144
|
+
availableGroups
|
|
142
145
|
};
|
|
143
146
|
};
|