@rileybathurst/paddle 1.0.3 → 1.0.4

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": "@rileybathurst/paddle",
3
3
  "private": false,
4
- "version": "1.0.3",
4
+ "version": "1.0.4",
5
5
  "type": "module",
6
6
  "scripts": {
7
7
  "dev": "vite",
@@ -23,18 +23,25 @@ type BrandListTypes = {
23
23
  const PaddleBrandList = ({ nodes, sport }: BrandListTypes) => {
24
24
 
25
25
  const BrandSet = new Set();
26
-
27
- nodes.map((brand) => {
28
- brand.retail.map((retail) => {
29
- if (retail.sport.slug === sport) {
30
- BrandSet.add(brand);
31
- }
32
- })
33
- });
26
+ let BrandArray = [];
27
+
28
+ if (sport) {
29
+ nodes.map((brand) => {
30
+ brand.retail.map((retail) => {
31
+
32
+ if (retail.sport.slug === sport) {
33
+ BrandSet.add(brand);
34
+ }
34
35
 
35
- const BrandArray = (Array.from(BrandSet));
36
+ return BrandSet;
37
+ })
38
+ });
36
39
 
37
- // TODO: if I only want a specific sport
40
+ BrandArray = (Array.from(BrandSet));
41
+ } else {
42
+ // TODO: this needs a check if anything is published in the brand if no sport is passed
43
+ BrandArray = (Array.from(nodes));
44
+ }
38
45
 
39
46
  return (
40
47
  <ul className='brand_list'>