mvrh-products-pack
v0.1.0
Published
Mi librería de componentes React!
Downloads
59
Readme
DO Products Pack
Example:
<ProductCard
product={product}
className="bg-dark text-white"
initialValues={{
count: 6,
maxCount: 10,
}}
>
{({ reset, increaseBy, count, isMaxCountReached, maxCount }) => (
<>
<ProductImage
className="custom-image"
style={{
boxShadow: "10px 10px 10px rgba(0,0,0,0.2)",
}}
/>
<ProductTitle className="text-white 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>
