Skip to content

Commit

Permalink
Update doc comments
Browse files Browse the repository at this point in the history
  • Loading branch information
imranhsayed committed Jul 12, 2019
1 parent 7aabceb commit 3ad7eaa
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 6 deletions.
2 changes: 1 addition & 1 deletion components/ApolloClient.js
Expand Up @@ -4,7 +4,7 @@ import { createHttpLink } from 'apollo-link-http';
import config from './../client-config';
import fetch from 'isomorphic-unfetch';

// Apollo GraphQL client
// Apollo GraphQL client.
const client = new ApolloClient({
link: createHttpLink({
uri: config.graphqlUrl,
Expand Down
2 changes: 1 addition & 1 deletion components/cart/AddToCartButton.js
Expand Up @@ -34,7 +34,7 @@ const AddToCartButton = ( props ) => {

} else {
/**
* If No Items in the cart, create an empty array and add one
* If No Items in the cart, create an empty array and add one.
* @type {Array}
*/
const newCart = addFirstProduct( product );
Expand Down
1 change: 1 addition & 0 deletions components/cart/cart-page/CartItem.js
Expand Up @@ -14,6 +14,7 @@ const CartItem = ( { item, handleRemoveProductClick, setCart } ) => {
* @return {void}
*/
const handleQtyChange = ( event ) => {

if ( process.browser ) {

const newQty = event.target.value;
Expand Down
6 changes: 3 additions & 3 deletions components/checkout/CheckoutForm.js
Expand Up @@ -30,9 +30,9 @@ const CheckoutForm = () => {
const [ input, setInput ] = useState( initialState );

/*
* Handle form submit
* Handle form submit.
*
* @param {Object} event event
* @param {Object} event Event Object.
*
* @return {void}
*/
Expand All @@ -47,7 +47,7 @@ const CheckoutForm = () => {
/*
* Handle onchange input.
*
* @param {Object} event event
* @param {Object} event Event Object.
*
* @return {void}
*/
Expand Down
4 changes: 4 additions & 0 deletions components/context/AppContext.js
Expand Up @@ -9,11 +9,15 @@ export const AppProvider = ( props ) => {
const [ cart, setCart ] = useState( null );

useEffect( () => {

if ( process.browser ) {

let cartData = localStorage.getItem( 'wpd-cart' );
cartData = null !== cartData ? JSON.parse( cartData ) : '';
setCart( cartData );

}

}, [] );

return (
Expand Down
2 changes: 1 addition & 1 deletion pages/index.js
Expand Up @@ -6,7 +6,7 @@ import AddToCartButton from "../components/cart/AddToCartButton";
import Hero from "../components/home/Hero";

/**
* GraphQL products query
* GraphQL products query.
*/
const PRODUCTS_QUERY = gql`query {
products(first: 50) {
Expand Down

0 comments on commit 3ad7eaa

Please sign in to comment.