Add shared site header with account dropdown

Add SiteHeader and AccountDropdown components, replace
inline headers across homepage, roadmap, and docs layout.
This commit is contained in:
Aiden Smith
2026-02-26 12:10:31 -05:00
parent 09787926f3
commit 03a6df0848
6 changed files with 367 additions and 59 deletions

View File

@@ -2,6 +2,7 @@ import type { Metadata } from "next";
import Link from "next/link";
import { Globe, BookOpen, Menu } from "lucide-react";
import { ThemeToggle } from "@/components/theme-toggle";
import { AccountDropdown } from "@/components/account-dropdown";
import { DocsSidebar } from "@/components/docs/sidebar";
export const metadata: Metadata = {
@@ -38,6 +39,7 @@ export default function DocsLayout({
</Link>
</div>
<ThemeToggle />
<AccountDropdown />
</div>
</header>

View File

@@ -1,5 +1,4 @@
import Link from "next/link";
import { Globe, Search, Shield, Activity } from "lucide-react";
import { Search, Shield, Activity } from "lucide-react";
import {
Card,
CardHeader,
@@ -7,7 +6,7 @@ import {
CardDescription,
} from "@/components/ui/card";
import { Badge } from "@/components/ui/badge";
import { ThemeToggle } from "@/components/theme-toggle";
import { SiteHeader } from "@/components/site-header";
import { DomainSearchForm } from "@/components/domain-search-form";
const features = [
@@ -34,38 +33,13 @@ const features = [
export default function Home() {
return (
<div className="flex min-h-screen flex-col">
{/* Header */}
<header className="border-b">
<div className="container mx-auto flex h-14 items-center justify-between px-4">
<div className="flex items-center gap-2">
<Globe className="size-5 text-primary" />
<span className="text-lg font-semibold tracking-tight">
VectorDNS
</span>
</div>
<div className="flex items-center gap-4">
<Link
href="/docs"
className="text-sm text-muted-foreground transition-colors hover:text-foreground"
>
Docs
</Link>
<Link
href="/roadmap"
className="text-sm text-muted-foreground transition-colors hover:text-foreground"
>
Roadmap
</Link>
<ThemeToggle />
</div>
</div>
</header>
<SiteHeader />
{/* Hero */}
<main className="flex flex-1 flex-col">
<section className="flex flex-col items-center justify-center gap-6 px-4 py-24 text-center md:py-32">
<Badge variant="secondary" className="text-sm">
Free DNS Toolkit
Total DNS Toolkit
</Badge>
<h1 className="max-w-2xl text-4xl font-bold tracking-tight sm:text-5xl">
DNS Lookup, WHOIS &amp;{" "}

View File

@@ -1,7 +1,6 @@
import type { Metadata } from "next";
import Link from "next/link";
import { Globe, Map, Info } from "lucide-react";
import { ThemeToggle } from "@/components/theme-toggle";
import { Map, Info } from "lucide-react";
import { SiteHeader } from "@/components/site-header";
import { RoadmapFlowchart } from "@/components/roadmap-flowchart";
import { Badge } from "@/components/ui/badge";
import {
@@ -19,32 +18,7 @@ export const metadata: Metadata = {
export default function RoadmapPage() {
return (
<div className="flex min-h-screen flex-col">
{/* Header */}
<header className="border-b bg-background/95 backdrop-blur supports-backdrop-filter:bg-background/60 sticky top-0 z-50">
<div className="container mx-auto flex h-14 items-center justify-between px-4">
<Link href="/" className="flex items-center gap-2">
<Globe className="size-5 text-primary" />
<span className="text-lg font-semibold tracking-tight">
VectorDNS
</span>
</Link>
<div className="flex items-center gap-4">
<Link
href="/docs"
className="text-sm text-muted-foreground transition-colors hover:text-foreground"
>
Docs
</Link>
<Link
href="/roadmap"
className="text-sm font-medium text-foreground transition-colors"
>
Roadmap
</Link>
<ThemeToggle />
</div>
</div>
</header>
<SiteHeader />
<main className="flex-1">
<div className="container mx-auto px-4 py-12">

View File

@@ -0,0 +1,64 @@
"use client";
import Link from "next/link";
import { CircleUser, User, Key, Bookmark, Bell, BarChart3 } from "lucide-react";
import {
DropdownMenu,
DropdownMenuContent,
DropdownMenuItem,
DropdownMenuLabel,
DropdownMenuSeparator,
DropdownMenuTrigger,
} from "@/components/ui/dropdown-menu";
export function AccountDropdown() {
return (
<DropdownMenu>
<DropdownMenuTrigger asChild>
<button className="text-muted-foreground transition-colors hover:text-foreground">
<CircleUser className="size-5" />
</button>
</DropdownMenuTrigger>
<DropdownMenuContent align="end" className="w-48">
<DropdownMenuLabel>USERNAME</DropdownMenuLabel>
<DropdownMenuSeparator />
<DropdownMenuItem asChild>
<Link href="/account" className="flex items-center gap-2">
<User className="size-4" />
Account
</Link>
</DropdownMenuItem>
<DropdownMenuItem asChild>
<Link href="/account/api-keys" className="flex items-center gap-2">
<Key className="size-4" />
API Keys
</Link>
</DropdownMenuItem>
<DropdownMenuItem asChild>
<Link
href="/account/saved-domains"
className="flex items-center gap-2"
>
<Bookmark className="size-4" />
Saved Domains
</Link>
</DropdownMenuItem>
<DropdownMenuItem asChild>
<Link
href="/account/notifications"
className="flex items-center gap-2"
>
<Bell className="size-4" />
Notifications
</Link>
</DropdownMenuItem>
<DropdownMenuItem asChild>
<Link href="/account/usage" className="flex items-center gap-2">
<BarChart3 className="size-4" />
Usage
</Link>
</DropdownMenuItem>
</DropdownMenuContent>
</DropdownMenu>
);
}

View File

@@ -0,0 +1,37 @@
"use client";
import Link from "next/link";
import { Globe } from "lucide-react";
import { ThemeToggle } from "@/components/theme-toggle";
import { AccountDropdown } from "@/components/account-dropdown";
export function SiteHeader() {
return (
<header className="border-b">
<div className="container mx-auto flex h-14 items-center justify-between px-4">
<div className="flex items-center gap-2">
<Globe className="size-5 text-primary" />
<Link href="/" className="text-lg font-semibold tracking-tight">
VectorDNS
</Link>
</div>
<div className="flex items-center gap-4">
<Link
href="/docs"
className="text-sm text-muted-foreground transition-colors hover:text-foreground"
>
Docs
</Link>
<Link
href="/roadmap"
className="text-sm text-muted-foreground transition-colors hover:text-foreground"
>
Roadmap
</Link>
<ThemeToggle />
<AccountDropdown />
</div>
</div>
</header>
);
}

View File

@@ -0,0 +1,257 @@
"use client";
import * as React from "react";
import { CheckIcon, ChevronRightIcon, CircleIcon } from "lucide-react";
import { DropdownMenu as DropdownMenuPrimitive } from "radix-ui";
import { cn } from "@/lib/utils";
function DropdownMenu({
...props
}: React.ComponentProps<typeof DropdownMenuPrimitive.Root>) {
return <DropdownMenuPrimitive.Root data-slot="dropdown-menu" {...props} />;
}
function DropdownMenuPortal({
...props
}: React.ComponentProps<typeof DropdownMenuPrimitive.Portal>) {
return (
<DropdownMenuPrimitive.Portal data-slot="dropdown-menu-portal" {...props} />
);
}
function DropdownMenuTrigger({
...props
}: React.ComponentProps<typeof DropdownMenuPrimitive.Trigger>) {
return (
<DropdownMenuPrimitive.Trigger
data-slot="dropdown-menu-trigger"
{...props}
/>
);
}
function DropdownMenuContent({
className,
sideOffset = 4,
...props
}: React.ComponentProps<typeof DropdownMenuPrimitive.Content>) {
return (
<DropdownMenuPrimitive.Portal>
<DropdownMenuPrimitive.Content
data-slot="dropdown-menu-content"
sideOffset={sideOffset}
className={cn(
"bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 max-h-(--radix-dropdown-menu-content-available-height) min-w-32 origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border p-1 shadow-md",
className,
)}
{...props}
/>
</DropdownMenuPrimitive.Portal>
);
}
function DropdownMenuGroup({
...props
}: React.ComponentProps<typeof DropdownMenuPrimitive.Group>) {
return (
<DropdownMenuPrimitive.Group data-slot="dropdown-menu-group" {...props} />
);
}
function DropdownMenuItem({
className,
inset,
variant = "default",
...props
}: React.ComponentProps<typeof DropdownMenuPrimitive.Item> & {
inset?: boolean;
variant?: "default" | "destructive";
}) {
return (
<DropdownMenuPrimitive.Item
data-slot="dropdown-menu-item"
data-inset={inset}
data-variant={variant}
className={cn(
"focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive ddata-[variant=destructive]:*:[svg]:text-destructive! [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-disabled:pointer-events-none data-disabled:opacity-50 data-inset:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
className,
)}
{...props}
/>
);
}
function DropdownMenuCheckboxItem({
className,
children,
checked,
...props
}: React.ComponentProps<typeof DropdownMenuPrimitive.CheckboxItem>) {
return (
<DropdownMenuPrimitive.CheckboxItem
data-slot="dropdown-menu-checkbox-item"
className={cn(
"focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-sm py-1.5 pr-2 pl-8 text-sm outline-hidden select-none data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
className,
)}
checked={checked}
{...props}
>
<span className="pointer-events-none absolute left-2 flex size-3.5 items-center justify-center">
<DropdownMenuPrimitive.ItemIndicator>
<CheckIcon className="size-4" />
</DropdownMenuPrimitive.ItemIndicator>
</span>
{children}
</DropdownMenuPrimitive.CheckboxItem>
);
}
function DropdownMenuRadioGroup({
...props
}: React.ComponentProps<typeof DropdownMenuPrimitive.RadioGroup>) {
return (
<DropdownMenuPrimitive.RadioGroup
data-slot="dropdown-menu-radio-group"
{...props}
/>
);
}
function DropdownMenuRadioItem({
className,
children,
...props
}: React.ComponentProps<typeof DropdownMenuPrimitive.RadioItem>) {
return (
<DropdownMenuPrimitive.RadioItem
data-slot="dropdown-menu-radio-item"
className={cn(
"focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-sm py-1.5 pr-2 pl-8 text-sm outline-hidden select-none data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
className,
)}
{...props}
>
<span className="pointer-events-none absolute left-2 flex size-3.5 items-center justify-center">
<DropdownMenuPrimitive.ItemIndicator>
<CircleIcon className="size-2 fill-current" />
</DropdownMenuPrimitive.ItemIndicator>
</span>
{children}
</DropdownMenuPrimitive.RadioItem>
);
}
function DropdownMenuLabel({
className,
inset,
...props
}: React.ComponentProps<typeof DropdownMenuPrimitive.Label> & {
inset?: boolean;
}) {
return (
<DropdownMenuPrimitive.Label
data-slot="dropdown-menu-label"
data-inset={inset}
className={cn(
"px-2 py-1.5 text-sm font-medium data-inset:pl-8",
className,
)}
{...props}
/>
);
}
function DropdownMenuSeparator({
className,
...props
}: React.ComponentProps<typeof DropdownMenuPrimitive.Separator>) {
return (
<DropdownMenuPrimitive.Separator
data-slot="dropdown-menu-separator"
className={cn("bg-border -mx-1 my-1 h-px", className)}
{...props}
/>
);
}
function DropdownMenuShortcut({
className,
...props
}: React.ComponentProps<"span">) {
return (
<span
data-slot="dropdown-menu-shortcut"
className={cn(
"text-muted-foreground ml-auto text-xs tracking-widest",
className,
)}
{...props}
/>
);
}
function DropdownMenuSub({
...props
}: React.ComponentProps<typeof DropdownMenuPrimitive.Sub>) {
return <DropdownMenuPrimitive.Sub data-slot="dropdown-menu-sub" {...props} />;
}
function DropdownMenuSubTrigger({
className,
inset,
children,
...props
}: React.ComponentProps<typeof DropdownMenuPrimitive.SubTrigger> & {
inset?: boolean;
}) {
return (
<DropdownMenuPrimitive.SubTrigger
data-slot="dropdown-menu-sub-trigger"
data-inset={inset}
className={cn(
"focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-inset:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
className,
)}
{...props}
>
{children}
<ChevronRightIcon className="ml-auto size-4" />
</DropdownMenuPrimitive.SubTrigger>
);
}
function DropdownMenuSubContent({
className,
...props
}: React.ComponentProps<typeof DropdownMenuPrimitive.SubContent>) {
return (
<DropdownMenuPrimitive.SubContent
data-slot="dropdown-menu-sub-content"
className={cn(
"bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 min-w-32 origin-(--radix-dropdown-menu-content-transform-origin) overflow-hidden rounded-md border p-1 shadow-lg",
className,
)}
{...props}
/>
);
}
export {
DropdownMenu,
DropdownMenuPortal,
DropdownMenuTrigger,
DropdownMenuContent,
DropdownMenuGroup,
DropdownMenuLabel,
DropdownMenuItem,
DropdownMenuCheckboxItem,
DropdownMenuRadioGroup,
DropdownMenuRadioItem,
DropdownMenuSeparator,
DropdownMenuShortcut,
DropdownMenuSub,
DropdownMenuSubTrigger,
DropdownMenuSubContent,
};