fix: Settings submenu standalone-only, dashboard path, add admin bar link

This commit is contained in:
dwindown
2025-11-05 10:44:08 +07:00
parent 12e982b3e5
commit 3e7d75c98c
3 changed files with 28 additions and 5 deletions

View File

@@ -328,7 +328,8 @@ function AppRoutes() {
return (
<Routes>
{/* Dashboard */}
<Route path="/" element={<Dashboard />} />
<Route path="/" element={<Navigate to="/dashboard" replace />} />
<Route path="/dashboard" element={<Dashboard />} />
<Route path="/dashboard/revenue" element={<DashboardRevenue />} />
<Route path="/dashboard/orders" element={<DashboardOrders />} />
<Route path="/dashboard/products" element={<DashboardProducts />} />

View File

@@ -46,10 +46,10 @@ function getStaticFallbackTree(): MainNode[] {
{
key: 'dashboard',
label: 'Dashboard',
path: '/',
path: '/dashboard',
icon: 'layout-dashboard',
children: [
{ label: 'Overview', mode: 'spa', path: '/', exact: true },
{ label: 'Overview', mode: 'spa', path: '/dashboard', exact: true },
{ label: 'Revenue', mode: 'spa', path: '/dashboard/revenue' },
{ label: 'Orders', mode: 'spa', path: '/dashboard/orders' },
{ label: 'Products', mode: 'spa', path: '/dashboard/products' },
@@ -102,7 +102,8 @@ function getStaticFallbackTree(): MainNode[] {
label: 'Settings',
path: '/settings',
icon: 'settings',
children: [
// Only show submenu in standalone mode
children: (window as any).WNW_CONFIG?.standaloneMode ? [
// WooNooW Settings
{ label: 'WooNooW', mode: 'spa', path: '/settings' },
@@ -120,7 +121,7 @@ function getStaticFallbackTree(): MainNode[] {
{ label: 'Integration', mode: 'bridge', href: `${admin}?page=wc-settings&tab=integration` },
{ label: 'Status', mode: 'bridge', href: `${admin}?page=wc-status` },
{ label: 'Extensions', mode: 'bridge', href: `${admin}?page=wc-addons` },
],
] : [],
},
];
}