sidebar autohides

This commit is contained in:
echo 2025-12-13 03:26:30 +01:00
parent 5743ebc4f8
commit 868eaa5e3d
8 changed files with 24 additions and 17 deletions

Binary file not shown.

View File

@ -1,6 +1,6 @@
/// <reference types="next" /> /// <reference types="next" />
/// <reference types="next/image-types/global" /> /// <reference types="next/image-types/global" />
import "./.next/types/routes.d.ts"; import "./.next/dev/types/routes.d.ts";
// NOTE: This file should not be edited // NOTE: This file should not be edited
// see https://nextjs.org/docs/app/api-reference/config/typescript for more information. // see https://nextjs.org/docs/app/api-reference/config/typescript for more information.

View File

@ -28,7 +28,7 @@ export default function RootLayout({
<body className={inter.className}> <body className={inter.className}>
<div className="flex min-h-screen bg-slate-50"> <div className="flex min-h-screen bg-slate-50">
<Sidebar /> <Sidebar />
<main className="flex-1 ml-64 p-8"> <main className="flex-1 ml-20 p-8">
{children} {children}
</main> </main>
</div> </div>

View File

@ -87,12 +87,11 @@ export default function Home() {
/> />
</div> </div>
<div className="grid grid-cols-1 lg:grid-cols-3 gap-8"> <div className="flex flex-col gap-8">
<div className="lg:col-span-2 bg-white rounded-xl shadow-sm border border-slate-100 p-6"> <div className="bg-white rounded-xl shadow-sm border border-slate-100 p-6">
<h3 className="text-xl font-bold text-slate-900 mb-6">Recent Activity</h3> <h3 className="text-xl font-bold text-slate-900 mb-6">Recent Activity</h3>
<UserManagement /> <UserManagement />
</div> </div>
<div className="bg-white rounded-xl shadow-sm border border-slate-100 p-6"> <div className="bg-white rounded-xl shadow-sm border border-slate-100 p-6">
<h3 className="text-xl font-bold text-slate-900 mb-6">Quick Analytics</h3> <h3 className="text-xl font-bold text-slate-900 mb-6">Quick Analytics</h3>
<AnalyticsDashboard /> <AnalyticsDashboard />

View File

@ -73,7 +73,7 @@ export function AnalyticsDashboard() {
} }
return ( return (
<div className="space-y-6"> <div className="space-y-6 w-full">
<h2 className="text-2xl font-bold">Analytics Dashboard</h2> <h2 className="text-2xl font-bold">Analytics Dashboard</h2>
{/* Key Metrics */} {/* Key Metrics */}
@ -143,4 +143,4 @@ export function AnalyticsDashboard() {
</Card> </Card>
</div> </div>
) )
} }

View File

@ -65,9 +65,9 @@ export function Sidebar() {
]; ];
return ( return (
<aside className="w-64 bg-slate-900 text-white h-screen fixed left-0 top-0 flex flex-col border-r border-slate-800"> <aside className="w-20 hover:w-64 bg-slate-900 text-white h-screen fixed left-0 top-0 flex flex-col border-r border-slate-800 transition-all duration-300 z-50 group overflow-hidden">
<div className="p-6 border-b border-slate-800"> <div className="p-6 border-b border-slate-800 flex items-center overflow-hidden whitespace-nowrap">
<h1 className="text-2xl font-bold bg-gradient-to-r from-blue-400 to-indigo-400 bg-clip-text text-transparent"> <h1 className="text-2xl font-bold bg-gradient-to-r from-blue-400 to-indigo-400 bg-clip-text text-transparent opacity-0 group-hover:opacity-100 transition-opacity duration-300">
FitAI Admin FitAI Admin
</h1> </h1>
</div> </div>
@ -81,21 +81,27 @@ export function Sidebar() {
<Link <Link
key={item.href} key={item.href}
href={item.href} href={item.href}
className={`flex items-center gap-3 px-4 py-3 rounded-lg transition-all duration-200 group ${isActive className={`flex items-center gap-3 px-4 py-3 rounded-lg transition-all duration-200 ${isActive
? "bg-blue-600 text-white shadow-lg shadow-blue-900/20" ? "bg-blue-600 text-white shadow-lg shadow-blue-900/20"
: "text-slate-400 hover:bg-slate-800 hover:text-white"}`} : "text-slate-400 hover:bg-slate-800 hover:text-white"}`}
> >
<Icon size={20} className={isActive ? "text-white" : "text-slate-500 group-hover:text-white"} /> <div className="min-w-[20px]">
<span className="font-medium">{label}</span> <Icon size={20} className={isActive ? "text-white" : "text-slate-500 group-hover:text-white"} />
</div>
<span className="font-medium opacity-0 group-hover:opacity-100 transition-opacity duration-300 whitespace-nowrap overflow-hidden">
{label}
</span>
</Link> </Link>
); );
})} })}
</nav> </nav>
<div className="p-4 border-t border-slate-800"> <div className="p-4 border-t border-slate-800">
<div className="flex items-center gap-3 px-4 py-3 rounded-lg bg-slate-800/50"> <div className="flex items-center gap-3 px-2 py-3 rounded-lg bg-slate-800/50 overflow-hidden whitespace-nowrap">
<UserButton afterSignOutUrl="/" /> <div className="min-w-[32px]">
<div className="flex-1 min-w-0"> <UserButton afterSignOutUrl="/" />
</div>
<div className="flex-1 min-w-0 opacity-0 group-hover:opacity-100 transition-opacity duration-300">
<p className="text-sm font-medium text-white truncate"> <p className="text-sm font-medium text-white truncate">
{user?.fullName || "Admin User"} {user?.fullName || "Admin User"}
</p> </p>

View File

@ -1,5 +1,5 @@
export const API_BASE_URL = __DEV__ export const API_BASE_URL = __DEV__
? 'https://5e424f097c8b.ngrok-free.app' ? 'https://e0877d294c41.ngrok-free.app'
: 'https://your-production-url.com' : 'https://your-production-url.com'
export const API_ENDPOINTS = { export const API_ENDPOINTS = {

2
mise.toml Normal file
View File

@ -0,0 +1,2 @@
[tools]
node = "24.11.1"