1
mirror of https://github.com/jakejarvis/jarv.is.git synced 2025-04-26 03:05:24 -04:00
2025-04-24 11:20:02 -04:00

50 lines
1.6 KiB
TypeScript

import Image from "next/image";
import Link from "../Link";
import Menu from "../Menu";
import cn from "../../lib/helpers/classnames";
import * as config from "../../lib/config";
import type { ComponentPropsWithoutRef } from "react";
import avatarImg from "../../app/avatar.jpg";
export type HeaderProps = ComponentPropsWithoutRef<"header">;
const Header = ({ className, ...rest }: HeaderProps) => {
return (
<header
className={cn(
"bg-background-outer/70 sticky top-0 z-100 h-24 w-full border-b border-gray-300 backdrop-blur-xs backdrop-saturate-180 md:h-18",
className
)}
{...rest}
>
<nav className="max-w-default mx-auto flex h-full w-full items-center justify-between px-5 py-3 md:py-5">
<Link
dynamicOnHover
href="/"
rel="author"
aria-label={config.authorName}
className="hover:text-link flex flex-shrink-0 items-center text-gray-700 hover:no-underline"
>
<Image
src={avatarImg}
alt={`Photo of ${config.authorName}`}
className="h-[70px] w-[70px] rounded-full border-2 border-gray-400 md:h-[48px] md:w-[48px] md:border"
width={70}
height={70}
quality={50}
priority
/>
<span className="mx-2.5 hidden text-lg leading-none font-medium tracking-[0.02em] md:block">
{config.authorName}
</span>
</Link>
<Menu className="ml-6 w-full max-w-64 sm:ml-4 sm:max-w-96 md:ml-0 md:max-w-none" />
</nav>
</header>
);
};
export default Header;