updates on the setting page
This commit is contained in:
@@ -3,7 +3,7 @@ import { Link, Outlet, useLocation, useNavigate } from 'react-router-dom';
|
||||
import { motion } from 'framer-motion';
|
||||
import {
|
||||
Activity, Bell, Bike, Car, ChevronDown, Coins, FileSpreadsheet,
|
||||
FileText, IndianRupee, ListTodo, LogOut, Menu, Search, Settings, Shield,
|
||||
FileText, ListTodo, LogOut, Menu, Search, Settings, Shield,
|
||||
ShieldAlert, User, UserCheck, Users, Warehouse,
|
||||
} from 'lucide-react';
|
||||
import { cn } from '@/lib/utils';
|
||||
@@ -79,27 +79,6 @@ const NAV_GROUPS = [
|
||||
},
|
||||
];
|
||||
|
||||
/* Configuration destinations, kept off the operations bar.
|
||||
*
|
||||
* Declared here rather than written inline in the account dropdown because
|
||||
* two surfaces need them: that dropdown on desktop, and the mobile sheet.
|
||||
* When they lived only in the dropdown's JSX, moving them off the bar quietly
|
||||
* removed them from the phone entirely — the sheet builds its list from NAV
|
||||
* plus NAV_GROUPS, and these were in neither. Both pages stayed routed and
|
||||
* reachable by typed URL, which is the kind of gap nobody reports and nobody
|
||||
* finds.
|
||||
*
|
||||
* (This replaces an ALL_DESTINATIONS constant that flattened NAV and
|
||||
* NAV_GROUPS. Its comment claimed it was "what the mobile sheet renders"; the
|
||||
* sheet had moved to a role-filtered local of the same name in lower case, so
|
||||
* the constant had no readers at all and would have reintroduced the same
|
||||
* omission if anyone had trusted it.)
|
||||
*/
|
||||
const SETTINGS_NAV = [
|
||||
{ label: 'Pricing Matrix', path: '/doormile/pricing', icon: IndianRupee },
|
||||
{ label: 'Customers Directory', path: '/doormile/customers', icon: Users },
|
||||
];
|
||||
|
||||
function GlobalSearch() {
|
||||
const navigate = useNavigate();
|
||||
const [query, setQuery] = useState('');
|
||||
@@ -492,18 +471,15 @@ export default function AdminLayout() {
|
||||
<Shield className="mr-2.5 h-4 w-4 text-slate-500" /> Change password
|
||||
</DropdownMenuItem>
|
||||
<DropdownMenuSeparator className="my-1" />
|
||||
<div className="px-2.5 py-1 text-[10px] font-bold uppercase tracking-wider text-slate-400 flex items-center gap-1.5">
|
||||
<Settings className="w-3 h-3 text-slate-400" /> Settings
|
||||
</div>
|
||||
{SETTINGS_NAV.map((item) => (
|
||||
<DropdownMenuItem
|
||||
key={item.path}
|
||||
onClick={() => navigate(item.path)}
|
||||
className="cursor-pointer rounded-xl px-2.5 py-2 font-medium"
|
||||
>
|
||||
<item.icon className="mr-2.5 h-4 w-4 text-slate-500" /> {item.label}
|
||||
</DropdownMenuItem>
|
||||
))}
|
||||
<DropdownMenuItem
|
||||
onClick={() => navigate('/doormile/settings')}
|
||||
className={cn(
|
||||
'cursor-pointer rounded-xl px-2.5 py-2 font-medium',
|
||||
location.pathname.startsWith('/doormile/settings') && 'bg-brand-tint text-brand font-semibold'
|
||||
)}
|
||||
>
|
||||
<Settings className="mr-2.5 h-4 w-4 text-slate-500" /> Settings
|
||||
</DropdownMenuItem>
|
||||
<DropdownMenuSeparator className="my-1" />
|
||||
<DropdownMenuItem
|
||||
onClick={() => logout()}
|
||||
@@ -552,22 +528,16 @@ export default function AdminLayout() {
|
||||
Without this block they existed on the bar's dropdown only, so
|
||||
a phone could not reach Pricing or Customers at all. */}
|
||||
<div className="my-2 h-px bg-border" />
|
||||
<div className="px-3 pb-1 text-[10px] font-bold uppercase tracking-wider text-ink-3">
|
||||
<Link
|
||||
to="/doormile/settings"
|
||||
onClick={() => setMenuOpen(false)}
|
||||
className={cn(
|
||||
'rounded-lg px-3 py-2.5 text-body-sm font-medium transition-colors',
|
||||
isActive('/doormile/settings') ? 'bg-brand-tint text-brand font-semibold' : 'text-ink-2 hover:bg-surface-sunken'
|
||||
)}
|
||||
>
|
||||
Settings
|
||||
</div>
|
||||
{SETTINGS_NAV.map((item) => (
|
||||
<Link
|
||||
key={item.path}
|
||||
to={item.path}
|
||||
onClick={() => setMenuOpen(false)}
|
||||
className={cn(
|
||||
'rounded-lg px-3 py-2.5 text-body-sm font-medium transition-colors',
|
||||
isActive(item.path) ? 'bg-brand-tint text-brand' : 'text-ink-2 hover:bg-surface-sunken'
|
||||
)}
|
||||
>
|
||||
{item.label}
|
||||
</Link>
|
||||
))}
|
||||
</Link>
|
||||
<div className="my-2 h-px bg-border" />
|
||||
<Link
|
||||
to="/doormile/profile"
|
||||
|
||||
Reference in New Issue
Block a user