ofda-product-card
v1.0.0-rc
Published
Este es un paquete de pruebas de despliegue de NPM
Downloads
2
Readme
ofda-Product-Card
Este es un paquete de pruebas de despliegue de NPM
Oscar Diaz
Ejemplo
import {
ProductCard,
ProductImage,
ProductTitle,
ProductButtons,
} from 'ofda-product-card';
<ProductCard
product={product}
className="bg-dark text-white"
initialValues={{
count: 4,
maxCount: 10,
}}
>
{({ reset, isMaxCountReached, increaseBy, count, maxCount }) => (
<>
<ProductImage className="custom-image" />
<ProductTitle className="text-bold" />
<ProductButtons 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>