Skip to content

Commit

Permalink
More adjustments to my use state function.
Browse files Browse the repository at this point in the history
  • Loading branch information
ChrisForti committed Aug 4, 2024
1 parent db7d6ab commit 140db25
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions src/components/Header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,21 +7,26 @@ type HeaderProps = {
export function Header({ setHeaderNavigation }: HeaderProps) {
const [isOpen, setIsOpen] = useState(false);

const toggleHeader = () => {
setIsOpen(!isOpen);
setHeaderNavigation((prev) => prev + 1);
};

return (
<header className="bg-black">
<div className="container mx-auto flex items-center justify-between px-10 py-6">
<div>
<a
onClick={setHeaderNavigation}
<span
onClick={toggleHeader}
className="bg-gradient-to-tr from-indigo-600 to-green-600 bg-clip-text text-4xl font-bold text-transparent hover:cursor-pointer"
>
React Blog
</a>
<a href="/Mainpage">React Blog</a>
</span>
</div>
<nav className="flex items-center">
<ul className="hidden items-center space-x-4 sm:flex">
<li
onClick={setHeaderNavigation}
onClick={toggleHeader}
className="text-md from-indigo-600 to-green-600 hover:text-indigo-600"
>
<a href="/Mainpage">Home</a>
Expand Down

0 comments on commit 140db25

Please sign in to comment.