@riosst100/pwa-marketplace 2.3.6 → 2.3.7

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": "2.3.6",
4
+ "version": "2.3.7",
5
5
  "main": "src/index.js",
6
6
  "pwa-studio": {
7
7
  "targets": {
@@ -127,17 +127,27 @@ const SetsData = props => {
127
127
 
128
128
  if (sets.length) {
129
129
  sets.map((set, index) => {
130
- const { set_name, option_id, release_year } = set;
130
+ const { products_count, set_name, option_id, release_year } = set;
131
+
132
+ console.log(products_count)
131
133
 
132
134
  const categoryUrl = resourceUrl(
133
135
  `/${category?.url_path}${categoryUrlSuffix || ''}${filterSearch || ''}&${attributeCode}[filter]=${set_name},${option_id}`
134
136
  );
135
137
 
136
- setsResult.push(<li className='list-none'>
137
- <Link to={categoryUrl} className="hover_bg-darkblue-900 hover_text-white w-full block text-[14px] py-[2px] px-2">
138
- {set_name}
139
- </Link>
138
+ if (parseInt(products_count) > 0) {
139
+ setsResult.push(<li className='list-none'>
140
+ <Link to={categoryUrl} className="hover_bg-darkblue-900 hover_text-white w-full block text-[14px] py-[2px] px-0">
141
+ {set_name} <span className='text-[12px]'>({products_count})</span>
142
+ </Link>
143
+ </li>)
144
+ } else {
145
+ setsResult.push(<li className='list-none'>
146
+ <span className="text-[#8f8f8f] w-full block text-[14px] py-[2px] px-0">
147
+ {set_name} <span className='text-[12px]'>({products_count})</span>
148
+ </span>
140
149
  </li>)
150
+ }
141
151
  })
142
152
  }
143
153
 
@@ -27,6 +27,7 @@ export const GET_SETS_DATA_QUERY = gql`
27
27
  group
28
28
  release_year
29
29
  sets {
30
+ products_count
30
31
  set_name
31
32
  option_id
32
33
  release_year