Skip to content

Commit fecc3e3

Browse files
authored
Merge pull request #203 from inas-sirhan/fix/streaming-sidebar-active-state
Fix Streaming sidebar losing active state on sub-tabs
2 parents e4e436b + d132b82 commit fecc3e3

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

ui/src/components/layout/Sidebar.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ const SIDEBAR_COLLAPSED_STORAGE_KEY = "kalamdb-admin-sidebar-collapsed";
2626
const navigation = [
2727
{ name: "Dashboard", href: "/dashboard", icon: LayoutDashboard },
2828
{ name: "SQL Studio", href: "/sql", icon: Terminal },
29-
{ name: "Streaming", href: "/streaming/topics", icon: RadioTower },
29+
{ name: "Streaming", href: "/streaming/topics", icon: RadioTower, activePrefix: "/streaming" },
3030
{ name: "Users", href: "/users", icon: Users },
3131
{ name: "Jobs", href: "/jobs", icon: Briefcase },
3232
{ name: "Live Queries", href: "/live-queries", icon: Wifi },
@@ -54,7 +54,7 @@ export default function Sidebar() {
5454
>
5555
<nav className="min-h-0 flex-1 space-y-1 overflow-y-auto p-2">
5656
{navigation.map((item) => {
57-
const isActive = location.pathname.startsWith(item.href);
57+
const isActive = location.pathname.startsWith(item.activePrefix ?? item.href);
5858
console.log("Sidebar item:", item.name, "href:", item.href, "pathname:", location.pathname, "isActive:", isActive);
5959
return (
6060
<Tooltip key={item.name} disableHoverableContent>

0 commit comments

Comments
 (0)