From d43bb99d013030055d6f696484afc635f8f87b74 Mon Sep 17 00:00:00 2001 From: prafullnavkar <87638003+prafullnavkar@users.noreply.github.com> Date: Thu, 16 Feb 2023 23:39:42 +0530 Subject: [PATCH] added home text in header when it is contact section --- src/component/Header.js | 50 ++++++++++++++++++++++++++++------------- 1 file changed, 34 insertions(+), 16 deletions(-) diff --git a/src/component/Header.js b/src/component/Header.js index aef2a80..693a3d3 100644 --- a/src/component/Header.js +++ b/src/component/Header.js @@ -1,19 +1,37 @@ -import React from 'react' -import { Link } from 'react-router-dom' -import headLogo from '../assets/head-logo.png' -// import cartLogo from '../assets/cart-logo.png' +import React from "react"; +import { Link } from "react-router-dom"; +import headLogo from "../assets/head-logo.png"; +import { useLocation } from "react-router-dom"; const Header = () => { - return ( -
- img + const location = useLocation(); -
- {/* About */} - Contact - {/*
img
*/} -
-
- ) -} -export default Header \ No newline at end of file + return ( +
+
+ + img + + {location.pathname === "/contact" && ( + + Home + + )} +
+
+ {/* About */} + + Contact + + {/*
img
*/} +
+
+ ); +}; +export default Header;