Polygon shapes abstracted to be types of checkboxes; abstracted rendering of panel into one component; importing shapes from separate endpoint

This commit is contained in:
efarooqui
2021-05-20 18:44:26 -07:00
parent e431422c19
commit 7156639ec3
23 changed files with 308 additions and 133 deletions

View File

@@ -0,0 +1,32 @@
import React from "react";
import Checkbox from "../../atoms/Checkbox";
const PanelTree = ({ data, activeValues, onSelect, defaultCheckboxColor }) => {
return (
<div>
{data.map((val) => {
const isActive = activeValues.includes(val.title);
const baseStyles = {
background: isActive ? defaultCheckboxColor : "none",
border: `1px solid ${defaultCheckboxColor}`,
};
return (
<li
key={val.title.replace(/ /g, "_")}
className="filter-filter active"
style={{ marginLeft: "20px" }}
>
<Checkbox
label={val.title}
isActive={isActive}
onClickCheckbox={() => onSelect(val.title)}
styleProps={val.styles ? val.styles : baseStyles}
/>
</li>
);
})}
</div>
);
};
export default PanelTree;