File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -12,6 +12,7 @@ import { GiSelfLove } from "react-icons/gi";
1212import NavLink from "./NavLink" ;
1313import UserMenu from "./UserMenu" ;
1414import FiltersWrapper from "./FiltersWrapper" ;
15+ import { usePathname } from "next/navigation" ;
1516
1617type Props = {
1718 userInfo : {
@@ -27,6 +28,8 @@ export default function TopNav({
2728 isLoggedIn,
2829 isAdmin,
2930} : Props ) {
31+ const pathname = usePathname ( ) ;
32+ const isHomePage = pathname === "/" ;
3033
3134 const memberLinks = [
3235 { href : "/members" , label : "Matches" } ,
@@ -90,7 +93,7 @@ export default function TopNav({
9093 < div className = "ml-auto" >
9194 < UserMenu userInfo = { userInfo } />
9295 </ div >
93- ) : (
96+ ) : ! isHomePage ? (
9497 < div className = "ml-auto flex items-center gap-3" >
9598 < Button
9699 as = { Link }
@@ -109,7 +112,8 @@ export default function TopNav({
109112 Register
110113 </ Button >
111114 </ div >
112- ) }
115+ ) : null
116+ }
113117 </ NavbarContent >
114118 </ Navbar >
115119 < FiltersWrapper />
You can’t perform that action at this time.
0 commit comments