woocommerce/plugins/woocommerce-blocks/assets/js/components
Albert Juhé Lluveras 2504bffdfa Create `withProduct` HOC (https://github.com/woocommerce/woocommerce-blocks/pull/779)
* Reset 'loaded' state in Featured Product and Category blocks

* Minor code improvements

* Remove state from ApiErrorPlaceholder

* Move getProduct to a HOC

* Undo changes in Featured Category

* Update proptypes

* Move error messages to <ApiErrorPlaceholder>

* Reorder props

* Move lifecycle methods to HOC

* Make <FeaturedProduct> component presentational

* Move withProduct to js/hocs

* Create NAMESPACE constant in utils

* Create getProduct util function

* Set 'error' and 'product' state to null instead of 'false' when they have no value

* Prevent getImageSrcFromProduct and getImageIdFromProduct returning an error when 'product' is not an object

* Add HOC tests

* Use 'toBe' and 'toBeNull' jest expect methods instead of 'toEqual' when possible

* Export HOCs from index

* Move mock implementation to beforeEach
2019-08-02 13:56:53 +02:00
..
api-error-placeholder Create `withProduct` HOC (https://github.com/woocommerce/woocommerce-blocks/pull/779) 2019-08-02 13:56:53 +02:00
grid-content-control Add pre-commit CSS and JS linting (https://github.com/woocommerce/woocommerce-blocks/pull/699) 2019-07-09 11:50:09 +01:00
grid-layout-control Add button alignment option to product grid blocks (https://github.com/woocommerce/woocommerce-blocks/pull/606) 2019-06-27 12:13:02 +01:00
icons Featured Category Block (https://github.com/woocommerce/woocommerce-blocks/pull/676) 2019-07-09 12:38:44 +01:00
product-attribute-control Cancel debounced functions on unmount (https://github.com/woocommerce/woocommerce-blocks/pull/725) 2019-07-12 12:20:42 +01:00
product-category-control Featured Category Block (https://github.com/woocommerce/woocommerce-blocks/pull/676) 2019-07-09 12:38:44 +01:00
product-control Introduce a new Products by Tag(s) block (https://github.com/woocommerce/woocommerce-blocks/pull/554) 2019-07-09 14:42:22 +01:00
product-orderby-control Move product order list into a shared component (https://github.com/woocommerce/woocommerce-blocks/pull/238) 2018-12-14 09:57:32 -05:00
product-preview Add pre-commit CSS and JS linting (https://github.com/woocommerce/woocommerce-blocks/pull/699) 2019-07-09 11:50:09 +01:00
product-tag-control Introduce a new Products by Tag(s) block (https://github.com/woocommerce/woocommerce-blocks/pull/554) 2019-07-09 14:42:22 +01:00
products-control Cancel debounced functions on unmount (https://github.com/woocommerce/woocommerce-blocks/pull/725) 2019-07-12 12:20:42 +01:00
toggle-button-control Introduce `ToggleButtonControl` for Product Category List display type (https://github.com/woocommerce/woocommerce-blocks/pull/675) 2019-07-03 15:39:10 +01:00
utils Create `withProduct` HOC (https://github.com/woocommerce/woocommerce-blocks/pull/779) 2019-08-02 13:56:53 +02:00
README.md Update and add documentation in READMEs (https://github.com/woocommerce/woocommerce-blocks/pull/551) 2019-05-09 10:45:09 -04:00

README.md

Components

These are shared components used by the blocks. If there's a component that is more universally useful, it should go into @woocommerce/components these components are specific to the Gutenberg context.

The *-control components here are designed to exist in the InspectorControls sidebar, or in a Placeholder component for the "edit state" of a block.

GridContentControl

A combination of toggle controls for content visibility in product grids.

GridLayoutControl

A combination of range controls for product grid layout settings.

ProductOrderbyControl

A pre-configured SelectControl for product orderby settings.

ProductPreview

Display a preview for a given product.

ProductAttributeControl

A component using SearchListControl to show product attributes as selectable options. Only allows for selecting attribute terms from one attribute at a time (multiple terms can be selected).

ProductCategoryControl

A component using SearchListControl to show product categories as selectable options. Options are displayed in hierarchy. Can select multiple categories.

ProductControl

A component using SearchListControl to show products as selectable options. Only one product can be selected at a time.

ProductsControl

A component using SearchListControl to show products as selectable options. Multiple products can be selected at once.

Icons

These are a collection of custom icons used by the blocks or components, usually from Material.

Utilities

There are some functions that work across components, these have been extracted into this utilities folder.