fix: remove /dashboard prefix from nav links and redirects

Next.js route groups like (dashboard) don't appear in URLs, so the
sidebar, header, and dashboard page were linking to /dashboard/inbox,
/dashboard/contacts, etc. which don't exist and returned 404.

Fixed paths in:
- src/components/layout/sidebar.tsx (nav hrefs)
- src/components/layout/header.tsx (page title map)
- src/app/(dashboard)/dashboard/page.tsx (router.push calls)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Arnas Donauskas 2026-04-16 19:29:34 +03:00
parent 658d070811
commit a4c966334a
No known key found for this signature in database
3 changed files with 14 additions and 14 deletions

View File

@ -234,7 +234,7 @@ export default function DashboardPage() {
</h2> </h2>
</div> </div>
<button <button
onClick={() => router.push("/dashboard/inbox")} onClick={() => router.push("/inbox")}
className="flex items-center gap-1 text-xs text-emerald-400 hover:text-emerald-300 transition-colors" className="flex items-center gap-1 text-xs text-emerald-400 hover:text-emerald-300 transition-colors"
> >
View all View all
@ -261,7 +261,7 @@ export default function DashboardPage() {
recentConversations.map((conv) => ( recentConversations.map((conv) => (
<button <button
key={conv.id} key={conv.id}
onClick={() => router.push("/dashboard/inbox")} onClick={() => router.push("/inbox")}
className="flex w-full items-center gap-3 px-5 py-3 text-left transition-colors hover:bg-slate-800/50" className="flex w-full items-center gap-3 px-5 py-3 text-left transition-colors hover:bg-slate-800/50"
> >
<div className="flex h-9 w-9 shrink-0 items-center justify-center rounded-full bg-emerald-500/10 text-sm font-medium text-emerald-500"> <div className="flex h-9 w-9 shrink-0 items-center justify-center rounded-full bg-emerald-500/10 text-sm font-medium text-emerald-500">

View File

@ -6,12 +6,12 @@ import { LogOut } from "lucide-react";
const pageTitles: Record<string, string> = { const pageTitles: Record<string, string> = {
"/dashboard": "Dashboard", "/dashboard": "Dashboard",
"/dashboard/inbox": "Inbox", "/inbox": "Inbox",
"/dashboard/contacts": "Contacts", "/contacts": "Contacts",
"/dashboard/pipelines": "Pipelines", "/pipelines": "Pipelines",
"/dashboard/broadcasts": "Broadcasts", "/broadcasts": "Broadcasts",
"/dashboard/automations": "Automations", "/automations": "Automations",
"/dashboard/settings": "Settings", "/settings": "Settings",
}; };
function getPageTitle(pathname: string): string { function getPageTitle(pathname: string): string {

View File

@ -17,15 +17,15 @@ import {
const navItems = [ const navItems = [
{ href: "/dashboard", label: "Dashboard", icon: LayoutDashboard }, { href: "/dashboard", label: "Dashboard", icon: LayoutDashboard },
{ href: "/dashboard/inbox", label: "Inbox", icon: MessageSquare }, { href: "/inbox", label: "Inbox", icon: MessageSquare },
{ href: "/dashboard/contacts", label: "Contacts", icon: Users }, { href: "/contacts", label: "Contacts", icon: Users },
{ href: "/dashboard/pipelines", label: "Pipelines", icon: GitBranch }, { href: "/pipelines", label: "Pipelines", icon: GitBranch },
{ href: "/dashboard/broadcasts", label: "Broadcasts", icon: Radio }, { href: "/broadcasts", label: "Broadcasts", icon: Radio },
{ href: "/dashboard/automations", label: "Automations", icon: Zap }, { href: "/automations", label: "Automations", icon: Zap },
]; ];
const bottomNavItems = [ const bottomNavItems = [
{ href: "/dashboard/settings", label: "Settings", icon: Settings }, { href: "/settings", label: "Settings", icon: Settings },
]; ];
export function Sidebar() { export function Sidebar() {