-
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
Showing
11 changed files
with
122 additions
and
18 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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
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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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,49 @@ | ||
"use client"; | ||
|
||
import { Drawer } from "vaul"; | ||
import Image from "next/image"; | ||
import Link from "next/link"; | ||
import { Button } from "@/components/ui/button"; | ||
import ComposeLogo from "./compose-icon.png"; | ||
import React from "react"; | ||
import { Menu } from "./menu"; | ||
import { MenuIcon } from "lucide-react"; | ||
|
||
interface HeaderProps {} | ||
|
||
export const Header: React.FC<HeaderProps> = () => { | ||
return ( | ||
<header className="border-b mb-10 py-2 sticky top-0 flex-none w-full mx-auto bg-white border-gray-200 dark:border-gray-600 dark:bg-gray-800"> | ||
<div className="flex gap-2 max-w-2xl mx-auto items-center justify-between container"> | ||
<Link className="flex gap-2 relative items-center" href="/"> | ||
<Image | ||
src={ComposeLogo} | ||
alt="Simple Press Logo" | ||
className="object-contain" | ||
height={50} | ||
/> | ||
<h1>Simple Press</h1> | ||
</Link> | ||
<div className="flex gap-4 items-center"> | ||
<Menu className="hidden md:block" /> | ||
</div> | ||
|
||
<Drawer.Root direction="right"> | ||
<Drawer.Trigger asChild className="md:hidden"> | ||
<Button size="icon" variant="ghost" asChild> | ||
<MenuIcon className="h-4 w-4 justify-end" /> | ||
</Button> | ||
</Drawer.Trigger> | ||
<Drawer.Portal> | ||
<Drawer.Overlay className="fixed inset-0 bg-black/40" /> | ||
<Drawer.Content className="bg-white flex flex-col h-full w-40 mt-24 fixed bottom-0 right-0 py-10"> | ||
<div className="flex flex-col items-center justify-center"> | ||
<Menu mobile /> | ||
</div> | ||
</Drawer.Content> | ||
</Drawer.Portal> | ||
</Drawer.Root> | ||
</div> | ||
</header> | ||
); | ||
}; |
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 @@ | ||
export { Header } from "./header"; |
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,46 @@ | ||
import { Edit as EditIcon, LogIn as LogInIcon } from "lucide-react"; | ||
|
||
import Link from "next/link"; | ||
import { Button } from "@/components/ui/button"; | ||
import { Separator } from "@/components/ui/separator"; | ||
import React from "react"; | ||
import { cn } from "@/lib/utils"; | ||
|
||
interface MenuProps { | ||
mobile?: boolean; | ||
className?: string; | ||
} | ||
|
||
const menuItems = [ | ||
{ icon: EditIcon, label: "Add Post", link: "/admin?overlay=new-post" }, | ||
{ icon: LogInIcon, label: "Login", link: "#" }, | ||
]; | ||
|
||
export const Menu: React.FC<MenuProps> = ({ mobile, className = "" }) => { | ||
return ( | ||
<div | ||
className={cn("flex items-center gap-4", { | ||
"flex-col items-start": mobile, | ||
className, | ||
})} | ||
> | ||
{menuItems.map((item) => ( | ||
<> | ||
<Button variant="ghost" asChild> | ||
<Link | ||
key={item.label} | ||
href={item.link} | ||
className={cn("flex items-center", { | ||
"items-start justify-start": mobile, | ||
})} | ||
> | ||
<item.icon className="mr-2" /> | ||
{item.label} | ||
</Link> | ||
</Button> | ||
{mobile && <Separator />} | ||
</> | ||
))} | ||
</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