mirror of
https://github.com/ershisan99/DevToysWeb.git
synced 2025-12-17 12:32:56 +00:00
wip: add icon and button
This commit is contained in:
@@ -1,18 +1,29 @@
|
||||
import { useCallback } from "react";
|
||||
import Link from "next/link";
|
||||
|
||||
import { siteConfig } from "@/config/site";
|
||||
import { cn } from "@/lib/style";
|
||||
import * as icons from "@/components/icons";
|
||||
import { Menu } from "@/components/icons";
|
||||
import { ThemeToggle } from "@/components/theme-toggle";
|
||||
|
||||
type Props = {
|
||||
className?: string;
|
||||
isMenuOpen?: boolean;
|
||||
onMenuToggle?: (newValue: boolean) => void;
|
||||
};
|
||||
|
||||
export function SiteHeader({ className }: Props) {
|
||||
export function SiteHeader({ className, isMenuOpen, onMenuToggle }: Props) {
|
||||
const handleMenuToggle = useCallback(() => {
|
||||
onMenuToggle?.(!isMenuOpen);
|
||||
}, [isMenuOpen, onMenuToggle]);
|
||||
|
||||
return (
|
||||
<header className={cn("flex items-center justify-between px-4", className)}>
|
||||
<div className="flex items-baseline gap-x-2.5">
|
||||
<button type="button" className="flex items-center self-center" onClick={handleMenuToggle}>
|
||||
<Menu />
|
||||
</button>
|
||||
<Link className="text-lg" href="/">
|
||||
{siteConfig.name}
|
||||
</Link>
|
||||
|
||||
Reference in New Issue
Block a user