Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 34 additions & 16 deletions src/component/Header.js
Original file line number Diff line number Diff line change
@@ -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 (
<div className='bg-black flex justify-between py-2 px-2' >
<Link to='/'><img src={headLogo} alt='img' className='md:w-10 md:h-10 w-10 h-10' /></Link>
const location = useLocation();

<div className='flex justify-between items-center'>
{/* <Link to='about' className='pr-3 font-bold'>About</Link> */}
<Link to='contact' className='pr-3 font-bold text-white'>Contact</Link>
{/* <div className='pr-3 font-bold'><img src={cartLogo} alt='img'className='md:w-10 md:w-10 w-10 h-10'/></div> */}
</div>
</div>
)
}
export default Header
return (
<div className="bg-black flex justify-between py-2 px-2">
<div className="flex justify-center items-center gap-4">
<Link to="/">
<img src={headLogo} alt="img" className="md:w-10 md:h-10 w-10 h-10" />
</Link>
{location.pathname === "/contact" && (
<Link
to="/"
className="text-white hover:underline pr-3 font-bold text-sm md:text-base"
>
Home
</Link>
)}
</div>
<div className="flex justify-between items-center">
{/* <Link to='about' className='pr-3 font-bold'>About</Link> */}
<Link
to="contact"
className="pr-3 font-bold text-white text-sm md:text-base"
>
Contact
</Link>
{/* <div className='pr-3 font-bold'><img src={cartLogo} alt='img'className='md:w-10 md:w-10 w-10 h-10'/></div> */}
</div>
</div>
);
};
export default Header;