Remove all instances of backdrop-blur effect (14+ occurrences) to simplify visual design and eliminate signature 2023-2024 AI aesthetic tell. Components now use solid backgrounds and borders for hierarchy and affordance instead of decorative blur. Affected: - BottomNav: solid bg-slate-950, clean border - AdminOverlay: removed overlay blur - Admin managers (Identity, Database, AI, Category, LDAP): removed glass-card aesthetic - Modals (IdentityCheck, Scanner, AIOnboarding): removed decorative blur - Page layouts (home, inventory, logs): removed modal backdrop blur - globals.css: removed glass-card utility Build: passes with zero errors. Bundle sizes unchanged. Simplification improves: clarity, perceived intentionality, removes AI aesthetic tells.
85 lines
3.2 KiB
TypeScript
85 lines
3.2 KiB
TypeScript
'use client';
|
|
|
|
import { Smartphone, Package, History, Settings, Shield, LogOut } from 'lucide-react';
|
|
import { useRouter, usePathname } from 'next/navigation';
|
|
import { clsx, type ClassValue } from 'clsx';
|
|
import { twMerge } from 'tailwind-merge';
|
|
|
|
function cn(...inputs: ClassValue[]) {
|
|
return twMerge(clsx(inputs));
|
|
}
|
|
|
|
interface BottomNavProps {
|
|
currentUser: any;
|
|
}
|
|
|
|
export default function BottomNav({
|
|
currentUser
|
|
}: BottomNavProps) {
|
|
const router = useRouter();
|
|
const pathname = usePathname();
|
|
|
|
const isHome = pathname === '/';
|
|
const isInventory = pathname === '/inventory';
|
|
const isLogs = pathname === '/logs';
|
|
const isAdmin = pathname === '/admin';
|
|
|
|
return (
|
|
<footer className="fixed bottom-0 left-0 right-0 py-3 px-2 pb-safe bg-slate-950 border-t border-slate-900 z-40 transition-all duration-300">
|
|
<div className="max-w-xl mx-auto flex justify-around items-center text-slate-400">
|
|
|
|
<button
|
|
onClick={() => router.push('/')}
|
|
className={cn("flex flex-col items-center gap-1 rounded px-2 py-1 focus-visible:ring-2 focus-visible:ring-primary focus-visible:outline-none", isHome && "text-primary")}
|
|
>
|
|
<Smartphone size={20} />
|
|
<span className="text-xs font-bold transition-all">Home</span>
|
|
</button>
|
|
|
|
{/* Inventory */}
|
|
<button
|
|
onClick={() => router.push('/inventory')}
|
|
className={cn("flex flex-col items-center gap-1 rounded px-2 py-1 focus-visible:ring-2 focus-visible:ring-primary focus-visible:outline-none", isInventory && "text-primary")}
|
|
>
|
|
<Package size={20} />
|
|
<span className="text-xs font-bold transition-all">Inventory</span>
|
|
</button>
|
|
|
|
{/* Logs */}
|
|
<button
|
|
onClick={() => router.push('/logs')}
|
|
className={cn("flex flex-col items-center gap-1 rounded px-2 py-1 focus-visible:ring-2 focus-visible:ring-primary focus-visible:outline-none", isLogs && "text-primary")}
|
|
>
|
|
<History size={20} />
|
|
<span className="text-xs font-bold transition-all">Logs</span>
|
|
</button>
|
|
|
|
{/* Admin Settings */}
|
|
{currentUser?.role === 'admin' && (
|
|
<button
|
|
onClick={() => router.push('/admin')}
|
|
className={cn("flex flex-col items-center gap-1 rounded px-2 py-1 focus-visible:ring-2 focus-visible:ring-primary focus-visible:outline-none", isAdmin && "text-primary")}
|
|
>
|
|
<Settings size={20} />
|
|
<span className="text-xs font-bold transition-all">Admin</span>
|
|
</button>
|
|
)}
|
|
|
|
{/* Logout */}
|
|
<button
|
|
onClick={() => {
|
|
if (window.confirm("Are you sure you want to logout?")) {
|
|
import('@/lib/auth').then(m => m.clearAuth());
|
|
window.location.href = '/login';
|
|
}
|
|
}}
|
|
className="flex flex-col items-center gap-1 text-rose-500 hover:text-rose-400 transition-colors rounded px-2 py-1 focus-visible:ring-2 focus-visible:ring-rose-500 focus-visible:outline-none"
|
|
>
|
|
<LogOut size={20} />
|
|
<span className="text-xs font-bold transition-all">Logout</span>
|
|
</button>
|
|
</div>
|
|
</footer>
|
|
);
|
|
}
|