-
Notifications
You must be signed in to change notification settings - Fork 0
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
1 parent
704cbd4
commit 3ef7446
Showing
6 changed files
with
83 additions
and
63 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import { useRouter } from 'next/router' | ||
import { Twirl as Hamburger } from 'hamburger-react' | ||
import { HeaderLinks } from './headerLinks' | ||
import { MenuProps } from '../menu' | ||
|
||
export const Header = ({ show, setShow }: MenuProps) => { | ||
const router = useRouter() | ||
const { pathname } = router | ||
|
||
return ( | ||
<div className='z-50 top-0 w-full bg-[#1B1B1B]'> | ||
<div className='max-w-screen-2xl mx-auto'> | ||
<div className='px-6 w-full h-16 flex items-center relative transition-all justify-between sm:justify-start'> | ||
<h1 className=' text-4xl font-bold sm:text-5xl'>John Roberts</h1> | ||
<div className={`absolute sm:hidden z-10 ${show ? 'right-6' : 'right-4'}`}> | ||
<Hamburger toggle={setShow} toggled={show} direction='right' rounded /> | ||
</div> | ||
</div> | ||
{/* <HeaderLinks pathname={pathname} /> */} | ||
</div> | ||
</div> | ||
) | ||
} |
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 |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import { useRouter } from 'next/router' | ||
import { links } from '@/lib/links' | ||
import Link from 'next/link' | ||
|
||
type HeaderLinkProps = { | ||
linkName: string | ||
linkPath: string | ||
pathname: string | ||
} | ||
|
||
const HeaderLink = ({ linkName, linkPath, pathname }: HeaderLinkProps) => { | ||
return ( | ||
<Link href={linkPath}> | ||
<div className={`${pathname == linkPath ? 'text-red-500' : 'text-[var(--fg)]'} hover:text-red-500 transition-all ease-in-out duration-200`}> | ||
{linkName} | ||
</div> | ||
</Link> | ||
) | ||
} | ||
|
||
export const HeaderLinks = () => { | ||
const router = useRouter() | ||
const { pathname } = router | ||
|
||
return ( | ||
<div className={`hidden sm:flex sticky top-0 z-20 w-full h-8 gap-7 items-center justify-center bg-black font-semibold pr-4 md:justify-end `}> | ||
{links.map((link) => ( | ||
<HeaderLink pathname={pathname} key={link.linkName} linkName={link.linkName} linkPath={link.linkPath} /> | ||
))} | ||
</div> | ||
) | ||
} |
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
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
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
3ef7446
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
john-portfolio – ./
john-portfolio-git-main-flapshatner.vercel.app
john-portfolio-xi.vercel.app
john-portfolio-flapshatner.vercel.app