Simplify navigation and modernize profile and sign-in
Magent CI/CD / verify (push) Successful in 10m55s
Magent CI/CD / deploy-prod (push) Skipped
Magent CI/CD / deploy-beta (push) Successful in 1m58s

This commit is contained in:
2026-09-06 18:24:18 +12:00
parent b5e4c57e93
commit 4d67567d4c
15 changed files with 620 additions and 755 deletions
+1 -20
View File
@@ -3,7 +3,6 @@
import { usePathname } from 'next/navigation'
import { useEffect, useState } from 'react'
import { authFetch, getApiBase, getToken } from '../lib/auth'
import BrandingLogo from './BrandingLogo'
type NavigationItem = {
href: string
@@ -19,7 +18,7 @@ const NAVIGATION: NavigationItem[] = [
{ href: '/new-requests', label: 'New Request', shortLabel: 'New', icon: 'media', match: (path) => path === '/new-requests' },
{ href: '/portal/issues', label: 'Issues', shortLabel: 'Issues', icon: 'issues', match: (path) => path.startsWith('/portal/issues') },
{ href: '/profile/invites', label: 'Invites', shortLabel: 'Invites', icon: 'invites', match: (path) => path.startsWith('/profile/invites') },
{ href: '/admin', label: 'Configuration', shortLabel: 'Config', icon: 'settings', adminOnly: true, match: (path) => path.startsWith('/admin') },
{ href: '/admin', label: 'Configuration', shortLabel: 'Config', icon: 'settings', adminOnly: true, match: (path) => path.startsWith('/admin') || path.startsWith('/users') },
]
const HIDDEN_ROUTES = ['/login', '/signup', '/forgot-password', '/reset-password', '/how-it-works']
@@ -67,24 +66,6 @@ export default function WorkspaceNavigation() {
return (
<>
{!pathname.startsWith('/admin') && <aside className="workspace-sidebar" aria-label="Workspace navigation">
<div className="workspace-sidebar-identity">
<BrandingLogo className="workspace-sidebar-logo" />
<div><strong>{role === 'admin' ? 'Magent Admin' : 'Magent'}</strong><span>Media operations workspace</span></div>
</div>
{showRequestsNav && <a className="workspace-new-request" href="/new-requests"><span>+</span> New request</a>}
<nav>
{items.map((item) => (
<a key={item.href} href={item.href} className={item.match(pathname) ? 'is-active' : undefined}>
<NavigationIcon name={item.icon} /><span>{item.label}</span>
</a>
))}
</nav>
<div className="workspace-sidebar-footer">
<a href="/feedback">Support</a>
<a href={role === 'admin' ? '/admin' : '/profile'}>Settings</a>
</div>
</aside>}
<nav className="workspace-mobile-nav" aria-label="Mobile navigation">
{items.slice(0, 5).map((item) => (
<a key={item.href} href={item.href} className={item.match(pathname) ? 'is-active' : undefined}>