Skip to content
This repository has been archived by the owner on Feb 23, 2024. It is now read-only.

Commit

Permalink
Created new component for Filters elements labels
Browse files Browse the repository at this point in the history
  • Loading branch information
grogou committed Aug 20, 2021
1 parent e3d7fb2 commit 94a54e3
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 44 deletions.
Expand Up @@ -4,14 +4,19 @@
import { _n, sprintf } from '@wordpress/i18n';
import { Label } from '@woocommerce/blocks-checkout';

/**
* Internal dependencies
*/
import './style.scss';

/**
* The label for an stock status filter.
*
* @param {Object} props Incoming props for the component.
* @param {string} props.name The name for the label.
* @param {number} props.count The count of products this status is attached to.
*/
const StockFilterLabel = ( { name, count } ) => {
const FilterElementLabel = ( { name, count } ) => {
return (
<>
{ name }
Expand All @@ -30,12 +35,12 @@ const StockFilterLabel = ( { name, count } ) => {
) }
wrapperElement="span"
wrapperProps={ {
className: 'wc-block-stock-filter-list-count',
className: 'wc-filter-element-label-list-count',
} }
/>
) }
</>
);
};

export default StockFilterLabel;
export default FilterElementLabel;
9 changes: 9 additions & 0 deletions assets/js/base/components/filter-element-label/style.scss
@@ -0,0 +1,9 @@
.wc-filter-element-label-list-count {
&::before {
content: " (";
}
&::after {
content: ")";
}
opacity: 0.6;
}
41 changes: 0 additions & 41 deletions assets/js/blocks/attribute-filter/label.js

This file was deleted.

0 comments on commit 94a54e3

Please sign in to comment.