Commit Graph

10 Commits

Author SHA1 Message Date
Kelly Dwan 75ec6a48c2 Remove the styles build target in webpack (https://github.com/woocommerce/woocommerce-blocks/pull/610)
The CSS can be imported into the “global” JS file now
2019-06-10 12:47:14 -04:00
Mike Jolley 1fb893e3f4 Add Woo icon and branding to block categories (https://github.com/woocommerce/woocommerce-blocks/pull/581)
* remove php insertion of block category

* Add an SVG icon for the woo logo

* Add block-category.js to import into blocks

This creates the category icon complete with a Woo SVG icon

* Import block-category to all blocks that use it

* Style woocommerce blocks in woo purple

* Lint error

* fillRule case

* Update propTypes

* Use foreground prop instead of css

* Convert Woo Logo to ICON type component

* Add shared blocks.js to house the category code

* Calculate width from height
2019-05-28 11:18:07 +01:00
Kelly Dwan 6a1c1490cb Split blocks into separate JS files (https://github.com/woocommerce/woocommerce-blocks/pull/305)
This lets us use the functionality of `register_block_type` to automatically enqueue the scripts and styles used by blocks in the editor, and eventually, styles on the frontend as well. Also adds cssnano to minify our CSS.
2019-01-10 13:16:37 -05:00
Kelly Dwan 03eaddd197 New block: add "Hand-picked Products" block (https://github.com/woocommerce/woocommerce-blocks/pull/276)
* Add ProductsControl component to search and select products

* Add “Hand-picked Products” block

* Update hand-picked & new product icons

* Prevent API request when no products are selected

* Remove rows setting

* Update shortcode/query helpers for the handpicked products

* Remove shortcode from post if no product IDs are passed

Rendering a shortcode with `ids=‘’` will show all products, as if the ids param wasn’t there. The expected outcome would be no products are shown, we we achieve by removing the shortcode.

* Remove unused rows attribute

* Update accessible spoken notice

* Add a variable to hold whether there are selected products

* Fix copy-paste comments
2018-12-21 19:10:17 -05:00
David Levin 5af019bcd7 New Block: Add "Newest Products" Block (https://github.com/woocommerce/woocommerce-blocks/pull/255)
* add newest products block

* update class name in index.js and product-new.js

* Add a new WooCommerce block category and include all blocks within.

* Fix shortcode product order

* Show block category on all post types
2018-12-18 14:45:49 -05:00
Kelly Dwan 395888a521 Fix mix of tabs/spaces 2018-12-15 11:41:39 -05:00
David Levin 1bf9ab1fb5 resolve conflicts 2018-12-14 18:08:58 -08:00
Kelly Dwan 381752734b New Block: Add "On Sale Products" block (https://github.com/woocommerce/woocommerce-blocks/pull/239)
* Add “On Sale Products” block

* Remove categories requirement from fetching products on mount
2018-12-14 18:47:16 -05:00
David Levin d30761ba2f Add top rated products block 2018-12-14 11:45:19 -08:00
Kelly Dwan 43675515af Block: Add new "Best Selling Products" block (https://github.com/woocommerce/woocommerce-blocks/pull/221)
* Move from a JS file per block registration to one file registering all blocks

This will let webpack combine shared libraries, like gridicons

* Move global block settings to the “before all scripts” section

These shouldn’t be tied to a specific block file, since they’re used across all blocks

* Register both block types

We can also remove the scripts, since we enqueue these below

* Update getShortcode & getQuery to handle different block types

* Pass block type name to getQuery

* Update shared attributes - edit_mode is not a universal option, but categories will be

Categories is shared, but orderby is not

* Add “Best Selling Products” block

* Add a shared class name for product grid blocks

* Fix failing tests
2018-12-13 12:19:55 -05:00