-
Notifications
You must be signed in to change notification settings - Fork 62
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Nishant Pai
authored and
Nishant Pai
committed
May 3, 2023
1 parent
7b6ad18
commit 7a1cf1e
Showing
1 changed file
with
14 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,23 @@ | ||
import React from 'react'; | ||
import { GiHamburgerMenu } from 'react-icons/gi'; | ||
import { IoMdClose } from 'react-icons/io'; | ||
import React from "react"; | ||
import { GiHamburgerMenu } from "react-icons/gi"; | ||
import { IoMdClose } from "react-icons/io"; | ||
|
||
function Navbar({ title, menu, showMenu, setShowMenu }) { | ||
return ( | ||
<div className="bg-black w-full flex justify-between items-center p-4"> | ||
<h1 className="text-lg text-white font-medium">{title}</h1> | ||
{menu && | ||
<div className="md:hidden text-md text-white" onClick={() => setShowMenu(!showMenu)}> | ||
<a className="text-lg text-white font-medium" href="/"> | ||
{title} | ||
</a> | ||
{menu && ( | ||
<div | ||
className="md:hidden text-md text-white" | ||
onClick={() => setShowMenu(!showMenu)} | ||
> | ||
{showMenu ? <IoMdClose /> : <GiHamburgerMenu />} | ||
</div> | ||
} | ||
)} | ||
</div> | ||
) | ||
); | ||
} | ||
|
||
export default Navbar; | ||
export default Navbar; |