Revert "Add static class name for product-details (https://github.com/woocommerce/woocommerce-blocks/pull/6914)" (https://github.com/woocommerce/woocommerce-blocks/pull/7191)
This reverts commit d6d94ae622
.
This commit is contained in:
parent
77a2255978
commit
79b1d4a38a
|
@ -1,6 +1,7 @@
|
|||
/**
|
||||
* External dependencies
|
||||
*/
|
||||
import { kebabCase } from 'lodash';
|
||||
import { decodeEntities } from '@wordpress/html-entities';
|
||||
import type { ProductResponseItemData } from '@woocommerce/type-defs/product-response';
|
||||
|
||||
|
@ -31,10 +32,15 @@ const ProductDetails = ( {
|
|||
{ details.map( ( detail ) => {
|
||||
// Support both `key` and `name` props
|
||||
const name = detail?.key || detail.name || '';
|
||||
const className = name
|
||||
? `wc-block-components-product-details__${ kebabCase(
|
||||
name
|
||||
) }`
|
||||
: '';
|
||||
return (
|
||||
<li
|
||||
key={ name + ( detail.display || detail.value ) }
|
||||
className="wc-block-components-product-details__item"
|
||||
className={ className }
|
||||
>
|
||||
{ name && (
|
||||
<>
|
||||
|
|
|
@ -5,7 +5,7 @@ exports[`ProductDetails should not render hidden details 1`] = `
|
|||
className="wc-block-components-product-details"
|
||||
>
|
||||
<li
|
||||
className="wc-block-components-product-details__item"
|
||||
className="wc-block-components-product-details__lorem"
|
||||
>
|
||||
<span
|
||||
className="wc-block-components-product-details__name"
|
||||
|
@ -32,7 +32,7 @@ exports[`ProductDetails should render details 1`] = `
|
|||
className="wc-block-components-product-details"
|
||||
>
|
||||
<li
|
||||
className="wc-block-components-product-details__item"
|
||||
className="wc-block-components-product-details__lorem"
|
||||
>
|
||||
<span
|
||||
className="wc-block-components-product-details__name"
|
||||
|
@ -48,7 +48,7 @@ exports[`ProductDetails should render details 1`] = `
|
|||
</span>
|
||||
</li>
|
||||
<li
|
||||
className="wc-block-components-product-details__item"
|
||||
className="wc-block-components-product-details__lorem"
|
||||
>
|
||||
<span
|
||||
className="wc-block-components-product-details__name"
|
||||
|
@ -64,7 +64,7 @@ exports[`ProductDetails should render details 1`] = `
|
|||
</span>
|
||||
</li>
|
||||
<li
|
||||
className="wc-block-components-product-details__item"
|
||||
className=""
|
||||
>
|
||||
|
||||
<span
|
||||
|
|
Loading…
Reference in New Issue