fix: move AdminScopeToggle from NavDrawer to main header bar
Places the scope toggle next to the UserMenu avatar in the top-right header area so it's always visible without opening the nav drawer.
This commit is contained in:
@@ -7,6 +7,7 @@ import UserManagement from './components/UserManagement';
|
|||||||
import AuditLog from './components/AuditLog';
|
import AuditLog from './components/AuditLog';
|
||||||
import NvdSyncModal from './components/NvdSyncModal';
|
import NvdSyncModal from './components/NvdSyncModal';
|
||||||
import NavDrawer from './components/NavDrawer';
|
import NavDrawer from './components/NavDrawer';
|
||||||
|
import AdminScopeToggle from './components/AdminScopeToggle';
|
||||||
import CalendarWidget from './components/CalendarWidget';
|
import CalendarWidget from './components/CalendarWidget';
|
||||||
import ConfirmModal from './components/ConfirmModal';
|
import ConfirmModal from './components/ConfirmModal';
|
||||||
import VulnerabilityTriagePage from './components/pages/ReportingPage';
|
import VulnerabilityTriagePage from './components/pages/ReportingPage';
|
||||||
@@ -1020,6 +1021,7 @@ export default function App() {
|
|||||||
Add Entry
|
Add Entry
|
||||||
</button>
|
</button>
|
||||||
)}
|
)}
|
||||||
|
<AdminScopeToggle />
|
||||||
<UserMenu onManageUsers={() => setShowUserManagement(true)} onAuditLog={() => setShowAuditLog(true)} />
|
<UserMenu onManageUsers={() => setShowUserManagement(true)} onAuditLog={() => setShowAuditLog(true)} />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { X, Home, BarChart2, BookOpen, Download, ShieldCheck, Settings, Ticket } from 'lucide-react';
|
import { X, Home, BarChart2, BookOpen, Download, ShieldCheck, Settings, Ticket } from 'lucide-react';
|
||||||
import { useAuth } from '../contexts/AuthContext';
|
import { useAuth } from '../contexts/AuthContext';
|
||||||
import AdminScopeToggle from './AdminScopeToggle';
|
|
||||||
|
|
||||||
const NAV_ITEMS = [
|
const NAV_ITEMS = [
|
||||||
{ id: 'home', label: 'Home', icon: Home, color: '#0EA5E9', description: 'Main dashboard' },
|
{ id: 'home', label: 'Home', icon: Home, color: '#0EA5E9', description: 'Main dashboard' },
|
||||||
@@ -64,12 +63,6 @@ export default function NavDrawer({ isOpen, onClose, currentPage, onNavigate })
|
|||||||
|
|
||||||
{/* Nav items */}
|
{/* Nav items */}
|
||||||
<nav style={{ display: 'flex', flexDirection: 'column', gap: '0.375rem' }}>
|
<nav style={{ display: 'flex', flexDirection: 'column', gap: '0.375rem' }}>
|
||||||
|
|
||||||
{/* Admin scope toggle — between header and nav items */}
|
|
||||||
<div style={{ marginBottom: '0.5rem' }}>
|
|
||||||
<AdminScopeToggle />
|
|
||||||
</div>
|
|
||||||
|
|
||||||
{NAV_ITEMS.map(({ id, label, icon: Icon, color, description }) => {
|
{NAV_ITEMS.map(({ id, label, icon: Icon, color, description }) => {
|
||||||
const active = currentPage === id;
|
const active = currentPage === id;
|
||||||
return (
|
return (
|
||||||
|
|||||||
Reference in New Issue
Block a user