@@ -6,20 +6,12 @@ import { cn } from "@/lib/utils";
66import { Menu , X } from "lucide-react" ;
77import Image from "next/image" ;
88import { ConnectButton } from "@rainbow-me/rainbowkit" ;
9- import { usePathname } from "next/navigation" ;
109import Link from "next/link" ;
1110interface NavLink {
1211 name : string ;
1312 href : string ;
1413}
1514
16- const landingPageLinks : NavLink [ ] = [
17- { name : "Home" , href : "#hero" } ,
18- { name : "How It Works" , href : "#how-it-works" } ,
19- { name : "Features" , href : "#features" } ,
20- { name : "Get Started" , href : "#cta" } ,
21- ] ;
22-
2315const appLinks = [
2416 { name : "Create" , href : "/create" } ,
2517 { name : "My TNTs" , href : "/my-tnts" } ,
@@ -29,8 +21,6 @@ const appLinks = [
2921export function Navbar ( ) {
3022 const [ isScrolled , setIsScrolled ] = useState ( false ) ;
3123 const [ isMobileMenuOpen , setIsMobileMenuOpen ] = useState ( false ) ;
32- const pathname = usePathname ( ) ;
33- const isLandingPage = pathname === "/" ;
3424
3525 useEffect ( ( ) => {
3626 const handleScroll = ( ) => {
@@ -41,14 +31,6 @@ export function Navbar() {
4131 return ( ) => window . removeEventListener ( "scroll" , handleScroll ) ;
4232 } , [ ] ) ;
4333
44- const scrollToSection = ( href : string ) => {
45- setIsMobileMenuOpen ( false ) ;
46- const element = document . querySelector ( href ) ;
47- if ( element ) {
48- element . scrollIntoView ( { behavior : "smooth" } ) ;
49- }
50- } ;
51-
5234 return (
5335 < header
5436 className = { cn (
@@ -70,25 +52,15 @@ export function Navbar() {
7052
7153 { /* Desktop Navigation */ }
7254 < nav className = "hidden md:flex items-center space-x-8" >
73- { isLandingPage
74- ? landingPageLinks . map ( ( link ) => (
75- < button
76- key = { link . name }
77- onClick = { ( ) => scrollToSection ( link . href ) }
78- className = "text-slate-300 hover:text-white transition-colors duration-200"
79- >
80- { link . name }
81- </ button >
82- ) )
83- : appLinks . map ( ( link ) => (
84- < Link
85- key = { link . name }
86- href = { link . href }
87- className = "text-slate-300 hover:text-white transition-colors duration-200"
88- >
89- { link . name }
90- </ Link >
91- ) ) }
55+ { appLinks . map ( ( link ) => (
56+ < Link
57+ key = { link . name }
58+ href = { link . href }
59+ className = "text-slate-300 hover:text-white transition-colors duration-200"
60+ >
61+ { link . name }
62+ </ Link >
63+ ) ) }
9264 < ConnectButton />
9365 </ nav >
9466
@@ -105,25 +77,15 @@ export function Navbar() {
10577 { isMobileMenuOpen && (
10678 < div className = "md:hidden absolute top-full left-0 right-0 bg-black/95 backdrop-blur-md border-b border-slate-800/50 shadow-lg py-4" >
10779 < nav className = "flex flex-col items-center space-y-4 px-4" >
108- { isLandingPage
109- ? landingPageLinks . map ( ( link ) => (
110- < button
111- key = { link . name }
112- onClick = { ( ) => scrollToSection ( link . href ) }
113- className = "text-slate-300 hover:text-white transition-colors duration-200 py-2"
114- >
115- { link . name }
116- </ button >
117- ) )
118- : appLinks . map ( ( link ) => (
119- < Link
120- key = { link . name }
121- href = { link . href }
122- className = "text-slate-300 hover:text-white transition-colors duration-200 py-2"
123- >
124- { link . name }
125- </ Link >
126- ) ) }
80+ { appLinks . map ( ( link ) => (
81+ < Link
82+ key = { link . name }
83+ href = { link . href }
84+ className = "text-slate-300 hover:text-white transition-colors duration-200 py-2"
85+ >
86+ { link . name }
87+ </ Link >
88+ ) ) }
12789 < div className = "w-full flex justify-center" >
12890 < ConnectButton />
12991 </ div >
0 commit comments