Hide main navbar on space pages, clean up nav links
Space pages use SpaceNav for navigation — the root Navbar with Sign In/Sign Up buttons was redundant and confusing there. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
e22063c092
commit
9456c6f73f
|
|
@ -2,6 +2,7 @@
|
||||||
|
|
||||||
import Link from "next/link";
|
import Link from "next/link";
|
||||||
import { useSession, signOut } from "next-auth/react";
|
import { useSession, signOut } from "next-auth/react";
|
||||||
|
import { usePathname } from "next/navigation";
|
||||||
import { Button } from "@/components/ui/button";
|
import { Button } from "@/components/ui/button";
|
||||||
import { CreditDisplay } from "./CreditDisplay";
|
import { CreditDisplay } from "./CreditDisplay";
|
||||||
import {
|
import {
|
||||||
|
|
@ -15,6 +16,12 @@ import { Avatar, AvatarFallback } from "@/components/ui/avatar";
|
||||||
|
|
||||||
export function Navbar() {
|
export function Navbar() {
|
||||||
const { data: session, status } = useSession();
|
const { data: session, status } = useSession();
|
||||||
|
const pathname = usePathname();
|
||||||
|
|
||||||
|
// Hide the main navbar on space pages — SpaceNav handles navigation there
|
||||||
|
if (pathname.startsWith("/s/")) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<nav className="border-b bg-background/95 backdrop-blur supports-[backdrop-filter]:bg-background/60">
|
<nav className="border-b bg-background/95 backdrop-blur supports-[backdrop-filter]:bg-background/60">
|
||||||
|
|
@ -26,10 +33,10 @@ export function Navbar() {
|
||||||
</Link>
|
</Link>
|
||||||
<div className="hidden md:flex items-center gap-4">
|
<div className="hidden md:flex items-center gap-4">
|
||||||
<Link
|
<Link
|
||||||
href="/proposals"
|
href="/demo"
|
||||||
className="text-sm font-medium text-muted-foreground hover:text-foreground transition-colors"
|
className="text-sm font-medium text-muted-foreground hover:text-foreground transition-colors"
|
||||||
>
|
>
|
||||||
Proposals
|
Demo
|
||||||
</Link>
|
</Link>
|
||||||
<Link
|
<Link
|
||||||
href="/spaces"
|
href="/spaces"
|
||||||
|
|
@ -79,7 +86,7 @@ export function Navbar() {
|
||||||
<Link href="/profile">Profile</Link>
|
<Link href="/profile">Profile</Link>
|
||||||
</DropdownMenuItem>
|
</DropdownMenuItem>
|
||||||
<DropdownMenuItem asChild>
|
<DropdownMenuItem asChild>
|
||||||
<Link href="/proposals/new">New Proposal</Link>
|
<Link href="/spaces">My Spaces</Link>
|
||||||
</DropdownMenuItem>
|
</DropdownMenuItem>
|
||||||
<DropdownMenuSeparator />
|
<DropdownMenuSeparator />
|
||||||
<DropdownMenuItem
|
<DropdownMenuItem
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue