diff --git a/frontend/src/components/Header.js b/frontend/src/components/Header.js index d3dd207..8067a1d 100644 --- a/frontend/src/components/Header.js +++ b/frontend/src/components/Header.js @@ -8,6 +8,7 @@ import { FiPhoneCall, FiUser } from 'react-icons/fi' import { FaCircle } from 'react-icons/fa' import SearchBox from './SearchBox' import { Route } from 'react-router' +import { useLocation } from 'react-router' const Header = () => { const dispatch = useDispatch() @@ -18,6 +19,8 @@ const Header = () => { const logoutHandler = () => { dispatch(logout()) } + const location = useLocation() + return (
@@ -37,11 +40,7 @@ const Header = () => { - {cartItems.length > 0 ? ( - - ) : ( - '' - )} + {cartItems.length > 0 && } @@ -87,7 +86,15 @@ const Header = () => { - } /> + + {location.pathname === '/login' || + location.pathname === '/register' || + location.pathname === '/forgotpassword' || + location.pathname === '/forgotpassword/:email' ? ( + '' + ) : ( + } /> + )}
) } diff --git a/frontend/src/reducers/productReducers.js b/frontend/src/reducers/productReducers.js index 7950c2f..06cda2f 100644 --- a/frontend/src/reducers/productReducers.js +++ b/frontend/src/reducers/productReducers.js @@ -76,7 +76,7 @@ export const productDetailsReducer = (state = { product: {} }, action) => { case PRODUCT_DETAILS_FAIL: return { loading: false, error: action.payload } case PRODUCT_DETAILS_RESET: - return {product: {}} + return { product: {} } default: return state }