@riosst100/pwa-marketplace 1.8.3 → 1.8.5

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.8.3",
4
+ "version": "1.8.5",
5
5
  "main": "src/index.js",
6
6
  "pwa-studio": {
7
7
  "targets": {
@@ -103,6 +103,15 @@ const LegoSets = props => {
103
103
  return result;
104
104
  }
105
105
 
106
+ let allSetsTitle = "Sets";
107
+ let attributeCode = "lego_sets";
108
+ let byYearTitle = "By Year";
109
+ if (shopby == "singles") {
110
+ attributeCode = "lego_singles";
111
+ allSetsTitle = "Singles";
112
+ byYearTitle = "By Year";
113
+ }
114
+
106
115
  const setRelases = newLegoSets && newLegoSets.length && newLegoSets.map((setRelease, index) => {
107
116
  const { group, sets } = setRelease;
108
117
 
@@ -113,7 +122,7 @@ const LegoSets = props => {
113
122
  const { set_name, option_id, release_year } = set;
114
123
 
115
124
  const categoryUrl = resourceUrl(
116
- `/${category?.url_path}${categoryUrlSuffix || ''}?lego_set_name[filter]=${set_name},${option_id}`
125
+ `/${category?.url_path}${categoryUrlSuffix || ''}?${attributeCode}[filter]=${set_name},${option_id}`
117
126
  );
118
127
 
119
128
  setsResult.push(<li className='list-none'>
@@ -158,6 +167,7 @@ const LegoSets = props => {
158
167
 
159
168
  const handleActiveTab = (val) => {
160
169
  setActiveTab(val);
170
+ setActive('all')
161
171
 
162
172
  setSearchQuery('')
163
173
  }
@@ -168,15 +178,23 @@ const LegoSets = props => {
168
178
 
169
179
  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'];
170
180
 
171
- let title = "All Sets";
181
+ let title = "Sets";
172
182
  if (activeTab == "year") {
173
- title = "By Year";
183
+ title = "Sets | By Year";
174
184
  }
175
185
 
186
+ if (shopby == "singles") {
187
+ title = "Singles";
188
+ if (activeTab == "year") {
189
+ title = "Singles | By Year";
190
+ }
191
+ }
192
+
193
+
176
194
  return (
177
195
  <Fragment>
178
196
  <StoreTitle>{title}</StoreTitle>
179
- <Breadcrumbs categoryId={categoryId} customPage={shopby == "release_year" ? "By Year" : "By Release/Set"} />
197
+ <Breadcrumbs categoryId={categoryId} customPage={title} />
180
198
  <ul className={classes.nav}>
181
199
  <li className={classes.nav_item}>
182
200
  <button
@@ -184,7 +202,7 @@ const LegoSets = props => {
184
202
  handleActiveTab('year')
185
203
  }}
186
204
  >
187
- {activeTab == 'year' ? <b>By Year</b> : 'By Year'}
205
+ {activeTab == 'year' ? <b>{byYearTitle}</b> : byYearTitle}
188
206
  </button>
189
207
  </li>
190
208
  <li className={classes.nav_item}>
@@ -193,7 +211,7 @@ const LegoSets = props => {
193
211
  handleActiveTab('all')
194
212
  }}
195
213
  >
196
- {activeTab == 'all' ? <b>All Sets</b> : 'All Sets'}
214
+ {activeTab == 'all' ? <b>{allSetsTitle}</b> : allSetsTitle}
197
215
  </button>
198
216
  </li>
199
217
  </ul>
@@ -239,7 +239,7 @@ const ShopBy = props => {
239
239
  <CustomSortBy sortProps={sortProps} availableSortMethods={availableSortBy} />
240
240
  </div>
241
241
  ) : ''}
242
- {shopby != "lego_theme" && shopby != "lego_age_level" && productType != "expansion-sets" ? (
242
+ {shopby != "lego_age_level" && productType != "expansion-sets" ? (
243
243
  <>
244
244
  <section className='single_list-indexing-container relative m-auto pt-5'>
245
245
  <ul className='flex gap-2 justify-center flex-wrap'>
@@ -16,7 +16,7 @@ const SubCategory = props => {
16
16
  normalizedData
17
17
  } = talonProps;
18
18
 
19
- const maxSubCategory = 8;
19
+ const maxSubCategory = 10;
20
20
 
21
21
  const subCategory = [];
22
22
 
@@ -85,7 +85,7 @@ const Category = props => {
85
85
  categoryId={uid}
86
86
  isLoading={loading} />
87
87
  ) : (
88
- shopby == "lego_set_name" && parentCategoryUrlKey == "lego" ? <LegoSets
88
+ shopby == "singles" || shopby == "lego_set_name" && parentCategoryUrlKey == "lego" ? <LegoSets
89
89
  categoryId={uid}
90
90
  shopby={shopby}
91
91
  isLoading={loading} /> : shopby == "release" && parentCategoryUrlKey == "sport-cards" ? <SportCardsSets
@@ -91,7 +91,7 @@ const FilterSidebar = props => {
91
91
  const groupName = filterNames.get(group);
92
92
  const frontendInput = filterFrontendInput.get(group);
93
93
 
94
- const hideFilters = ['lof_preorder','auction','special_price','sc_baseball_inserts','sc_baseball_parallel','sale','sc_set_type','sc_brands'];
94
+ const hideFilters = ['trains','trains_locomotives','trains_supplies_type','lof_preorder','auction','special_price','sc_baseball_inserts','sc_baseball_parallel','sale','sc_set_type','sc_brands'];
95
95
  if (!hideFilters.includes(group)) {
96
96
  // if (!allowedFilters && !allowedFiltersArr.length && group != "category_uid" || allowedFilters && allowedFiltersArr.length && allowedFiltersArr.includes(group)) {
97
97
 
@@ -12,8 +12,8 @@ export const GET_STORE_CONFIG_DATA = gql`
12
12
  `;
13
13
 
14
14
  export const GET_LEGO_SETS_QUERY = gql`
15
- query getLegoSets($categoryUrlKey: String!, $activeTab: String, $filters: ProductAttributeFilterInput!) {
16
- legoSets(categoryUrlKey: $categoryUrlKey, activeTab: $activeTab, filters: $filters) {
15
+ query getLegoSets($categoryUrlKey: String!, $activeTab: String, $filters: ProductAttributeFilterInput!, $shopby: String) {
16
+ legoSets(categoryUrlKey: $categoryUrlKey, activeTab: $activeTab, filters: $filters, shopby: $shopby) {
17
17
  group
18
18
  sets {
19
19
  set_name
@@ -92,7 +92,8 @@ export const useLegoSets = props => {
92
92
  variables: {
93
93
  filters: newFilters,
94
94
  categoryUrlKey: categoryUrlKey,
95
- activeTab: activeTab
95
+ activeTab: activeTab,
96
+ shopby: shopby
96
97
  }
97
98
  });
98
99
  // }