@local-civics/hub-ui 0.1.180 → 0.1.181
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/dist/index.js +3 -16
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +3 -16
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -5588,16 +5588,6 @@ const PathwayCard = (props) => {
|
|
|
5588
5588
|
},
|
|
5589
5589
|
[props.criteria]
|
|
5590
5590
|
);
|
|
5591
|
-
const categoryIdByLabel = React__namespace.useMemo(
|
|
5592
|
-
() => {
|
|
5593
|
-
var _a2;
|
|
5594
|
-
return Object.entries((_a2 = props.categoryNames) != null ? _a2 : {}).reduce((acc, [id, label]) => {
|
|
5595
|
-
acc[label] = id;
|
|
5596
|
-
return acc;
|
|
5597
|
-
}, {});
|
|
5598
|
-
},
|
|
5599
|
-
[props.categoryNames]
|
|
5600
|
-
);
|
|
5601
5591
|
const [activeFilters, setActiveFilters] = React__namespace.useState(
|
|
5602
5592
|
() => /* @__PURE__ */ new Set()
|
|
5603
5593
|
);
|
|
@@ -5618,10 +5608,10 @@ const PathwayCard = (props) => {
|
|
|
5618
5608
|
return (_a2 = b.categories) == null ? void 0 : _a2.map((c) => activeFilters.has(c));
|
|
5619
5609
|
}
|
|
5620
5610
|
));
|
|
5621
|
-
const toggleFilter = (
|
|
5611
|
+
const toggleFilter = (categoryId) => {
|
|
5622
5612
|
setActiveFilters((prev) => {
|
|
5623
5613
|
const next = new Set(prev);
|
|
5624
|
-
next.has(
|
|
5614
|
+
next.has(categoryId) ? next.delete(categoryId) : next.add(categoryId);
|
|
5625
5615
|
return next;
|
|
5626
5616
|
});
|
|
5627
5617
|
};
|
|
@@ -5647,10 +5637,7 @@ const PathwayCard = (props) => {
|
|
|
5647
5637
|
"div",
|
|
5648
5638
|
{
|
|
5649
5639
|
key: id,
|
|
5650
|
-
onClick: () =>
|
|
5651
|
-
var _a3;
|
|
5652
|
-
return toggleFilter((_a3 = categoryIdByLabel[label]) != null ? _a3 : id);
|
|
5653
|
-
},
|
|
5640
|
+
onClick: () => toggleFilter(id),
|
|
5654
5641
|
className: isActive ? `${filterClassName} bg-gray-700` : "inline-block px-4 py-2 rounded-full hover:bg-gray-200 cursor-pointer text-sm"
|
|
5655
5642
|
},
|
|
5656
5643
|
label
|