jp23-products-pack1
v0.1.0
Published
Libreria creada por julper23
Readme
#DO Products Pack
##Example:
<ProductCard
key={product.id}
product={product}
className="bg-dark text-white"
initialValues={{
count: 4,
maxCount: 10
}}
>
{
({reset, isMaxCountReached, maxCount, count, increaseBy}) => (
<>
<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>