0.1.1 • Published 1 year ago

do-product-cart v0.1.1

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

ProductCard package

This is a simple package for testing

Alejandro Oliva

Ejemplo

import {
  ProductCard,
  ProductTitle,
  ProductImage,
  ProductButtons,
} from 'do-product-card';

const product = {
  id: '1',
  title: 'Coffe Mug 1',
  // img: './coffee-mug.png',
};

const ShoppingPage = () => {
  return (
    <div>
      <h1>Shopping Page</h1>
      <hr />

      <ProductCard
        product={product}
        initialValues={{
          quantity: 6,
          maxQuantity: 10,
        }}
      >
        {({
          reset,
          counter,
          isMaxQuantityReached,
          maxQuantity,
          increaseBy,
        }) => (
          <>
            <ProductImage />
            <ProductTitle />
            <ProductButtons />
          </>
        )}
      </ProductCard>
    </div>
  );
};

export default ShoppingPage;
0.1.1

1 year ago

0.1.0

1 year ago