1
0
Fork 0
polaris-task-force/src/components/frontend/blocks/NavContribute.tsx

66 lines
2 KiB
TypeScript

"use client";
import { ChevronRight, Mic, Trophy } from "lucide-react";
import Link from "next/link";
import {
DropdownMenu,
DropdownMenuContent,
DropdownMenuItem,
DropdownMenuSeparator,
DropdownMenuTrigger,
} from "@/components/ui/dropdown-menu";
import {
SidebarMenuButton,
SidebarMenuItem,
useSidebar,
} from "@/components/ui/sidebar";
/**
* Contribute sidebar dropdown. Previously a group inside the account popover
* (NavUser): a "Contribute" header with a single Voiceover entry. Kept as its
* own dropdown so it stays visually consistent with the adjacent Minigames
* entry and can grow to more contribution channels without a code change.
* Now holds both contribution channels: Voiceover (record takes) and
* Contributions (leaderboard + moderation).
*/
export function NavContribute() {
const { isMobile } = useSidebar();
return (
<SidebarMenuItem>
<DropdownMenu>
<DropdownMenuTrigger asChild>
<SidebarMenuButton size="sm">
<Mic />
<span>Contribute</span>
<ChevronRight className="ml-auto size-4 text-sidebar-foreground/50" />
</SidebarMenuButton>
</DropdownMenuTrigger>
<DropdownMenuContent
className="w-(--radix-dropdown-menu-trigger-width) min-w-56 rounded-lg"
side={isMobile ? "bottom" : "right"}
align="end"
sideOffset={4}
>
<div className="px-2 pb-3 pt-1.5 text-xs text-muted-foreground leading-snug">
Contribute to the web app to earn XP and contribution rewards!
</div>
<DropdownMenuItem asChild>
<Link href="/voiceover">
<Mic />
Voiceover
</Link>
</DropdownMenuItem>
<DropdownMenuSeparator />
<DropdownMenuItem asChild>
<Link href="/contributions">
<Trophy />
Contributions
</Link>
</DropdownMenuItem>
</DropdownMenuContent>
</DropdownMenu>
</SidebarMenuItem>
);
}