Spaces:
Sleeping
Sleeping
Update components/Sidebar.tsx
Browse files- components/Sidebar.tsx +7 -4
components/Sidebar.tsx
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
|
|
| 1 |
import React, { useState, useEffect, useMemo } from 'react';
|
| 2 |
import { LayoutDashboard, Users, BookOpen, GraduationCap, Settings, LogOut, FileText, School, UserCog, Palette, X, Building, Gamepad2, CalendarCheck, UserCircle, MessageSquare, Bot, ArrowUp, ArrowDown, Save, UserCheck, Download } from 'lucide-react';
|
| 3 |
import { UserRole } from '../types';
|
|
@@ -113,10 +114,12 @@ export const Sidebar: React.FC<SidebarProps> = ({ currentView, onChangeView, use
|
|
| 113 |
}
|
| 114 |
};
|
| 115 |
|
|
|
|
| 116 |
const sidebarClasses = `
|
| 117 |
fixed inset-y-0 left-0 z-50 w-64 bg-slate-900 text-white transition-transform duration-300 ease-in-out transform
|
|
|
|
| 118 |
${isOpen ? 'translate-x-0' : '-translate-x-full'}
|
| 119 |
-
lg:relative lg:translate-x-0
|
| 120 |
`;
|
| 121 |
|
| 122 |
return (
|
|
@@ -124,7 +127,7 @@ export const Sidebar: React.FC<SidebarProps> = ({ currentView, onChangeView, use
|
|
| 124 |
{isOpen && <div className="fixed inset-0 bg-black/50 z-40 lg:hidden backdrop-blur-sm" onClick={onClose}></div>}
|
| 125 |
|
| 126 |
<div className={sidebarClasses}>
|
| 127 |
-
<div className="flex items-center justify-between h-20 border-b border-slate-700 px-6">
|
| 128 |
<div className="flex items-center space-x-2">
|
| 129 |
<GraduationCap className="h-8 w-8 text-blue-400" />
|
| 130 |
<span className="text-xl font-bold bg-clip-text text-transparent bg-gradient-to-r from-blue-400 to-teal-300">
|
|
@@ -180,7 +183,7 @@ export const Sidebar: React.FC<SidebarProps> = ({ currentView, onChangeView, use
|
|
| 180 |
</nav>
|
| 181 |
</div>
|
| 182 |
|
| 183 |
-
<div className="p-4 border-t border-slate-700 space-y-2">
|
| 184 |
{installPrompt && (
|
| 185 |
<button onClick={handleInstallClick} className="w-full flex items-center space-x-3 px-4 py-3 rounded-lg bg-gradient-to-r from-blue-600 to-indigo-600 text-white hover:shadow-lg transition-all duration-200 animate-in fade-in slide-in-from-bottom-2">
|
| 186 |
<Download size={20} />
|
|
@@ -204,4 +207,4 @@ export const Sidebar: React.FC<SidebarProps> = ({ currentView, onChangeView, use
|
|
| 204 |
</div>
|
| 205 |
</>
|
| 206 |
);
|
| 207 |
-
};
|
|
|
|
| 1 |
+
|
| 2 |
import React, { useState, useEffect, useMemo } from 'react';
|
| 3 |
import { LayoutDashboard, Users, BookOpen, GraduationCap, Settings, LogOut, FileText, School, UserCog, Palette, X, Building, Gamepad2, CalendarCheck, UserCircle, MessageSquare, Bot, ArrowUp, ArrowDown, Save, UserCheck, Download } from 'lucide-react';
|
| 4 |
import { UserRole } from '../types';
|
|
|
|
| 114 |
}
|
| 115 |
};
|
| 116 |
|
| 117 |
+
// Added 'flex flex-col h-full' to ensure proper layout on mobile
|
| 118 |
const sidebarClasses = `
|
| 119 |
fixed inset-y-0 left-0 z-50 w-64 bg-slate-900 text-white transition-transform duration-300 ease-in-out transform
|
| 120 |
+
flex flex-col h-full
|
| 121 |
${isOpen ? 'translate-x-0' : '-translate-x-full'}
|
| 122 |
+
lg:relative lg:translate-x-0 shadow-2xl lg:shadow-none
|
| 123 |
`;
|
| 124 |
|
| 125 |
return (
|
|
|
|
| 127 |
{isOpen && <div className="fixed inset-0 bg-black/50 z-40 lg:hidden backdrop-blur-sm" onClick={onClose}></div>}
|
| 128 |
|
| 129 |
<div className={sidebarClasses}>
|
| 130 |
+
<div className="flex items-center justify-between h-20 border-b border-slate-700 px-6 shrink-0">
|
| 131 |
<div className="flex items-center space-x-2">
|
| 132 |
<GraduationCap className="h-8 w-8 text-blue-400" />
|
| 133 |
<span className="text-xl font-bold bg-clip-text text-transparent bg-gradient-to-r from-blue-400 to-teal-300">
|
|
|
|
| 183 |
</nav>
|
| 184 |
</div>
|
| 185 |
|
| 186 |
+
<div className="p-4 border-t border-slate-700 space-y-2 shrink-0">
|
| 187 |
{installPrompt && (
|
| 188 |
<button onClick={handleInstallClick} className="w-full flex items-center space-x-3 px-4 py-3 rounded-lg bg-gradient-to-r from-blue-600 to-indigo-600 text-white hover:shadow-lg transition-all duration-200 animate-in fade-in slide-in-from-bottom-2">
|
| 189 |
<Download size={20} />
|
|
|
|
| 207 |
</div>
|
| 208 |
</>
|
| 209 |
);
|
| 210 |
+
};
|