Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,6 @@ export function PipelineRunFiltersBar({
/>
</div>

{/* Annotation Filter button */}
{!isAnnotationExpanded && (
<Button
variant="outline"
Expand Down
80 changes: 63 additions & 17 deletions src/routes/Dashboard/DashboardLayout.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
import { Link, Outlet } from "@tanstack/react-router";

import { isAuthorizationRequired } from "@/components/shared/Authentication/helpers";
import { TopBarAuthentication } from "@/components/shared/Authentication/TopBarAuthentication";
import { Badge } from "@/components/ui/badge";
import { Icon, type IconName } from "@/components/ui/icon";
import { BlockStack, InlineStack } from "@/components/ui/layout";
import { Link as UILink } from "@/components/ui/link";
import { Heading, Text } from "@/components/ui/typography";
import { cn } from "@/lib/utils";
import { DOCUMENTATION_URL } from "@/utils/constants";

interface SidebarItem {
to: string;
Expand All @@ -20,7 +24,15 @@ const SIDEBAR_ITEMS: SidebarItem[] = [
{ to: "/dashboard/recently-viewed", label: "Recently Viewed", icon: "Clock" },
];

const navItemClass = (isActive: boolean) =>
cn(
"w-full px-3 py-2 rounded-md text-sm cursor-pointer hover:bg-accent",
isActive && "bg-accent font-medium",
);

export function DashboardLayout() {
const requiresAuthorization = isAuthorizationRequired();

return (
<div className="w-full px-8 py-6">
<BlockStack gap="6">
Expand All @@ -33,29 +45,63 @@ export function DashboardLayout() {

<InlineStack gap="8" blockAlign="start" className="w-full min-h-100">
<BlockStack
gap="1"
className="w-48 shrink-0 border-r border-border pr-4"
inlineAlign="space-between"
className="w-48 shrink-0 border-r border-border pr-4 self-stretch"
>
{SIDEBAR_ITEMS.map((item) => (
<Link
key={item.to}
to={item.to}
className="w-full"
activeProps={{ className: "is-active" }}
{/* Top nav */}
<BlockStack gap="1">
{SIDEBAR_ITEMS.map((item) => (
<Link
key={item.to}
to={item.to}
className="w-full"
activeProps={{ className: "is-active" }}
>
{({ isActive }) => (
<InlineStack
gap="2"
blockAlign="center"
className={navItemClass(isActive)}
>
<Icon name={item.icon} size="sm" />
<Text size="sm">{item.label}</Text>
</InlineStack>
)}
</Link>
))}
</BlockStack>

{/* Bottom utilities */}
<BlockStack gap="1" className="border-t border-border pt-3">
<UILink
href={DOCUMENTATION_URL}
external
variant="block"
className={navItemClass(false)}
>
<InlineStack gap="2" blockAlign="center">
<Icon name="CircleQuestionMark" size="sm" />
<Text size="sm">Docs</Text>
</InlineStack>
</UILink>
<Link to="/settings/backend" className="w-full">
{({ isActive }) => (
<div
className={cn(
"flex items-center gap-2 w-full px-3 py-2 rounded-md text-sm cursor-pointer hover:bg-accent",
isActive && "bg-accent font-medium",
)}
<InlineStack
gap="2"
blockAlign="center"
className={navItemClass(isActive)}
>
<Icon name={item.icon} size="sm" />
<Text size="sm">{item.label}</Text>
</div>
<Icon name="Settings" size="sm" />
<Text size="sm">Settings</Text>
</InlineStack>
)}
</Link>
))}
{requiresAuthorization && (
<div className="px-3 py-2">
<TopBarAuthentication />
</div>
)}
</BlockStack>
</BlockStack>

<BlockStack className="flex-1 min-w-0">
Expand Down
Loading