2025-10-10 23:30:26 -07:00
|
|
|
import { useState } from "react";
|
|
|
|
|
import { Link } from "react-router";
|
|
|
|
|
import {
|
|
|
|
|
NavigationMenu,
|
|
|
|
|
NavigationMenuItem,
|
|
|
|
|
NavigationMenuLink,
|
|
|
|
|
NavigationMenuList,
|
|
|
|
|
navigationMenuTriggerStyle,
|
|
|
|
|
} from "~/components/ui/navigation-menu";
|
|
|
|
|
import {
|
|
|
|
|
Sheet,
|
|
|
|
|
SheetContent,
|
|
|
|
|
SheetHeader,
|
|
|
|
|
SheetTitle,
|
|
|
|
|
SheetTrigger,
|
|
|
|
|
} from "~/components/ui/sheet";
|
|
|
|
|
import { SignedIn, SignedOut, SignInButton, UserButton } from "@clerk/react-router";
|
|
|
|
|
import { MenuIcon } from "lucide-react";
|
|
|
|
|
|
2025-10-13 09:44:59 -07:00
|
|
|
interface NavbarProps {
|
|
|
|
|
isAdmin: boolean;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export function Navbar({ isAdmin }: NavbarProps) {
|
2025-10-10 23:30:26 -07:00
|
|
|
const [open, setOpen] = useState(false);
|
|
|
|
|
|
|
|
|
|
return (
|
|
|
|
|
<header className="sticky top-0 z-50 w-full border-b border-border/40 bg-background/95 backdrop-blur supports-[backdrop-filter]:bg-background/60">
|
|
|
|
|
<div className="flex h-16 items-center justify-between px-4 md:px-6 lg:px-8">
|
|
|
|
|
{/* Logo */}
|
2026-03-04 00:23:45 -08:00
|
|
|
<Link to="/" className="flex items-center">
|
|
|
|
|
<img src="/logo.svg" alt="Brackt" className="h-6" />
|
2025-10-10 23:30:26 -07:00
|
|
|
</Link>
|
|
|
|
|
|
|
|
|
|
{/* Desktop Navigation */}
|
|
|
|
|
<NavigationMenu className="hidden md:flex">
|
|
|
|
|
<NavigationMenuList>
|
|
|
|
|
<NavigationMenuItem>
|
|
|
|
|
<NavigationMenuLink asChild className={navigationMenuTriggerStyle()}>
|
|
|
|
|
<Link to="/">Home</Link>
|
|
|
|
|
</NavigationMenuLink>
|
|
|
|
|
</NavigationMenuItem>
|
|
|
|
|
<NavigationMenuItem>
|
|
|
|
|
<NavigationMenuLink asChild className={navigationMenuTriggerStyle()}>
|
2025-10-12 16:42:15 -07:00
|
|
|
<Link to="/how-to-play">How To Play</Link>
|
2025-10-10 23:30:26 -07:00
|
|
|
</NavigationMenuLink>
|
|
|
|
|
</NavigationMenuItem>
|
Add rules page, rewrite how-to-play, and fix scoring display (#20)
- Add new /rules route with official league rules covering rosters,
scoring, major-based QP scoring, tiebreakers, draft, and season rules
- Rewrite how-to-play page with a tutorial/marketing tone, highlighting
the Fischer increment draft clock as a novel feature
- Add Rules link to navbar (desktop and mobile)
- Align QP values in both pages with DEFAULT_QP_VALUES in code
- Fix tiebreaker description to match placement-count logic in code
- Update all fantasy point displays from toFixed(1) to toFixed(2) across
StandingsTable, TeamScoreBreakdown, and PointProgressionChart
- Update tests to match new two-decimal-place point display format
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-02-21 21:58:51 -08:00
|
|
|
<NavigationMenuItem>
|
|
|
|
|
<NavigationMenuLink asChild className={navigationMenuTriggerStyle()}>
|
|
|
|
|
<Link to="/rules">Rules</Link>
|
|
|
|
|
</NavigationMenuLink>
|
|
|
|
|
</NavigationMenuItem>
|
2025-10-13 09:44:59 -07:00
|
|
|
{isAdmin && (
|
|
|
|
|
<NavigationMenuItem>
|
|
|
|
|
<NavigationMenuLink asChild className={navigationMenuTriggerStyle()}>
|
|
|
|
|
<Link to="/admin">Admin</Link>
|
|
|
|
|
</NavigationMenuLink>
|
|
|
|
|
</NavigationMenuItem>
|
|
|
|
|
)}
|
2025-10-10 23:30:26 -07:00
|
|
|
</NavigationMenuList>
|
|
|
|
|
</NavigationMenu>
|
|
|
|
|
|
|
|
|
|
{/* Desktop Auth */}
|
|
|
|
|
<div className="hidden md:flex items-center gap-4">
|
|
|
|
|
<SignedOut>
|
|
|
|
|
<SignInButton mode="modal">
|
|
|
|
|
<button className="inline-flex items-center justify-center rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 bg-primary text-primary-foreground shadow hover:bg-primary/90 h-9 px-4 py-2">
|
|
|
|
|
Sign In
|
|
|
|
|
</button>
|
|
|
|
|
</SignInButton>
|
|
|
|
|
</SignedOut>
|
|
|
|
|
<SignedIn>
|
|
|
|
|
<UserButton />
|
|
|
|
|
</SignedIn>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
{/* Mobile Menu */}
|
|
|
|
|
<div className="flex md:hidden items-center gap-4">
|
|
|
|
|
<SignedOut>
|
|
|
|
|
<SignInButton mode="modal">
|
|
|
|
|
<button className="inline-flex items-center justify-center rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 bg-primary text-primary-foreground shadow hover:bg-primary/90 h-9 px-4 py-2">
|
|
|
|
|
Sign In
|
|
|
|
|
</button>
|
|
|
|
|
</SignInButton>
|
|
|
|
|
</SignedOut>
|
|
|
|
|
<SignedIn>
|
|
|
|
|
<UserButton />
|
|
|
|
|
</SignedIn>
|
|
|
|
|
|
|
|
|
|
<Sheet open={open} onOpenChange={setOpen}>
|
|
|
|
|
<SheetTrigger asChild>
|
|
|
|
|
<button
|
|
|
|
|
className="inline-flex items-center justify-center rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 hover:bg-accent hover:text-accent-foreground h-10 w-10"
|
|
|
|
|
aria-label="Toggle menu"
|
|
|
|
|
>
|
|
|
|
|
<MenuIcon className="h-6 w-6" />
|
|
|
|
|
</button>
|
|
|
|
|
</SheetTrigger>
|
|
|
|
|
<SheetContent side="right" className="w-[300px] sm:w-[400px]">
|
|
|
|
|
<SheetHeader>
|
|
|
|
|
<SheetTitle>Menu</SheetTitle>
|
|
|
|
|
</SheetHeader>
|
|
|
|
|
<nav className="flex flex-col gap-4 mt-8">
|
|
|
|
|
<Link
|
|
|
|
|
to="/"
|
|
|
|
|
className="block px-4 py-2 text-lg font-medium hover:bg-accent rounded-md transition-colors"
|
|
|
|
|
onClick={() => setOpen(false)}
|
|
|
|
|
>
|
|
|
|
|
Home
|
|
|
|
|
</Link>
|
|
|
|
|
<Link
|
2025-10-12 16:42:15 -07:00
|
|
|
to="/how-to-play"
|
2025-10-10 23:30:26 -07:00
|
|
|
className="block px-4 py-2 text-lg font-medium hover:bg-accent rounded-md transition-colors"
|
|
|
|
|
onClick={() => setOpen(false)}
|
|
|
|
|
>
|
2025-10-12 16:42:15 -07:00
|
|
|
How To Play
|
2025-10-10 23:30:26 -07:00
|
|
|
</Link>
|
Add rules page, rewrite how-to-play, and fix scoring display (#20)
- Add new /rules route with official league rules covering rosters,
scoring, major-based QP scoring, tiebreakers, draft, and season rules
- Rewrite how-to-play page with a tutorial/marketing tone, highlighting
the Fischer increment draft clock as a novel feature
- Add Rules link to navbar (desktop and mobile)
- Align QP values in both pages with DEFAULT_QP_VALUES in code
- Fix tiebreaker description to match placement-count logic in code
- Update all fantasy point displays from toFixed(1) to toFixed(2) across
StandingsTable, TeamScoreBreakdown, and PointProgressionChart
- Update tests to match new two-decimal-place point display format
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-02-21 21:58:51 -08:00
|
|
|
<Link
|
|
|
|
|
to="/rules"
|
|
|
|
|
className="block px-4 py-2 text-lg font-medium hover:bg-accent rounded-md transition-colors"
|
|
|
|
|
onClick={() => setOpen(false)}
|
|
|
|
|
>
|
|
|
|
|
Rules
|
|
|
|
|
</Link>
|
2025-10-13 09:44:59 -07:00
|
|
|
{isAdmin && (
|
|
|
|
|
<Link
|
|
|
|
|
to="/admin"
|
|
|
|
|
className="block px-4 py-2 text-lg font-medium hover:bg-accent rounded-md transition-colors"
|
|
|
|
|
onClick={() => setOpen(false)}
|
|
|
|
|
>
|
|
|
|
|
Admin
|
|
|
|
|
</Link>
|
|
|
|
|
)}
|
2025-10-10 23:30:26 -07:00
|
|
|
</nav>
|
|
|
|
|
</SheetContent>
|
|
|
|
|
</Sheet>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</header>
|
|
|
|
|
);
|
|
|
|
|
}
|