fix: Dashboard menu stays active on all routes + remove mobile blur + add standalone admin setup guide

This commit is contained in:
dwindown
2025-11-04 22:04:34 +07:00
parent e161163362
commit 9f3153d904
4 changed files with 148 additions and 6 deletions

View File

@@ -106,10 +106,10 @@ function Sidebar() {
return (
<aside className="w-56 p-3 border-r border-border sticky top-16 h-[calc(100vh-64px)] overflow-y-auto bg-background">
<nav className="flex flex-col gap-1">
<NavLink to="/" end className={({ isActive }) => `${link} ${isActive ? active : ''}`}>
<ActiveNavLink to="/dashboard" startsWith="/dashboard" className={({ isActive }: any) => `${link} ${isActive ? active : ''}`}>
<LayoutDashboard className="w-4 h-4" />
<span>{__("Dashboard")}</span>
</NavLink>
</ActiveNavLink>
<ActiveNavLink to="/orders" startsWith="/orders" className={({ isActive }: any) => `${link} ${isActive ? active : ''}`}>
<ReceiptText className="w-4 h-4" />
<span>{__("Orders")}</span>
@@ -140,12 +140,12 @@ function TopNav({ fullscreen = false }: { fullscreen?: boolean }) {
const active = "bg-secondary";
const topClass = fullscreen ? 'top-16' : 'top-[calc(4rem+32px)]';
return (
<div className={`border-b border-border sticky ${topClass} z-30 bg-background/95 backdrop-blur supports-[backdrop-filter]:bg-background/60`}>
<div className={`border-b border-border sticky ${topClass} z-30 bg-background md:bg-background/95 md:backdrop-blur md:supports-[backdrop-filter]:bg-background/60`}>
<div className="px-4 h-12 flex flex-nowrap overflow-auto items-center gap-2">
<NavLink to="/" end className={({ isActive }) => `${link} ${isActive ? active : ''}`}>
<ActiveNavLink to="/dashboard" startsWith="/dashboard" className={({ isActive }: any) => `${link} ${isActive ? active : ''}`}>
<LayoutDashboard className="w-4 h-4" />
<span>{__("Dashboard")}</span>
</NavLink>
</ActiveNavLink>
<ActiveNavLink to="/orders" startsWith="/orders" className={({ isActive }: any) => `${link} ${isActive ? active : ''}`}>
<ReceiptText className="w-4 h-4" />
<span>{__("Orders")}</span>

View File

@@ -49,7 +49,7 @@ function getStaticFallbackTree(): MainNode[] {
path: '/',
icon: 'layout-dashboard',
children: [
{ label: 'Overview', mode: 'spa', path: '/', exact: true },
{ label: 'Overview', mode: 'spa', path: '/dashboard' },
{ label: 'Revenue', mode: 'spa', path: '/dashboard/revenue' },
{ label: 'Orders', mode: 'spa', path: '/dashboard/orders' },
{ label: 'Products', mode: 'spa', path: '/dashboard/products' },