@riosst100/pwa-marketplace 1.7.8 → 1.8.0

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@riosst100/pwa-marketplace",
3
3
  "author": "riosst100@gmail.com",
4
- "version": "1.7.8",
4
+ "version": "1.8.0",
5
5
  "main": "src/index.js",
6
6
  "pwa-studio": {
7
7
  "targets": {
@@ -0,0 +1,2 @@
1
+ export { default } from './legoSets';
2
+ export { default as LegoSetsShimmer } from './legoSets.shimmer';
@@ -0,0 +1,330 @@
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 { useLegoSets } from '@riosst100/pwa-marketplace/src/talons/LegoSets/useLegoSets';
5
+ import { Link } from 'react-router-dom';
6
+ import resourceUrl from '@magento/peregrine/lib/util/makeUrl';
7
+ import defaultClasses from './legoSets.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 { LegoSetsShimmer } from '@riosst100/pwa-marketplace/src/components/LegoSets';
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 LegoSets = props => {
18
+ const { categoryId } = props
19
+
20
+ const { location } = globalThis;
21
+
22
+ const query = new URLSearchParams(location.search);
23
+ const activeParam = query.get('active_tab') || null;
24
+
25
+ const [active, setActive] = useState('all');
26
+ const [activeTab, setActiveTab] = useState('all');
27
+ const [activeFilter, setActiveFilter] = useState('Major Baseball League');
28
+
29
+ const [searchQuery, setSearchQuery] = useState('');
30
+
31
+ let availableLeagues = [];
32
+ let availableBrands = [];
33
+
34
+ const shopby = query.get('shopby') || null;
35
+ const setType = query.get('set_type') || null;
36
+ const brandsFilter = query.get('sc_brands[filter]') || null;
37
+
38
+ let defaultSort = {
39
+ sortText: 'All (A-Z)',
40
+ value: 'all'
41
+ };
42
+
43
+ if (shopby == "release_year") {
44
+ defaultSort = {
45
+ sortText: 'All (By Year)',
46
+ value: 'date'
47
+ };
48
+ }
49
+
50
+ // if (productType == "expansion_sets") {
51
+ // defaultSort = {
52
+ // sortText: 'All (Expansion Sets)',
53
+ // value: 'all'
54
+ // };
55
+ // }
56
+
57
+ // Sorting
58
+ const sortProps = useCustomSort({ sortFromSearch: false, defaultSort: defaultSort});
59
+ const [currentSort] = sortProps;
60
+ const [sortBy, setSortBy] = useState({
61
+ sortText: 'All (A-Z)',
62
+ value: 'all'
63
+ });
64
+
65
+ let availableSortBy = [
66
+ {
67
+ 'label': 'All (A-Z)',
68
+ 'value': 'all'
69
+ },
70
+ {
71
+ 'label': 'By Year',
72
+ 'value': 'newest'
73
+ }
74
+ ];
75
+
76
+ const classes = useStyle(defaultClasses);
77
+
78
+ const talonProps = useLegoSets({ searchQuery, setActive, currentSort, shopby, setType, categoryId, activeTab, activeFilter });
79
+
80
+ const { error, loading, legoSets, categoryUrlSuffix, categoryUrlKey, productType, filteredLegoSets, availableGroups, category } = talonProps;
81
+
82
+ if (loading && !legoSets)
83
+ return <LegoSetsShimmer />;
84
+ if (error && !legoSets) return <ErrorView />;
85
+
86
+ if (!legoSets && !loading && !error) {
87
+ return <LegoSetsShimmer />;
88
+ }
89
+
90
+ const setsLengthArr = [];
91
+
92
+ const newLegoSets = searchQuery ? filteredLegoSets : legoSets;
93
+
94
+ // useEffect(() => {
95
+ if (legoSets && legoSets.length) {
96
+ legoSets.map((setRelease, index) => {
97
+ const { group, sets } = setRelease;
98
+
99
+ // if (sets.length) {
100
+ // sets.map((set, index) => {
101
+ // // console.log(set)
102
+ // if (set.sc_league) {
103
+ // if (!availableLeagues.includes(set.sc_league)) {
104
+ // availableLeagues.push(set.sc_league)
105
+ // }
106
+ // }
107
+ // })
108
+ // }
109
+
110
+ setsLengthArr[group] = sets.length
111
+ })
112
+ }
113
+ // }, [legoSets])
114
+
115
+ if (legoSets && legoSets.length) {
116
+ legoSets.map((setRelease, index) => {
117
+ const { group, sets } = setRelease;
118
+ if (active == 'all' || active != "all" && active == group) {
119
+ if (sets.length) {
120
+ sets.map((set, index) => {
121
+ // console.log(set)
122
+ if (set.sc_league) {
123
+ if (!availableLeagues.includes(set.sc_league)) {
124
+ availableLeagues.push(set.sc_league)
125
+ }
126
+ }
127
+
128
+ if (set.sc_brands) {
129
+ if (!availableBrands.includes(set.sc_brands)) {
130
+ availableBrands.push(set.sc_brands)
131
+ }
132
+ }
133
+
134
+ // availableBrands
135
+ })
136
+ }
137
+ }
138
+ })
139
+ }
140
+
141
+ const splitToNChunks = (array, n) => {
142
+ let result = [];
143
+ for (let i = n; i > 0; i--) {
144
+ result.push(array.splice(0, Math.ceil(array.length / i)));
145
+ }
146
+ return result;
147
+ }
148
+
149
+ const setRelases = newLegoSets && newLegoSets.length && newLegoSets.map((setRelease, index) => {
150
+ const { group, sets } = setRelease;
151
+
152
+ const setsResult = [];
153
+
154
+ if (sets.length) {
155
+ sets.map((set, index) => {
156
+ const { set_name, option_id, release_year } = set;
157
+
158
+ const categoryUrl = resourceUrl(
159
+ `/${category?.url_path}${categoryUrlSuffix || ''}?sc_${category?.url_key}_release[filter]=${set_name},${option_id}`
160
+ );
161
+
162
+ setsResult.push(<li className='list-none'>
163
+ <Link to={categoryUrl} className="hover_bg-darkblue-900 hover_text-white w-full block text-[14px] py-[2px] px-2">
164
+ {set_name}
165
+ </Link>
166
+ </li>)
167
+ })
168
+ }
169
+
170
+ let setsResultSplitted = [];
171
+ if (active == group || newLegoSets.length == 1) {
172
+ setsResultSplitted = splitToNChunks(setsResult, 3);
173
+ }
174
+
175
+ return (
176
+ <>
177
+ {active == "all" && newLegoSets.length > 1 ?
178
+ <div className={cn('singles_group-wrapper mb-4 px-2 inline-block', classes.singlesGroupWrapper)}>
179
+ <div className='singles_item_group_letter text-xl font-semibold border-b border-gray-100 pb-1 mb-2' >
180
+ {group}
181
+ </div>
182
+ <div className={cn('singles_item-list flex flex-col')}>{setsResult}</div>
183
+ </div> : ''}
184
+ {active == group || newLegoSets.length == 1 ? setsResultSplitted && setsResultSplitted.length && setsResultSplitted.map((setsResult, index) =>
185
+ <div key={index} className={cn('singles_group-wrapper mb-4 px-2 inline-block', classes.singlesGroupWrapper)}>
186
+ {index == 0 ? <div className='singles_item_group_letter text-xl font-semibold border-b border-gray-100 pb-1 mb-2'>{group}</div> :
187
+ <div className='singles_item_group_letter text-xl font-semibold pb-1 mb-2' style={{"marginTop":"35px"}}></div>}
188
+ <div className={cn('singles_item-list flex flex-col')}>{setsResult}</div>
189
+ </div>
190
+ )
191
+ : ''}
192
+ </>
193
+ );
194
+ });
195
+
196
+ const handleActive = (val) => {
197
+ setActive(val);
198
+
199
+ availableLeagues = [];
200
+
201
+ setActiveFilter('Major Baseball League')
202
+
203
+
204
+ setSearchQuery('')
205
+ }
206
+
207
+ const handleActiveTab = (val) => {
208
+ setActiveTab(val);
209
+
210
+ setSearchQuery('')
211
+ }
212
+
213
+ const handleActiveFilter = (val) => {
214
+ setActiveFilter(val);
215
+
216
+ setSearchQuery('')
217
+ }
218
+
219
+ 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'];
220
+
221
+ let title = "All Sets";
222
+ if (activeTab == "year") {
223
+ title = "By Year";
224
+ }
225
+
226
+ return (
227
+ <Fragment>
228
+ <StoreTitle>{title}</StoreTitle>
229
+ <Breadcrumbs categoryId={categoryId} customPage={shopby == "release_year" ? "By Year" : "By Release/Set"} />
230
+ <ul className={classes.nav}>
231
+ <li className={classes.nav_item}>
232
+ <button
233
+ onClick={() => {
234
+ handleActiveTab('year')
235
+ }}
236
+ >
237
+ {activeTab == 'year' ? <b>By Year</b> : 'By Year'}
238
+ </button>
239
+ </li>
240
+ <li className={classes.nav_item}>
241
+ <button
242
+ onClick={() => {
243
+ handleActiveTab('all')
244
+ }}
245
+ >
246
+ {activeTab == 'all' ? <b>All Sets</b> : 'All Sets'}
247
+ </button>
248
+ </li>
249
+ </ul>
250
+ <h1 className='mx-auto relative block text-xl font-bold text-center pt-10 pb-4'>
251
+ {title}
252
+ </h1>
253
+ {activeTab == "year" && <ul className={classes.nav}>
254
+ {availableGroups.map((group, index) => (
255
+ <li key={index} className={classes.nav_item}>
256
+ <button
257
+ onClick={() => {
258
+ handleActive(group)
259
+ }}
260
+ >
261
+ {active == group ? <b>{group}</b> : group}
262
+ </button>
263
+ </li>
264
+ ))}
265
+ <li className={classes.nav_item}>
266
+ <button
267
+ onClick={() => {
268
+ handleActive('all')
269
+ }}
270
+ >
271
+ {active == 'all' ? <b>All</b> : 'All'}
272
+ </button>
273
+ </li>
274
+ </ul>}
275
+ <div className='border border-gray-100 px-6'>
276
+ {legoSets ? (
277
+ <div
278
+ className={classes.toolbar}
279
+ >
280
+ <div style={{"width":"35%"}}><ArraySearchInput active={active} searchQuery={searchQuery} placeholder="Search sets..." isOpen={true} setSearchQuery={setSearchQuery} /></div>
281
+ {/* <CustomSortBy sortProps={sortProps} availableSortMethods={availableSortBy} /> */}
282
+ </div>
283
+ ) : ''}
284
+ <section className='single_list-indexing-container relative m-auto pt-5'>
285
+ {activeTab != "year" && <ul className='flex gap-2 justify-center flex-wrap'>
286
+ <li>
287
+ <button
288
+ className={cn(
289
+ 'rounded-md border border-solid border-gray-100 p-2 min-w-[28px]',
290
+ 'leading-4 font-medium text-base hover_bg-gray-50'
291
+ )}
292
+ onClick={() => {
293
+ handleActive('all')
294
+ }}
295
+ >
296
+ {active == 'all' ? <b>All</b> : 'All'}
297
+ </button>
298
+ </li>
299
+ {alpha.map((letter, index) => (
300
+ <li key={index}>
301
+ <button
302
+ className={cn(
303
+ 'rounded-md border border-solid border-gray-100 p-2 min-w-[28px]',
304
+ 'leading-4 font-medium text-base ',
305
+ setsLengthArr[letter] > 0 ? 'hover_bg-gray-50' : 'bg-gray-100 text-gray-400',
306
+ )}
307
+ onClick={() => {
308
+ handleActive(letter)
309
+ }}
310
+ disabled={setsLengthArr[letter] > 0 ? false : true}
311
+ >
312
+ {active == letter ? <b>{letter}</b> : letter}
313
+ </button>
314
+ </li>
315
+ ))}
316
+ </ul>}
317
+ </section>
318
+ <Divider className="mb-5 px-4 mt-5" />
319
+ <section className='singles-container'>
320
+ <div className={cn('singles-wrapper block -mx-4', classes.singlesWrapper)}>
321
+ {newLegoSets && newLegoSets.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>)}
322
+ </div>
323
+ </section>
324
+ </div>
325
+ </Fragment>
326
+ );
327
+ return '';
328
+ }
329
+
330
+ export default LegoSets;
@@ -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 './legoSets.module.css';
7
+ import cn from 'classnames';
8
+ import Divider from '@riosst100/pwa-marketplace/src/components/Divider';
9
+
10
+ const LegoSets = 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 LegoSets;
@@ -106,7 +106,7 @@ const ShopBy = props => {
106
106
 
107
107
  const classes = useStyle(defaultClasses);
108
108
 
109
- const talonProps = useShopBy({ searchQuery, setActive, currentSort, categoryId, shopby });
109
+ const talonProps = useShopBy({ searchQuery, active, setActive, currentSort, categoryId, shopby });
110
110
 
111
111
  const { error, loading, dataResult, categoryUrlSuffix, categoryUrlKey, productType, filteredAvailableGroups, availableGroups, attributeData, alpha, category, activeFilters } = talonProps;
112
112
 
@@ -128,19 +128,30 @@ const ShopBy = props => {
128
128
  return result;
129
129
  }
130
130
 
131
- const filterSearchArr = search ? search.split('&') : [];
132
- filterSearchArr.pop();
133
- const filterSearch = filterSearchArr.join('&')
131
+ let filterSearchArr = search ? search.split('&') : [];
132
+ filterSearchArr = filterSearchArr.filter(function(data) {
133
+ return !data.includes('shopby');
134
+ })
135
+ let filterSearch = filterSearchArr.join('&')
134
136
 
135
- const setRelases = newAvailableGroups.map((group, index) => {
137
+ if (!filterSearch.includes('?')) {
138
+ filterSearch = '?'+filterSearch;
139
+ }
140
+
141
+ let additionalFilter = '';
142
+ if (shopby == 'sc_brands') {
143
+ additionalFilter = '&shopby=release&active_tab=brand';
144
+ }
145
+
146
+ const setRelases = newAvailableGroups && newAvailableGroups.length && newAvailableGroups.map((group, index) => {
136
147
  const optionsResult = [];
137
148
 
138
149
  if (active === 'all' || active === group) {
139
- dataResult[group].map((option, index) => {
150
+ dataResult[group] && dataResult[group].length && dataResult[group].map((option, index) => {
140
151
  const { label, value } = option;
141
152
 
142
153
  const filter = attributeData.attribute_code + '[filter]=' + label + ',' + value;
143
- const params = filterSearch ? filterSearch + '&' + filter : '?' + filter;
154
+ const params = filterSearch ? filterSearch + '&' + filter + additionalFilter : '?' + filter + additionalFilter;
144
155
 
145
156
  const categoryUrl = resourceUrl(
146
157
  `/${category.url_path}${categoryUrlSuffix || ''}${params}`
@@ -154,19 +165,35 @@ const ShopBy = props => {
154
165
  });
155
166
 
156
167
  let optionsResultSplitted = [];
157
- if (active == group) {
168
+ if (newAvailableGroups.length == 1 || active == group) {
158
169
  optionsResultSplitted = splitToNChunks(optionsResult, 3);
159
170
  }
160
171
 
161
- return (
162
- <>
163
- {optionsResult && active == "all" ?
172
+ // console.log(dataResult)
173
+
174
+ const all = active == "all" ? (
175
+ newAvailableGroups.length == 1 ? (
176
+ optionsResultSplitted && optionsResultSplitted.length && optionsResultSplitted.map((data, index) => (
177
+ <div key={index} className={cn('singles_group-wrapper mb-4 px-2 inline-block', classes.singlesGroupWrapper)}>
178
+ {searchQuery && availableGroups.length > 1 && (index == 0 ? <div className='singles_item_group_letter text-xl font-semibold border-b border-gray-100 pb-1 mb-2'>{group}</div> :
179
+ <div className='singles_item_group_letter text-xl font-semibold pb-1 mb-2' style={{"marginTop":"35px"}}></div>)}
180
+ <div className={cn('singles_item-list flex flex-col')}>{data}</div>
181
+ </div>
182
+ )
183
+ )
184
+ ) : (
164
185
  <div className={cn('singles_group-wrapper mb-4 px-2 inline-block', classes.singlesGroupWrapper)}>
165
186
  <div className='singles_item_group_letter text-xl font-semibold border-b border-gray-100 pb-1 mb-2' >
166
187
  {group}
167
188
  </div>
168
189
  <div className={cn('singles_item-list flex flex-col')}>{optionsResult}</div>
169
- </div> : ''}
190
+ </div>
191
+ )
192
+ ) : '';
193
+
194
+ return (
195
+ <>
196
+ {all}
170
197
  {active == group ? optionsResultSplitted && optionsResultSplitted.length && optionsResultSplitted.map((optionsResult, index) =>
171
198
  <div key={index} className={cn('singles_group-wrapper mb-4 px-2 inline-block', classes.singlesGroupWrapper)}>
172
199
  {index == 0 ? <div className='singles_item_group_letter text-xl font-semibold border-b border-gray-100 pb-1 mb-2'>{group}</div> :
@@ -184,10 +211,6 @@ const ShopBy = props => {
184
211
 
185
212
  const handleActive = (val) => {
186
213
  setActive(val);
187
-
188
- //
189
-
190
-
191
214
  setSearchQuery('')
192
215
  }
193
216
 
@@ -197,15 +220,15 @@ const ShopBy = props => {
197
220
  'value': 'all'
198
221
  }
199
222
  ];
200
-
201
- console.log(activeFilters)
223
+
224
+ const title = attributeData ? (attributeData.attribute_code == "sc_baseball_parallel" ? "Parallel Sets" : (attributeData.attribute_code == "sc_baseball_inserts" ? "Insert Sets" : attributeData.label)) : "Shop By"
202
225
 
203
226
  return (
204
227
  <Fragment>
205
- <StoreTitle>{attributeData ? 'By ' + attributeData.label : 'Shop By'}</StoreTitle>
206
- <Breadcrumbs categoryId={categoryId} customPage={'By ' + attributeData.label} currentFilter={activeFilters} />
228
+ <StoreTitle>{title}</StoreTitle>
229
+ <Breadcrumbs categoryId={categoryId} customPage={title} currentFilter={activeFilters} />
207
230
  <h1 className='mx-auto relative block text-xl font-bold text-center pt-10 pb-4'>
208
- {attributeData ? 'By ' + attributeData.label : 'Shop By'}
231
+ {title}
209
232
  </h1>
210
233
  <div className='border border-gray-100 px-6'>
211
234
  {dataResult ? (
@@ -216,7 +239,7 @@ const ShopBy = props => {
216
239
  <CustomSortBy sortProps={sortProps} availableSortMethods={availableSortBy} />
217
240
  </div>
218
241
  ) : ''}
219
- {productType != "expansion-sets" ? (
242
+ {shopby != "lego_theme" && shopby != "lego_age_level" && productType != "expansion-sets" ? (
220
243
  <>
221
244
  <section className='single_list-indexing-container relative m-auto pt-5'>
222
245
  <ul className='flex gap-2 justify-center flex-wrap'>
@@ -233,7 +256,7 @@ const ShopBy = props => {
233
256
  {active == 'all' ? <b>All</b> : 'All'}
234
257
  </button>
235
258
  </li>
236
- {alpha.map((letter, index) => (
259
+ {alpha && alpha.length && alpha.map((letter, index) => (
237
260
  <li key={index}>
238
261
  <button
239
262
  className={cn(