anna-product-pack1 0.0.1 → 0.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +38 -0
- package/package.json +10 -4
package/README.md
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
# DO Products Pack
|
|
2
|
+
|
|
3
|
+
Este es el paquete de productos de React, el cual contiene los componentes necesarios para mostrar un producto, su imagen, título y botones para aumentar o disminuir la cantidad del producto.
|
|
4
|
+
|
|
5
|
+
## Example:
|
|
6
|
+
|
|
7
|
+
```tsx
|
|
8
|
+
<ProductCard
|
|
9
|
+
key={product.id}
|
|
10
|
+
product={product}
|
|
11
|
+
className="bg-dark text-white"
|
|
12
|
+
initialValues={{
|
|
13
|
+
count: 6,
|
|
14
|
+
// maxCount: 10,
|
|
15
|
+
}}
|
|
16
|
+
>
|
|
17
|
+
{({ reset, count, isMaxCountReached, maxCount, increaseBy }) => (
|
|
18
|
+
<>
|
|
19
|
+
<ProductImage
|
|
20
|
+
className="custom-image"
|
|
21
|
+
style={{ boxShadow: "10px 10px 10px rgba(0,0,0,0.2)" }}
|
|
22
|
+
/>
|
|
23
|
+
<ProductTitle className="text-bold" />
|
|
24
|
+
<ProductButtons className="custom-buttons" />
|
|
25
|
+
|
|
26
|
+
<button onClick={reset}>Reset</button>
|
|
27
|
+
<button onClick={() => increaseBy(-2)}> -2 </button>
|
|
28
|
+
{!isMaxCountReached && (
|
|
29
|
+
<button onClick={() => increaseBy(+2)}> +2 </button>
|
|
30
|
+
)}
|
|
31
|
+
|
|
32
|
+
<span>
|
|
33
|
+
{count} - {maxCount}
|
|
34
|
+
</span>
|
|
35
|
+
</>
|
|
36
|
+
)}
|
|
37
|
+
</ProductCard>
|
|
38
|
+
```
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "anna-product-pack1",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.2",
|
|
4
4
|
"description": "Mi librería de componentes React",
|
|
5
5
|
"main": "dist/index.cjs.js",
|
|
6
6
|
"module": "dist/index.esm.js",
|
|
@@ -17,9 +17,15 @@
|
|
|
17
17
|
"react": ">=17.0.0",
|
|
18
18
|
"react-dom": ">=17.0.0"
|
|
19
19
|
},
|
|
20
|
-
"keywords": [
|
|
21
|
-
|
|
22
|
-
|
|
20
|
+
"keywords": [
|
|
21
|
+
"react",
|
|
22
|
+
"components",
|
|
23
|
+
"product-card",
|
|
24
|
+
"typescript"
|
|
25
|
+
],
|
|
26
|
+
"author": "Anna Acevedo",
|
|
27
|
+
"license": "MIT",
|
|
28
|
+
"type": "commonjs",
|
|
23
29
|
"devDependencies": {
|
|
24
30
|
"@rollup/plugin-commonjs": "^29.0.3",
|
|
25
31
|
"@rollup/plugin-node-resolve": "^16.0.3",
|