feat: add dark/light/system theme toggle

Implemented complete theme switching with three modes:
- Light theme
- Dark theme
- System (auto-detect from OS)

Changes:
- Created ModeToggle component with dropdown menu (src/components/mode-toggle.tsx)
- Added theme toggle to desktop header (Index.tsx)
- Enhanced mobile settings with radio group for theme selection (SettingsPage.tsx)
- Changed default theme from "light" to "system" for better UX (App.tsx)

Features:
✅ Seamless theme switching without page reload
✅ Persists user preference in localStorage
✅ System theme auto-detects OS preference
✅ Smooth transitions between themes
✅ Works on both mobile and desktop

Desktop: Theme toggle button in top navigation
Mobile: Theme settings in Settings page with Light/Dark/System options
This commit is contained in:
Claude committed 2025-11-27 13:31:19 +00:00
1 parent cc635f786f
commit 21d3f7057f
4 files changed
+64 -15

No files matched your search

+3
View File
@@ -32,6 +32,7 @@ import { ConfirmModal } from "@/components/modals/ConfirmModal";
import { InputModal } from "@/components/modals/InputModal";
import { AddUserModal } from "@/components/modals/AddUserModal";
import { compressImage, formatFileSize } from "@/utils/imageCompression";
import { ModeToggle } from "@/components/mode-toggle";
// ===== FONCTIONS UTILITAIRES TIMEZONE EUROPE/PARIS =====
@@ -923,6 +924,8 @@ const Index = () => {
Nouvelle Note
</Button>
<ModeToggle />
{user && (
<DropdownMenu>
<DropdownMenuTrigger asChild>