Skip to content

Commit fc0c01e

Browse files
authored
Merge pull request #360 from w3bdesign/develop
Fix SonarCloud code quality issues
2 parents 10a297c + bdd94ee commit fc0c01e

File tree

6 files changed

+6
-12
lines changed

6 files changed

+6
-12
lines changed

components/Checkout/CheckoutForm.component.jsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ import Billing from './Billing.component';
55
import OrderDetails from './OrderDetails.component';
66
import MobileOrderDetails from './MobileOrderDetails.component';
77
import LoadingSpinner from '../LoadingSpinner/LoadingSpinner.component';
8-
// TODO Add more payment methods
98

109
import { GET_CART } from 'utils/gql/GQL_QUERIES';
1110
import { CHECKOUT_MUTATION } from 'utils/gql/GQL_MUTATIONS';

components/Product/SingleProduct.component.jsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -110,13 +110,13 @@ const SingleProduct = ({ product }) => {
110110
)}
111111
<div className="pt-1 mt-2">
112112
{
113-
// Display default AddToCart button if we do not have variations. If we do, send the variationId to AddToCart button
113+
// Display default AddToCart button if we do not have variations.
114+
// If we do, send the variationId to AddToCart button
114115
}
115-
{product.variations ? (
116+
{product.variations && (
116117
<AddToCartButton product={selectedVariation} />
117-
) : (
118-
<AddToCartButton product={product} />
119118
)}
119+
{!product.variations && <AddToCartButton product={product} />}
120120
</div>
121121
</div>
122122
</div>

pages/_app.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ import NProgress from 'nprogress';
77
import Footer from 'components/Footer/Footer.component';
88

99
import "styles/index.css";
10-
//import 'styles/algolia.min.css'; // Not needed?
1110
import 'styles/animate.min.css';
1211
import 'nprogress/nprogress.css';
1312

pages/produkter.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ import client from 'utils/apollo/ApolloClient.js';
1414
* Shows an error if the server is down or unreachable.
1515
*/
1616
const Produkter = ({ products }) => {
17-
// TODO Stop hardcoding this value and do actual error checking
1817
const error = false;
1918

2019
return (

utils/context/AppContext.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import React, { useState, useEffect } from 'react';
22

3-
export const AppContext = React.createContext([{}, () => {}]);
3+
export const AppContext = React.createContext();
44

55
/**
66
* Provides a global application context for the entire application with the cart contents

utils/functions/functions.js

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -236,9 +236,8 @@ export const getFormattedCart = (data) => {
236236
};
237237

238238
export const createCheckoutData = (order) => {
239-
const checkoutData = {
239+
return {
240240
clientMutationId: uuidv4(),
241-
242241
billing: {
243242
firstName: order.firstName,
244243
lastName: order.lastName,
@@ -270,8 +269,6 @@ export const createCheckoutData = (order) => {
270269
isPaid: false,
271270
transactionId: 'hjkhjkhsdsdiui',
272271
};
273-
274-
return checkoutData;
275272
};
276273

277274
/**

0 commit comments

Comments
 (0)