11import { cn } from "@/lib/utils" ;
22import { ArrowRight , BlocksIcon , ExternalLink , Menu } from "lucide-react" ;
3- import { Button , buttonVariants } from "../ui/button" ;
4- import { Sheet , SheetContent , SheetDescription , SheetHeader , SheetTitle , SheetTrigger } from "../ui/sheet" ;
3+ import { Button , buttonVariants } from "../ui/button" ;
4+ import {
5+ Sheet ,
6+ SheetContent ,
7+ SheetDescription ,
8+ SheetHeader ,
9+ SheetTitle ,
10+ SheetTrigger ,
11+ } from "../ui/sheet" ;
512import { useIsMobile } from "@/hooks/use-mobile" ;
613import Link from "next/link" ;
714import { useState } from "react" ;
815import Logo from "./logo" ;
916
1017export default function Header ( ) {
1118 const [ isOpen , setIsOpen ] = useState ( false ) ;
12- const isMobile = useIsMobile ( ) ;
1319
1420 const navigationLinks = [
1521 { href : "/" , label : "Home" } ,
@@ -25,67 +31,72 @@ export default function Header() {
2531 "fixed top-0 w-full flex flex-row gap-2 justify-between bg-white border-b z-30"
2632 ) }
2733 >
28- { /* Logo */ }
29- < Link href = "/" className = "flex flex-row gap-2 items-center justify-start md:justify-start p-2 px-4 border-r w-full md:w-[300px]" >
30- < Logo />
31- </ Link >
34+ < div className = "flex flex-row gap-2 justify-between w-full max-w-screen-xl mx-auto" >
35+ { /* Logo */ }
36+ < Link
37+ href = "/"
38+ className = "flex flex-row gap-2 items-center justify-start md:justify-start p-2 px-4 w-full md:w-[300px]"
39+ >
40+ < Logo />
41+ </ Link >
3242
33- { /* Desktop Navigation */ }
34- < div className = "hidden md:flex flex-1 items-center justify-center lg:justify-end pr-4 " >
35- { navigationLinks . map ( ( link ) => (
36- < Button asChild key = { link . href } variant = "ghost" >
37- < Link key = { link . href } href = { link . href } >
38- { link . label }
39- </ Link >
40- </ Button >
41- ) ) }
42- </ div >
43+ { /* Desktop Navigation */ }
44+ < div className = "hidden md:flex flex-1 items-center justify-center lg:justify-end" >
45+ { navigationLinks . map ( ( link ) => (
46+ < Button asChild key = { link . href } variant = "ghost" >
47+ < Link key = { link . href } href = { link . href } >
48+ { link . label }
49+ </ Link >
50+ </ Button >
51+ ) ) }
52+ </ div >
4353
44- { /* Mobile Navigation */ }
45- < div className = "flex md:hidden items-center" >
46- < Sheet open = { isOpen } onOpenChange = { setIsOpen } >
47- < SheetTrigger asChild >
48- < button className = "p-2 hover:bg-gray-100 rounded-md transition-colors mr-2" >
49- < Menu className = "h-6 w-6" />
50- < span className = "sr-only" > Open menu</ span >
51- </ button >
52- </ SheetTrigger >
53- < SheetContent side = "right" className = "w-[280px] sm:w-[350px]" >
54- < SheetHeader >
55- < SheetTitle > Menu</ SheetTitle >
56- </ SheetHeader >
57- < div className = "flex flex-col gap-6 px-4" >
58- < div className = "flex flex-col gap-4" >
59- { navigationLinks . map ( ( link ) => (
60- < Link
61- key = { link . href }
62- href = { link . href }
63- className = "text-lg font-medium hover:underline"
64- onClick = { ( ) => setIsOpen ( false ) }
65- >
66- { link . label }
67- </ Link >
68- ) ) }
54+ { /* Mobile Navigation */ }
55+ < div className = "flex md:hidden items-center" >
56+ < Sheet open = { isOpen } onOpenChange = { setIsOpen } >
57+ < SheetTrigger asChild >
58+ < button className = "p-2 hover:bg-gray-100 rounded-md transition-colors mr-2" >
59+ < Menu className = "h-6 w-6" />
60+ < span className = "sr-only" > Open menu</ span >
61+ </ button >
62+ </ SheetTrigger >
63+ < SheetContent side = "right" className = "w-[280px] sm:w-[350px]" >
64+ < SheetHeader >
65+ < SheetTitle > Menu</ SheetTitle >
66+ </ SheetHeader >
67+ < div className = "flex flex-col gap-6 px-4" >
68+ < div className = "flex flex-col gap-4" >
69+ { navigationLinks . map ( ( link ) => (
70+ < Link
71+ key = { link . href }
72+ href = { link . href }
73+ className = "text-lg font-medium hover:underline"
74+ onClick = { ( ) => setIsOpen ( false ) }
75+ >
76+ { link . label }
77+ </ Link >
78+ ) ) }
79+ </ div >
6980 </ div >
70- </ div >
71- </ SheetContent >
72- </ Sheet >
73- </ div >
81+ </ SheetContent >
82+ </ Sheet >
83+ </ div >
7484
75- { /* Desktop CTA Button */ }
76- < div className = "hidden md:flex flex-row gap-2 border-l py-2 px-4 w-[300px]" >
77- < a
78- href = "/builder"
79- className = { cn (
80- buttonVariants ( {
81- variant : "default" ,
82- size : "lg" ,
83- className : "rounded-full w-full" ,
84- } )
85- ) }
86- >
87- Open Builder < ArrowRight className = "size-4" />
88- </ a >
85+ { /* Desktop CTA Button */ }
86+ < div className = "hidden md:flex flex-row gap-2 py-2 px-4 w-[300px]" >
87+ < a
88+ href = "/builder"
89+ className = { cn (
90+ buttonVariants ( {
91+ variant : "default" ,
92+ size : "lg" ,
93+ className : "rounded-full w-full" ,
94+ } )
95+ ) }
96+ >
97+ Open Builder < ArrowRight className = "size-4" />
98+ </ a >
99+ </ div >
89100 </ div >
90101 </ div >
91102 ) ;
0 commit comments