woocommerce/plugins/woocommerce-admin/client/components/product-image
Justin Shreve dabef973bd Add ProductImage Component (https://github.com/woocommerce/woocommerce-admin/pull/231)
* Add ProductImage Component

* Use provided product image alt text
2018-07-20 14:24:39 -04:00
..
test Add ProductImage Component (https://github.com/woocommerce/woocommerce-admin/pull/231) 2018-07-20 14:24:39 -04:00
README.md Add ProductImage Component (https://github.com/woocommerce/woocommerce-admin/pull/231) 2018-07-20 14:24:39 -04:00
index.js Add ProductImage Component (https://github.com/woocommerce/woocommerce-admin/pull/231) 2018-07-20 14:24:39 -04:00
style.scss Add ProductImage Component (https://github.com/woocommerce/woocommerce-admin/pull/231) 2018-07-20 14:24:39 -04:00

README.md

ProductImage

Use ProductImage to display a product's featured image. If no image can be found, a placeholder matching the front-end image placeholder will be displayed.

How to use:

import ProductImage from 'components/product-image';

render: function() {
  return (
	<div>
		<ProductImage product={ null } />
		<ProductImage product={ { images: [] } } />
		<ProductImage product={ { images: [
			{
				src: 'https://i.cloudup.com/pt4DjwRB84-3000x3000.png',
			},
		] } } />
	</div>
  );
}

Props