Skip to content

Commit 69ab0c9

Browse files
committed
feat dashboard latout
1 parent 7551c2c commit 69ab0c9

7 files changed

Lines changed: 132 additions & 282 deletions

File tree

knip.json

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
11
{
22
"$schema": "https://unpkg.com/knip@5/schema.json",
33
"ignore": [
4-
".git/**",
54
"src/api/**",
65
"src/components/ui/**",
7-
"openapi-ts.config.ts",
86
"src/config/announcements.ts",
97
"src/components/shared/BetaFeatureWrapper/BetaFeatureWrapper.tsx"
108
],

src/components/Home/FavoritesSection/FavoritesSection.tsx

Lines changed: 0 additions & 170 deletions
This file was deleted.

src/components/Home/RecentlyViewedSection/RecentlyViewedSection.tsx

Lines changed: 0 additions & 79 deletions
This file was deleted.

src/hooks/useRecentlyViewed.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@ import { getStorage } from "@/utils/typedStorage";
55
const RECENTLY_VIEWED_KEY = "Home/recently_viewed";
66
const MAX_ITEMS = 5;
77

8-
export type RecentlyViewedType = "pipeline" | "run" | "component";
8+
type RecentlyViewedType = "pipeline" | "run" | "component";
99

10-
export interface RecentlyViewedItem {
10+
interface RecentlyViewedItem {
1111
type: RecentlyViewedType;
1212
id: string;
1313
name: string;

src/routes/Dashboard/Dashboard.tsx

Lines changed: 0 additions & 26 deletions
This file was deleted.
Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
import { Link, Outlet } from "@tanstack/react-router";
2+
3+
import { Icon, type IconName } from "@/components/ui/icon";
4+
import { BlockStack, InlineStack } from "@/components/ui/layout";
5+
import { Heading, Text } from "@/components/ui/typography";
6+
import { cn } from "@/lib/utils";
7+
8+
interface SidebarItem {
9+
to: string;
10+
label: string;
11+
icon: IconName;
12+
}
13+
14+
const SIDEBAR_ITEMS: SidebarItem[] = [
15+
{ to: "/dashboard/runs", label: "Runs", icon: "Play" },
16+
{ to: "/dashboard/pipelines", label: "Pipelines", icon: "GitBranch" },
17+
{ to: "/dashboard/components", label: "Components", icon: "Package" },
18+
{ to: "/dashboard/favorites", label: "Favorites", icon: "Star" },
19+
{ to: "/dashboard/recently-viewed", label: "Recently Viewed", icon: "Clock" },
20+
];
21+
22+
export function DashboardLayout() {
23+
return (
24+
<div className="container mx-auto p-6 max-w-6xl">
25+
<BlockStack gap="6">
26+
<InlineStack gap="2" blockAlign="center">
27+
<Heading level={1}>Dashboard</Heading>
28+
<Text
29+
as="span"
30+
size="xs"
31+
weight="semibold"
32+
className="px-2 py-1 rounded-full bg-amber-100 text-amber-800"
33+
>
34+
Beta
35+
</Text>
36+
</InlineStack>
37+
38+
<InlineStack gap="8" blockAlign="start" className="w-full min-h-100">
39+
<BlockStack
40+
gap="1"
41+
className="w-48 shrink-0 border-r border-border pr-4"
42+
>
43+
{SIDEBAR_ITEMS.map((item) => (
44+
<Link
45+
key={item.to}
46+
to={item.to}
47+
className="w-full"
48+
activeProps={{ className: "is-active" }}
49+
>
50+
{({ isActive }) => (
51+
<div
52+
className={cn(
53+
"flex items-center gap-2 w-full px-3 py-2 rounded-md text-sm cursor-pointer hover:bg-accent",
54+
isActive && "bg-accent font-medium",
55+
)}
56+
>
57+
<Icon name={item.icon} size="sm" />
58+
<Text size="sm">{item.label}</Text>
59+
</div>
60+
)}
61+
</Link>
62+
))}
63+
</BlockStack>
64+
65+
<BlockStack className="flex-1 min-w-0">
66+
<Outlet />
67+
</BlockStack>
68+
</InlineStack>
69+
</BlockStack>
70+
</div>
71+
);
72+
}

0 commit comments

Comments
 (0)