2025-12-03 21:56:50 +00:00
|
|
|
import type { ReactNode } from 'react';
|
|
|
|
|
import { Header } from './Header';
|
|
|
|
|
import { Sidebar } from './Sidebar';
|
feat: Visual masterpiece - true light mode & premium UI
🎨 **True Light/Dark Mode**
- Implemented proper light mode with inverted color scheme
- Smooth theme transitions (0.3s ease)
- Light mode colors: white backgrounds, dark text, vibrant accents
- System theme detection with proper class application
🌈 **Enhanced Theme System**
- 4 color themes work in both light and dark modes
- Cyber (cyan/magenta), Ocean (blue/teal), Forest (green/lime), Sunset (orange/purple)
- Theme-specific glassmorphism effects
- Proper contrast in light mode
✨ **Premium Animations**
- Float, glow-pulse, slide-in, scale-in, rotate-in animations
- Smooth page transitions
- Hover effects with depth (lift, glow, scale)
- Micro-interactions on all interactive elements
🎯 **Visual Polish**
- Enhanced glassmorphism for light/dark modes
- Custom scrollbar with theme colors
- Beautiful text selection
- Focus indicators for accessibility
- Premium utility classes
🔧 **Technical Improvements**
- Updated UIStore to properly apply light/dark classes
- Added data-theme attribute for CSS targeting
- Smooth scroll behavior
- Optimized transitions
The app is now a visual masterpiece with perfect light/dark mode support!
2026-01-11 01:32:21 +00:00
|
|
|
import { GlobalPlayer } from '@/features/player/components/GlobalPlayer';
|
2026-01-18 12:32:17 +00:00
|
|
|
import { useUIStore } from '@/stores/ui';
|
|
|
|
|
import { cn } from '@/lib/utils';
|
2025-12-03 21:56:50 +00:00
|
|
|
|
|
|
|
|
interface DashboardLayoutProps {
|
|
|
|
|
children: ReactNode;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Layout principal du dashboard avec sidebar et header.
|
|
|
|
|
* Utilise une structure flex avec sidebar fixe et contenu scrollable.
|
2026-01-18 12:32:17 +00:00
|
|
|
*
|
|
|
|
|
* FIX: La sidebar est fixe (fixed left-6), donc le contenu principal doit avoir
|
|
|
|
|
* un margin-left pour ne pas être masqué par la sidebar.
|
2025-12-03 21:56:50 +00:00
|
|
|
*/
|
|
|
|
|
export function DashboardLayout({ children }: DashboardLayoutProps) {
|
2026-01-18 12:32:17 +00:00
|
|
|
const { sidebarOpen } = useUIStore();
|
|
|
|
|
|
|
|
|
|
// FIX: Calculer le margin-left pour compenser la sidebar fixe
|
|
|
|
|
// Sidebar: left-6 (24px) + width (w-64 = 256px quand ouverte, w-20 = 80px quand fermée) + gap (24px)
|
|
|
|
|
// Sur desktop (lg): sidebar est toujours visible, donc toujours besoin de margin
|
|
|
|
|
// Sur mobile: sidebar est cachée (-translate-x-full), donc pas de margin
|
|
|
|
|
|
2025-12-03 21:56:50 +00:00
|
|
|
return (
|
2026-01-18 12:32:17 +00:00
|
|
|
<div className="flex h-screen overflow-hidden relative">
|
2025-12-03 21:56:50 +00:00
|
|
|
<Sidebar />
|
2026-01-18 12:32:17 +00:00
|
|
|
{/* FIX: Ajouter margin-left pour compenser la sidebar fixe et éviter la superposition */}
|
|
|
|
|
<div
|
|
|
|
|
className={cn(
|
|
|
|
|
'flex-1 flex flex-col min-w-0 transition-all duration-500 ease-in-out',
|
|
|
|
|
// Sur desktop (lg), toujours ajouter le margin pour la sidebar
|
|
|
|
|
// Sidebar ouverte: left-6 (24px) + w-64 (256px) + gap (24px) = 304px
|
|
|
|
|
// Sidebar fermée: left-6 (24px) + w-20 (80px) + gap (24px) = 128px
|
|
|
|
|
sidebarOpen
|
|
|
|
|
? 'lg:ml-[304px]' // 24 + 256 + 24 = 304px
|
|
|
|
|
: 'lg:ml-[128px]', // 24 + 80 + 24 = 128px
|
|
|
|
|
// Sur mobile, pas de margin car sidebar est cachée (-translate-x-full)
|
|
|
|
|
)}
|
|
|
|
|
>
|
2025-12-03 21:56:50 +00:00
|
|
|
<Header />
|
2026-01-18 11:34:22 +00:00
|
|
|
{/* FIX: Ajouter padding-top pour compenser le header fixe (h-16 + mt-4 = 80px = top-20) */}
|
2026-01-18 12:32:17 +00:00
|
|
|
<main className="flex-1 overflow-auto pb-24 pt-20 relative z-0">{children}</main>
|
feat: Visual masterpiece - true light mode & premium UI
🎨 **True Light/Dark Mode**
- Implemented proper light mode with inverted color scheme
- Smooth theme transitions (0.3s ease)
- Light mode colors: white backgrounds, dark text, vibrant accents
- System theme detection with proper class application
🌈 **Enhanced Theme System**
- 4 color themes work in both light and dark modes
- Cyber (cyan/magenta), Ocean (blue/teal), Forest (green/lime), Sunset (orange/purple)
- Theme-specific glassmorphism effects
- Proper contrast in light mode
✨ **Premium Animations**
- Float, glow-pulse, slide-in, scale-in, rotate-in animations
- Smooth page transitions
- Hover effects with depth (lift, glow, scale)
- Micro-interactions on all interactive elements
🎯 **Visual Polish**
- Enhanced glassmorphism for light/dark modes
- Custom scrollbar with theme colors
- Beautiful text selection
- Focus indicators for accessibility
- Premium utility classes
🔧 **Technical Improvements**
- Updated UIStore to properly apply light/dark classes
- Added data-theme attribute for CSS targeting
- Smooth scroll behavior
- Optimized transitions
The app is now a visual masterpiece with perfect light/dark mode support!
2026-01-11 01:32:21 +00:00
|
|
|
<GlobalPlayer />
|
2025-12-03 21:56:50 +00:00
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
);
|
|
|
|
|
}
|