Remove redundant parameter

This commit is contained in:
Tiago Noronha 2018-02-19 20:05:59 +00:00
parent 99f3de3098
commit e60c2d2970
2 changed files with 6 additions and 7 deletions

View File

@ -1224,12 +1224,11 @@ var ProductCategoryList = withAPIData(function (props) {
}
var AccordionButton = function AccordionButton(_ref3) {
var category = _ref3.category,
toggled = _ref3.toggled;
var category = _ref3.category;
var icon = 'arrow-down-alt2';
if (toggled) {
if (openAccordion === category) {
icon = 'arrow-up-alt2';
}
@ -1273,7 +1272,7 @@ var ProductCategoryList = withAPIData(function (props) {
{ className: "product-category-count" },
category.count
),
0 === category.parent && wp.element.createElement(AccordionButton, { category: category.id, toggled: openAccordion === category.id })
0 === category.parent && wp.element.createElement(AccordionButton, { category: category.id })
),
wp.element.createElement(CategoryTree, { categories: categories, parent: category.id })
);

View File

@ -113,10 +113,10 @@ const ProductCategoryList = withAPIData( ( props ) => {
return __( 'No categories found' );
}
const AccordionButton = ( { category, toggled } ) => {
const AccordionButton = ( { category } ) => {
let icon = 'arrow-down-alt2';
if ( toggled ) {
if ( openAccordion === category ) {
icon = 'arrow-up-alt2';
}
@ -143,7 +143,7 @@ const ProductCategoryList = withAPIData( ( props ) => {
/> { category.name }
<span className="product-category-count">{ category.count }</span>
{ 0 === category.parent &&
<AccordionButton category={ category.id } toggled={ openAccordion === category.id } />
<AccordionButton category={ category.id } />
}
</label>
<CategoryTree categories={ categories } parent={ category.id } />