Skip to content

Commit 1353d9e

Browse files
committed
Add feedback while we update the cart
1 parent 27b982a commit 1353d9e

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

components/Cart/AddToCartButton.component.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { v4 as uuidv4 } from 'uuid';
55
import { useQuery, useMutation } from '@apollo/react-hooks';
66

77
import { AppContext } from 'utils/context/AppContext';
8-
import LoadingSpinner from '../LoadingSpinner/LoadingSpinner.component';
8+
import LoadingSpinner from 'components/LoadingSpinner/LoadingSpinner.component';
99

1010
import { GET_CART } from 'utils/const/GQL_QUERIES';
1111
import { ADD_TO_CART } from 'utils/const/GQL_MUTATIONS';

components/Cart/CartPage/CartItemsContainer.component.jsx

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import {
1313
import PageTitle from 'components/Header/PageTitle.component';
1414
import RegularCart from './RegularCart.component';
1515
import MobileCart from './MobileCart.component';
16+
import LoadingSpinner from 'components/LoadingSpinner/LoadingSpinner.component';
1617

1718
import { GET_CART } from 'utils/const/GQL_QUERIES';
1819
import { UPDATE_CART } from 'utils/const/GQL_MUTATIONS';
@@ -103,6 +104,17 @@ const CartItemsContainer = () => {
103104
</button>
104105
</Link>
105106
</div>
107+
{updateCartProcessing && (
108+
<>
109+
<div className="mt-4 text-xl text-left">
110+
Oppdaterer antall, vennligst vent ...
111+
<br />
112+
</div>
113+
<div>
114+
<LoadingSpinner />
115+
</div>
116+
</>
117+
)}
106118
</div>
107119
) : (
108120
<div className="p-6 mx-auto mt-5">

0 commit comments

Comments
 (0)