Skip to content

Commit

Permalink
fix: align nav in Header to the right
Browse files Browse the repository at this point in the history
  • Loading branch information
Lorenzo García Moreno committed Jan 24, 2022
1 parent 93935de commit 89cfd75
Showing 1 changed file with 28 additions and 30 deletions.
58 changes: 28 additions & 30 deletions src/components/features/Header/Header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,36 +14,34 @@ export function Header({ navigation, githubLink }: HeaderProps) {
const [isMobileNavigationOpen, { toggle }] = useToggle()

return (
<header className="h-24 sm:h-32 flex items-center z-30 w-full">
<div className="flex items-center justify-between">
<Link href="/" className="uppercase text-white font-black text-3xl flex items-center">
lorenzogm.com
</Link>
<div className="flex items-center">
<nav
className={clsx(
'font-sen text-gray-800 text-white uppercase text-lg lg:flex items-center',
isMobileNavigationOpen === 'OPEN'
? 'absolute inset-x-0 top-20 bottom-10 bg-gray-800 h-100vh z-30'
: 'hidden',
)}
>
{navigation.map((navigationItem) => (
<Link key={navigationItem.href} href={navigationItem.href}>
{navigationItem.name}
</Link>
))}
<Link href={githubLink}>GitHub</Link>
</nav>
<span className="sr-only">Open main menu</span>
<button className="lg:hidden flex flex-col ml-4" onClick={toggle} aria-label="Toggle mobile navigation">
{isMobileNavigationOpen === 'CLOSED' ? (
<MenuIcon className="block h-6 w-6" />
) : (
<XIcon className="block h-6 w-6" />
)}
</button>
</div>
<header className="h-24 sm:h-32 flex items-center z-30 w-full justify-between">
<Link href="/" className="uppercase text-white font-black text-3xl flex items-center">
lorenzogm.com
</Link>
<div className="flex items-center">
<nav
className={clsx(
'text-white uppercase text-lg lg:flex items-center',
isMobileNavigationOpen === 'OPEN'
? 'absolute inset-x-0 top-20 bottom-10 bg-gray-800 h-100vh z-30'
: 'hidden',
)}
>
{navigation.map((navigationItem) => (
<Link key={navigationItem.href} href={navigationItem.href}>
{navigationItem.name}
</Link>
))}
<Link href={githubLink}>GitHub</Link>
</nav>
<span className="sr-only">Open main menu</span>
<button className="lg:hidden flex flex-col ml-4" onClick={toggle} aria-label="Toggle mobile navigation">
{isMobileNavigationOpen === 'CLOSED' ? (
<MenuIcon className="block h-6 w-6" />
) : (
<XIcon className="block h-6 w-6" />
)}
</button>
</div>
</header>
)
Expand Down

1 comment on commit 89cfd75

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Deploy preview for lorenzogm ready!

✅ Preview
https://lorenzogm-dflq500zb-lorenzogm.vercel.app

Built with commit 89cfd75.
This pull request is being automatically deployed with vercel-action

Please sign in to comment.