From b06ce83488d0e798a1f760dae81a11680274d992 Mon Sep 17 00:00:00 2001 From: SrashtiChauhan Date: Fri, 29 May 2026 21:26:34 +0530 Subject: [PATCH] fix: unify navbar and insights layout consistency --- frontend/app/components/AppShell.tsx | 43 ++--- frontend/app/components/CommandPalette.tsx | 2 +- frontend/app/components/InsightsSidebar.tsx | 150 ++++++++++++------ .../components/Overview-comp/OverviewMain.tsx | 2 +- .../app/components/Tasks-comp/TasksHeader.tsx | 71 ++++++--- .../app/components/Tasks-comp/TopHeader.tsx | 29 ++-- frontend/app/components/TopNavbar.tsx | 91 +++++++++++ .../analytics-comp/AnalyticsHeader.tsx | 70 +++----- frontend/app/insights pages/page.tsx | 77 --------- frontend/app/insights/analytics/page.tsx | 42 +++-- frontend/app/insights/feed/page.tsx | 1 - frontend/app/insights/layout.tsx | 11 +- frontend/app/insights/overview/page.tsx | 7 +- frontend/app/insights/tasks/page.tsx | 3 - frontend/app/projects/page.tsx | 1 + 15 files changed, 341 insertions(+), 259 deletions(-) create mode 100644 frontend/app/components/TopNavbar.tsx delete mode 100644 frontend/app/insights pages/page.tsx diff --git a/frontend/app/components/AppShell.tsx b/frontend/app/components/AppShell.tsx index 69bb3b2..25ffafa 100644 --- a/frontend/app/components/AppShell.tsx +++ b/frontend/app/components/AppShell.tsx @@ -1,43 +1,44 @@ "use client"; -import CommandPalette from "./CommandPalette"; -import NotificationsPanel from "./NotificationsPanel"; import { usePathname } from "next/navigation"; + +import CommandPalette from "./CommandPalette"; import Sidebar from "./Sidebar"; +import TopNavbar from "./TopNavbar"; -export default function AppShell({ children }: { children: React.ReactNode }) { +export default function AppShell({ + children, +}: { + children: React.ReactNode; +}) { const pathname = usePathname(); const isPublicRoute = - pathname === "/" || pathname === "/login" || pathname === "/signup"; - const isInsightsRoute = pathname?.startsWith("/insights"); + pathname === "/" || + pathname === "/login" || + pathname === "/signup"; + + const isInsightsRoute = + pathname?.startsWith("/insights"); - const hideSidebar = isPublicRoute || isInsightsRoute; + const hideSidebar = + isPublicRoute || isInsightsRoute; - // Let Insights pages control their own padding + // Insights pages manage their own spacing const mainClass = hideSidebar ? "min-w-0 flex-1 overflow-x-hidden" : "min-w-0 flex-1 overflow-x-hidden p-6"; return ( -
+
{!hideSidebar && } -
+
{!isPublicRoute && ( -
- +
+
)} @@ -47,4 +48,4 @@ export default function AppShell({ children }: { children: React.ReactNode }) {
); -} +} \ No newline at end of file diff --git a/frontend/app/components/CommandPalette.tsx b/frontend/app/components/CommandPalette.tsx index 3e05876..edbdc6f 100644 --- a/frontend/app/components/CommandPalette.tsx +++ b/frontend/app/components/CommandPalette.tsx @@ -6,7 +6,7 @@ import { useRouter } from "next/navigation"; const commands = [ { id: 1, label: "Dashboard", href: "/dashboard" }, { id: 2, label: "Projects", href: "/projects" }, - { id: 3, label: "Insights Analytics", href: "/insights/analytics" }, + { id: 3, label: "Insights Overview", href: "/insights/overview" }, { id: 4, label: "Insights Tasks", href: "/insights/tasks" }, { id: 5, label: "Insights Feed", href: "/insights/feed" }, ]; diff --git a/frontend/app/components/InsightsSidebar.tsx b/frontend/app/components/InsightsSidebar.tsx index e03290a..56b16dd 100644 --- a/frontend/app/components/InsightsSidebar.tsx +++ b/frontend/app/components/InsightsSidebar.tsx @@ -1,68 +1,124 @@ "use client"; -import React from "react"; import Link from "next/link"; import { usePathname } from "next/navigation"; -import { LayoutDashboard, FileBarChart, Blocks, MessageSquare, Plus, Settings, HelpCircle, Route, MessageCircle, BarChart3, LineChart } from "lucide-react"; +import { + LayoutDashboard, + LineChart, + Route, + MessageCircle, + Plus, + Settings, + HelpCircle, +} from "lucide-react"; export default function InsightsSidebar() { const pathname = usePathname(); const navItems = [ - { href: "/insights/overview", label: "Overview", icon: LayoutDashboard }, - { href: "/insights/analytics", label: "Analytics", icon: LineChart }, - { href: "/insights/tasks", label: "Tasks", icon: Route }, - { href: "/insights/feed", label: "Feed", icon: MessageCircle }, + { + href: "/insights/overview", + label: "Overview", + icon: LayoutDashboard, + }, + { + href: "/insights/analytics", + label: "Analytics", + icon: LineChart, + }, + { + href: "/insights/tasks", + label: "Tasks", + icon: Route, + }, + { + href: "/insights/feed", + label: "Feed", + icon: MessageCircle, + }, ]; return ( -