Skip to content

Commit ea948f1

Browse files
committed
HashRouter added
1 parent 39df8c7 commit ea948f1

File tree

4 files changed

+10
-5
lines changed

4 files changed

+10
-5
lines changed

src/components/Cart/Cart.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import CartContent from "./CartContent";
33
import "./CartContent.scss";
44

55
const Cart = ({ cartContents }) => {
6-
if (cartContents.length === 0) return false;
6+
if (cartContents.length === 0) return <div></div>;
77
return (
88
<div className="py-5 px-6">
99
<div className="lg:container mx-auto">

src/components/Cart/CartContent.jsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import React, { useEffect, useState } from "react";
1+
import React from "react";
22
import { commerce } from "../../lib/commerce";
33
import "./CartContent.scss";
44

@@ -8,7 +8,6 @@ const CartContent = ({ cartItem }) => {
88
const removeTheCartItem = (itemID) => {
99
commerce.cart.remove(itemID);
1010
};
11-
console.log(cartItem);
1211
return (
1312
<>
1413
<div className="e-grid-container-cart border my-5 p-2 font-light">

src/components/SpecsCmp/SpecsCmp.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ const SpecsCmp = ({ currentItem, addItemsToCart }) => {
99
const inputChangeHandler = (e) => {
1010
setTotalItem(parseInt(e.target.value));
1111
};
12-
if (currentItem.length === 0) return null;
12+
if (currentItem.length === 0) return <div></div>;
1313
return (
1414
<div className="py-5 px-6">
1515
<div className="lg:container mx-auto">

src/index.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
import React from "react";
22
import ReactDOM from "react-dom";
3+
import { HashRouter } from "react-router-dom";
34
import App from "./components/App";
45
import "./index.css";
56

6-
ReactDOM.render(<App />, document.getElementById("root"));
7+
ReactDOM.render(
8+
<HashRouter>
9+
<App />
10+
</HashRouter>,
11+
document.getElementById("root")
12+
);

0 commit comments

Comments
 (0)