0.0.2 • Published 2 years ago

car-product-card v0.0.2

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

CA-Product Card

Este es un paquete de pruebsa de despliegue en NPM

Carlos Alonso

Ejemplo

import { ProductCard } from "car-product-card";
      <ProductCard
        className="bg-dark text-white"
        key={product.id}
        product={product}
        initialValues={{
          count: 4,
          maxCount: 10,
        }}
      >
        {({ reset, count, isMaxCountReached, maxCount, increaseBy }) => (
          <>
            <ProductCard.Image className="custom-image" />
            <ProductCard.Title className="text-bold" />
            <ProductCard.Buttons className="custom-buttons" />
            <button onClick={reset}>Reset</button>
            <button onClick={() => increaseBy(-2)}> -2 </button>
            {!isMaxCountReached && (
              <button onClick={() => increaseBy(+2)}> +2 </button>
            )}

            <span>
              {count} - {maxCount}
            </span>
          </>
        )}
      </ProductCard>