@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 +1 -1
- package/src/PaddleBrandList.tsx +17 -10
package/package.json
CHANGED
package/src/PaddleBrandList.tsx
CHANGED
|
@@ -23,18 +23,25 @@ type BrandListTypes = {
|
|
|
23
23
|
const PaddleBrandList = ({ nodes, sport }: BrandListTypes) => {
|
|
24
24
|
|
|
25
25
|
const BrandSet = new Set();
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
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
|
-
|
|
36
|
+
return BrandSet;
|
|
37
|
+
})
|
|
38
|
+
});
|
|
36
39
|
|
|
37
|
-
|
|
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'>
|