@arcteryx/components-cart
Advanced tools
Comparing version 4.1.1 to 4.1.2
@@ -6,2 +6,13 @@ # Change Log | ||
## [4.1.2](http://bitbucket.org/arcteryx/arcteryx-js-helpers/compare/@arcteryx/components-cart@4.1.1...@arcteryx/components-cart@4.1.2) (2020-11-24) | ||
### Bug Fixes | ||
* TMS-699 use Product model for increase/descrese/set quantity ([e04e5ab](http://bitbucket.org/arcteryx/arcteryx-js-helpers/commits/e04e5ab495c0702b063dc7d557d557228f4f7ff0)) | ||
## [4.1.1](http://bitbucket.org/arcteryx/arcteryx-js-helpers/compare/@arcteryx/components-cart@4.1.0...@arcteryx/components-cart@4.1.1) (2020-11-18) | ||
@@ -8,0 +19,0 @@ |
{ | ||
"name": "@arcteryx/components-cart", | ||
"version": "4.1.1", | ||
"version": "4.1.2", | ||
"description": "Arcteryx Cart", | ||
@@ -18,3 +18,3 @@ "source": "src/index.js", | ||
"license": "ISC", | ||
"gitHead": "47c985af2a405f2643220bf6da3385686558ad24", | ||
"gitHead": "9edbcc80a5aa563bc8b1825ab0a379c223d323cc", | ||
"peerDependencies": { | ||
@@ -21,0 +21,0 @@ "@arcteryx/components-contexts": "^1.1.0", |
import { Button } from "@arcteryx/components-button"; | ||
import { TasCart } from '@arcteryx/data-models'; | ||
import { TasCart, Product as ProductModel } from '@arcteryx/data-models'; | ||
import React, { useState } from "react"; | ||
@@ -33,2 +33,9 @@ import styled from "styled-components"; | ||
const [prod, setProduct] = useState(product); | ||
const updateProductQuantity = (quantity) => { | ||
let clone = new ProductModel({...prod}); | ||
clone.quantity = Number(quantity); | ||
setProduct(clone); | ||
} | ||
return ( | ||
@@ -41,5 +48,5 @@ <CartProduct | ||
isFlyIn={isFlyIn} | ||
handleIncrement={() => setProduct({ ...prod, quantity: prod.quantity + 1 })} | ||
handleDecrement={() => setProduct({ ...prod, quantity: prod.quantity - 1 })} | ||
handleChange={val => setProduct({ ...prod, quantity: val })} | ||
handleIncrement={() => updateProductQuantity(prod.quantity + 1)} | ||
handleDecrement={() => updateProductQuantity(prod.quantity - 1)} | ||
handleChange={val => updateProductQuantity(val)} | ||
handleRemove={() => setProduct(null)} | ||
@@ -46,0 +53,0 @@ /> |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
374918
4435