Skip to content

Commit b9c2f2e

Browse files
reneaaronim-adithyarolznz
authored
feat: new sidebar (#1201)
* feat: new sidebar * feat: new sidebar * fix: menuitems * fix: progress * fix: inset * feat: header * fix: icon * fix: active menu * fix: navlinks * fix: sidebar * fix: sidebar hint, collapse * fix: cleanup * fix: csp plugin warnings * fix: settings layout * fix: linting error * fix: use ComponentPropsWithoutRef * fix: run prettier * fix: typechecking * chore: replace radix sidebar icon with lucide * fix: remove todo * fix: improve collapsed sidebar transition * fix: use asChild * fix: upgrade dialog to latest version * fix: right align indicators * fix: upgrade radix libraries * fix: app sidebar dropdown items * fix: app header spacing * fix: close sidebar on mobile navigation * fix: more link handlers * fix: pro badges * fix: lockfile * fix: upgrade radix * fix: remove user data stub * fix: cursor pointer * fix: use classes to hide / show elements * fix: persist state in localstorage * fix: mark mobile hook as deprecated * fix: remove collapsed sidebar state * fix: only show health indicator when there are health alarms * fix: update tooltip unexpectedly opening on mobile when sidebar is expanded * chore: remove unnecessary cn method --------- Co-authored-by: im-adithya <[email protected]> Co-authored-by: Roland Bewick <[email protected]>
1 parent 8f2a885 commit b9c2f2e

25 files changed

+1591
-1123
lines changed

frontend/package.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,20 +34,20 @@
3434
"@radix-ui/react-progress": "^1.0.3",
3535
"@radix-ui/react-radio-group": "^1.2.0",
3636
"@radix-ui/react-select": "^2.0.0",
37-
"@radix-ui/react-separator": "^1.0.3",
38-
"@radix-ui/react-slot": "^1.1.1",
37+
"@radix-ui/react-separator": "^1.1.2",
38+
"@radix-ui/react-slot": "^1.1.2",
3939
"@radix-ui/react-switch": "^1.0.3",
4040
"@radix-ui/react-toast": "^1.1.5",
41-
"@radix-ui/react-tooltip": "^1.0.7",
41+
"@radix-ui/react-tooltip": "^1.1.8",
4242
"@scure/bip39": "^1.2.2",
4343
"argon2-wasm-esm": "^1.0.3",
44-
"class-variance-authority": "^0.7.0",
44+
"class-variance-authority": "^0.7.1",
4545
"clsx": "^2.1.0",
4646
"compare-versions": "^6.1.1",
4747
"date-fns": "^3.6.0",
4848
"dayjs": "^1.11.10",
4949
"embla-carousel-react": "^8.0.2",
50-
"lucide-react": "^0.363.0",
50+
"lucide-react": "^0.479.0",
5151
"react": "^18.2.0",
5252
"react-day-picker": "^8.10.1",
5353
"react-dom": "^18.2.0",

frontend/src/components/AppHeader.tsx

Lines changed: 20 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,34 @@
11
import { ReactElement } from "react";
2-
import Breadcrumbs from "src/components/Breadcrumbs";
2+
import { Separator } from "src/components/ui/separator";
3+
import { SidebarTrigger } from "src/components/ui/sidebar";
34

45
type Props = {
56
title: string | ReactElement;
6-
description: string | ReactElement;
7+
description?: string | ReactElement;
78
contentRight?: React.ReactNode;
89
breadcrumb?: boolean;
910
};
1011

11-
function AppHeader({
12-
title,
13-
description,
14-
contentRight,
15-
breadcrumb = true,
16-
}: Props) {
12+
function AppHeader({ title, description = "", contentRight }: Props) {
1713
return (
1814
<>
19-
{breadcrumb && <Breadcrumbs />}
20-
<div className="flex justify-between border-b border-border pb-3 lg:pb-6 items-center">
21-
<div className="flex-1">
22-
<h1 className="text-2xl lg:text-3xl font-semibold">{title}</h1>
23-
<p className="hidden lg:inline text-muted-foreground">
24-
{description}
25-
</p>
15+
<header className="flex flex-row items-center border-b border-border pb-4 gap-2">
16+
<SidebarTrigger className="-ml-1 sm:hidden" />
17+
<Separator orientation="vertical" className="mr-2 h-4 sm:hidden" />
18+
<div className="flex flex-col flex-1">
19+
<div className="flex justify-between items-center">
20+
<div className="flex-1">
21+
<h1 className="text-2xl lg:text-3xl font-semibold">{title}</h1>
22+
{description && (
23+
<p className="hidden lg:inline text-muted-foreground">
24+
{description}
25+
</p>
26+
)}
27+
</div>
28+
<div className="flex gap-3 h-full">{contentRight}</div>
29+
</div>
2630
</div>
27-
<div className="flex gap-3 h-full">{contentRight}</div>
28-
</div>
31+
</header>
2932
</>
3033
);
3134
}

0 commit comments

Comments
 (0)