Skip to content

Commit dffbe55

Browse files
committed
Remove unused files and console logs
1 parent 1411b6f commit dffbe55

File tree

3 files changed

+5
-29
lines changed

3 files changed

+5
-29
lines changed

components/Cart/AddToCartButton.component.jsx

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -15,26 +15,19 @@ import { getFormattedCart } from 'utils/functions/functions';
1515
/**
1616
* Display and process product object when we click on the Add To Cart button
1717
* Adds product to shopping cart
18-
* @param {Object} props
18+
* @param {Object} product
1919
*/
20-
const AddToCartButton = (props) => {
20+
const AddToCartButton = ({ product }) => {
2121
const [cart, setCart] = useContext(AppContext);
2222
const [requestError, setRequestError] = useState(null);
2323
const [showViewCart, setShowViewCart] = useState(false);
2424
const [showAddToCart, setshowAddToCart] = useState(false);
2525

26-
const product = props.product;
27-
2826
const productId = product.productId ? product.productId : product;
2927

30-
console.log("Props from Addtocart");
31-
console.log(props);
32-
3328
const productQueryInput = {
3429
clientMutationId: uuidv4(), // Generate a unique id.
35-
//productId: product.productId,
36-
//productId: product
37-
productId: productId
30+
productId: productId,
3831
};
3932

4033
// Get Cart Data.
@@ -59,8 +52,7 @@ const AddToCartButton = (props) => {
5952
onCompleted: (data) => {
6053
// If error.
6154
if (addToCartError) {
62-
console.log('Add to cart error');
63-
//setRequestError(addToCartError.graphQLErrors[0].message);
55+
setRequestError(addToCartError.graphQLErrors[0].message);
6456
}
6557
// Update the cart with new values in React context.
6658
refetch();
@@ -70,9 +62,7 @@ const AddToCartButton = (props) => {
7062
},
7163
onError: (error) => {
7264
if (error) {
73-
console.log('Error inside add to cart');
7465
setRequestError(error);
75-
console.log(error);
7666
}
7767
},
7868
});

components/SVG/SVGX.component.jsx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@
33
*/
44

55
const SVGX = ({ cartKey, products, handleRemoveProductClick }) => {
6-
//console.log("Props: ");
7-
//console.log(props);
86
return (
97
<>
108
<svg
@@ -20,7 +18,7 @@ const SVGX = ({ cartKey, products, handleRemoveProductClick }) => {
2018
strokeLinejoin="round"
2119
className="cursor-pointer feather feather-x"
2220
onClick={(event) => {
23-
handleRemoveProductClick( event, cartKey, products )
21+
handleRemoveProductClick(event, cartKey, products);
2422
}}
2523
>
2624
<line x1="18" y1="6" x2="6" y2="18"></line>

utils/validator/checkoutValidator.js

Lines changed: 0 additions & 12 deletions
This file was deleted.

0 commit comments

Comments
 (0)