@@ -43,16 +45,27 @@ export default async function ReputationPage({
+
-
diff --git a/src/components/layout/Navbar.tsx b/src/components/layout/Navbar.tsx
index b7684677..6e7f3a61 100644
--- a/src/components/layout/Navbar.tsx
+++ b/src/components/layout/Navbar.tsx
@@ -7,21 +7,29 @@ import { Avatar } from "@/components/ui/Avatar";
import { ThemeToggle } from "@/components/ui/ThemeToggle";
import { NetworkBadge } from "@/components/ui/NetworkBadge";
import { useAuth } from "@/context/AuthContext";
+import type { UserRole } from "@/types";
const links = [
{ href: "/issues", label: "Bounties" },
{ href: "/milestones", label: "Milestones" },
];
-const dashboardLinks = [
- { href: "/dashboard/contributor", label: "Contributor" },
- { href: "/dashboard/maintainer", label: "Maintainer" },
- { href: "/dashboard/sponsor", label: "Sponsor" },
+const dashboardLinks: { href: string; label: string; role: UserRole }[] = [
+ { href: "/dashboard/contributor", label: "Contributor", role: "contributor" },
+ { href: "/dashboard/maintainer", label: "Maintainer", role: "maintainer" },
+ { href: "/dashboard/sponsor", label: "Sponsor", role: "sponsor" },
];
export function Navbar() {
const { user, loading, logout } = useAuth();
+ // Filter dashboard links to only those matching the user's assigned roles.
+ // Supports multi-role users: if roles contains both "maintainer" and "sponsor",
+ // both dashboard links are shown. If no roles yet (e.g. new user), show none.
+ const visibleDashboardLinks = user
+ ? dashboardLinks.filter((link) => user.roles.includes(link.role))
+ : [];
+
return (