Skip to content

Commit ce0c152

Browse files
committed
Delete unused code
1 parent 904f401 commit ce0c152

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

components/Cart/AddToCartButton.component.jsx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@ import { getFormattedCart } from 'utils/functions/functions';
1818
* @param {Object} product
1919
*/
2020
const AddToCartButton = ({ product }) => {
21-
const [cart, setCart] = useContext(AppContext);
22-
const [requestError, setRequestError] = useState(null);
23-
const [showViewCart, setShowViewCart] = useState(false);
21+
const [, setCart] = useContext(AppContext);
22+
const [, setRequestError] = useState(null);
23+
const [, setShowViewCart] = useState(false);
2424
const [showAddToCart, setshowAddToCart] = useState(false);
2525

2626
const productId = product.databaseId ? product.databaseId : product;
@@ -31,7 +31,7 @@ const AddToCartButton = ({ product }) => {
3131
};
3232

3333
// Get Cart Data.
34-
const { loading, error, data, refetch } = useQuery(GET_CART, {
34+
const { data, refetch } = useQuery(GET_CART, {
3535
notifyOnNetworkStatusChange: true,
3636
onCompleted: () => {
3737
// Update cart in the localStorage.
@@ -44,12 +44,12 @@ const AddToCartButton = ({ product }) => {
4444

4545
const [
4646
addToCart,
47-
{ data: addToCartRes, loading: addToCartLoading, error: addToCartError },
47+
{ loading: addToCartLoading, error: addToCartError },
4848
] = useMutation(ADD_TO_CART, {
4949
variables: {
5050
input: productQueryInput,
5151
},
52-
onCompleted: (data) => {
52+
onCompleted: () => {
5353
// If error.
5454
if (addToCartError) {
5555
setRequestError(addToCartError.graphQLErrors[0].message);

components/Cart/CartPage/MobileCartItem.component.jsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,8 @@ const MobileCartItem = ({
5858
</td>
5959
<td className="h-12 p-3">{item.name}</td>
6060
<td className="h-12 p-3">
61-
kr{'string' !== typeof item.price ? item.price.toFixed(2) : item.price}
61+
kr
62+
{'string' !== typeof item.price ? item.price.toFixed(2) : item.price}
6263
</td>
6364
<td className="h-12 p-3">
6465
<input

0 commit comments

Comments
 (0)