1- ' use client'
1+ " use client" ;
22
3- import { useState } from "react"
4- import Link from "next/link"
5- import { usePathname } from "next/navigation"
6- import { Button } from "@/components/ui/button"
7- import { ThemeToggle } from "@/components/theme-toggle"
8- import { Menu , X } from ' lucide-react'
3+ import { useState } from "react" ;
4+ import Link from "next/link" ;
5+ import { usePathname } from "next/navigation" ;
6+ import { Button } from "@/components/ui/button" ;
7+ import { ThemeToggle } from "@/components/theme-toggle" ;
8+ import { Menu , X } from " lucide-react" ;
99
1010const navItems = [
1111 { href : "/" , label : "Home" } ,
1212 // { href: "features", label: "Features" },
1313 { href : "/learn-more" , label : "How it Works" } ,
1414 { href : "/FAQ" , label : "FAQs" } ,
1515 // { href: "/blog", label: "Blog" },
16- ]
16+ ] ;
1717
1818const Navbar1 = ( ) => {
19- const [ isMenuOpen , setIsMenuOpen ] = useState ( false )
20- const pathname = usePathname ( )
19+ const [ isMenuOpen , setIsMenuOpen ] = useState ( false ) ;
20+ const pathname = usePathname ( ) ;
2121
22- const toggleMenu = ( ) => setIsMenuOpen ( ! isMenuOpen )
22+ const toggleMenu = ( ) => setIsMenuOpen ( ! isMenuOpen ) ;
2323
2424 return (
2525 < header className = "sticky top-0 z-50 w-full border-b bg-background/95 backdrop-blur supports-[backdrop-filter]:bg-background/60" >
@@ -34,15 +34,20 @@ const Navbar1 = () => {
3434 key = { item . href }
3535 href = { item . href }
3636 className = { `text-sm font-medium transition-colors hover:text-primary ${
37- pathname === item . href ? "text-primary" : "text-muted-foreground"
37+ pathname === item . href
38+ ? "text-primary"
39+ : "text-muted-foreground"
3840 } `}
3941 >
4042 { item . label }
4143 </ Link >
4244 ) ) }
4345 </ div >
4446 < div className = "hidden lg:flex items-center space-x-4" >
45- < Link href = "/auth/signin" className = "text-sm font-medium text-muted-foreground hover:text-primary" >
47+ < Link
48+ href = "/auth/signin"
49+ className = "text-sm font-medium text-muted-foreground hover:text-primary"
50+ >
4651 Log in
4752 </ Link >
4853 < Button asChild >
@@ -55,45 +60,47 @@ const Navbar1 = () => {
5560 className = "lg:hidden focus:outline-none"
5661 aria-label = { isMenuOpen ? "Close menu" : "Open menu" }
5762 >
58- { isMenuOpen ? < X size = { 24 } /> : < Menu size = { 24 } /> }
63+ { /* ADDED THEME TOGGLE ALONG WITH MENU */ }
64+ < div className = "flex flex-row justify-center items-center gap-2" >
65+ < ThemeToggle />
66+ { isMenuOpen ? < X size = { 24 } /> : < Menu size = { 24 } /> }
67+ </ div >
5968 </ button >
6069 </ nav >
6170
6271 { isMenuOpen && (
6372 < div className = "lg:hidden" >
64- < nav className = "container flex flex-col space-y-4 py-4" >
73+ { /* ADDED X-PADDING TO MAKE IT FIT PROPERLY ON MOBILE SCREENS */ }
74+ < nav className = "container flex flex-col space-y-4 py-4 px-4" >
6575 { navItems . map ( ( item ) => (
6676 < Link
6777 key = { item . href }
6878 href = { item . href }
6979 className = { `text-sm font-medium transition-colors hover:text-primary ${
70- pathname === item . href ? "text-primary" : "text-muted-foreground"
80+ pathname === item . href
81+ ? "text-primary"
82+ : "text-muted-foreground"
7183 } `}
7284 onClick = { toggleMenu }
7385 >
7486 { item . label }
7587 </ Link >
7688 ) ) }
7789 < div className = "flex flex-col space-y-4 pt-4 border-t" >
78- < Link
79- href = "/auth/signin"
80- className = "text-sm font-medium text-muted-foreground hover:text-primary"
81- onClick = { toggleMenu }
82- >
83- Log in
84- </ Link >
90+ { /* FORMATTED THE LOGIN BUTTON -> LOGIN TEXT IN CENTER AND BACKGROUND ADDED */ }
91+ < Button asChild className = "bg-primary-foreground text-white" >
92+ < Link href = "/auth/signin" > Login</ Link >
93+ </ Button >
8594 < Button asChild onClick = { toggleMenu } >
8695 < Link href = "/auth/register" > Sign up</ Link >
8796 </ Button >
88- < div className = "flex justify-start" >
89- < ThemeToggle />
90- </ div >
97+ < div className = "flex justify-start" > </ div >
9198 </ div >
9299 </ nav >
93100 </ div >
94101 ) }
95102 </ header >
96- )
97- }
98- export default Navbar1
103+ ) ;
104+ } ;
99105
106+ export default Navbar1 ;
0 commit comments