mirror of
https://github.com/R0m1k3/noteflow.git
synced 2026-10-11 17:29:37 +02:00
feat: déplacer les statistiques dans un modal popup
- Créer un nouveau composant StatsModal pour afficher les statistiques - Ajouter une icône BarChart3 dans le header à côté du bouton de thème - Retirer le StatsDashboard de sa position sous le calendrier - Afficher les statistiques dans un modal au clic sur l'icône
This commit is contained in:
2 files changed
+50
-4
No files matched your search
@@ -0,0 +1,31 @@
|
||||
import {
|
||||
Dialog,
|
||||
DialogContent,
|
||||
DialogHeader,
|
||||
DialogTitle,
|
||||
} from "@/components/ui/dialog";
|
||||
import { StatsDashboard } from "./StatsDashboard";
|
||||
import { Note } from "@/services/NotesService";
|
||||
import { Todo } from "@/services/TodosService";
|
||||
|
||||
interface StatsModalProps {
|
||||
open: boolean;
|
||||
onOpenChange: (open: boolean) => void;
|
||||
notes: Note[];
|
||||
todos: Todo[];
|
||||
}
|
||||
|
||||
export function StatsModal({ open, onOpenChange, notes, todos }: StatsModalProps) {
|
||||
return (
|
||||
<Dialog open={open} onOpenChange={onOpenChange}>
|
||||
<DialogContent className="max-w-2xl max-h-[80vh] overflow-y-auto">
|
||||
<DialogHeader>
|
||||
<DialogTitle className="text-2xl">Statistiques</DialogTitle>
|
||||
</DialogHeader>
|
||||
<div className="mt-4">
|
||||
<StatsDashboard notes={notes} todos={todos} />
|
||||
</div>
|
||||
</DialogContent>
|
||||
</Dialog>
|
||||
);
|
||||
}
|
||||
+19
-4
@@ -15,7 +15,7 @@ import { Command, CommandEmpty, CommandGroup, CommandInput, CommandItem, Command
|
||||
import { RichTextEditor } from "@/components/RichTextEditor";
|
||||
import {
|
||||
PlusCircle, Search, User, LogOut, Settings, ChevronDown, Plus, Archive, Trash2,
|
||||
Image as ImageIcon, CheckSquare, FileText, Rss, ExternalLink, RefreshCw, Key, Zap, Paperclip, X, Edit, Calendar as CalendarIcon, Tag as TagIcon, MessageSquare, Send, Check, ChevronsUpDown, Star, Activity, FileDown, LayoutGrid, List, Sparkles
|
||||
Image as ImageIcon, CheckSquare, FileText, Rss, ExternalLink, RefreshCw, Key, Zap, Paperclip, X, Edit, Calendar as CalendarIcon, Tag as TagIcon, MessageSquare, Send, Check, ChevronsUpDown, Star, Activity, FileDown, LayoutGrid, List, Sparkles, BarChart3
|
||||
} from "lucide-react";
|
||||
import AuthService from "@/services/AuthService";
|
||||
import AdminService from "@/services/AdminService";
|
||||
@@ -42,6 +42,7 @@ import { KanbanBoard } from "@/components/KanbanBoard";
|
||||
import { getSmartTagSuggestions } from "@/utils/smartTags";
|
||||
import { QuickCaptureWidget } from "@/components/QuickCaptureWidget";
|
||||
import { StatsDashboard } from "@/components/StatsDashboard";
|
||||
import { StatsModal } from "@/components/StatsModal";
|
||||
import { KeyboardShortcutsHelp } from "@/components/KeyboardShortcutsHelp";
|
||||
import { useKeyboardShortcuts, type KeyboardShortcut } from "@/hooks/useKeyboardShortcuts";
|
||||
|
||||
@@ -1093,6 +1094,15 @@ const Index = () => {
|
||||
Nouvelle Note
|
||||
</Button>
|
||||
|
||||
<Button
|
||||
variant="ghost"
|
||||
size="icon"
|
||||
onClick={() => setShowStatsDashboard(true)}
|
||||
title="Statistiques"
|
||||
>
|
||||
<BarChart3 className="h-5 w-5" />
|
||||
</Button>
|
||||
|
||||
<ModeToggle />
|
||||
|
||||
{user && (
|
||||
@@ -1262,9 +1272,6 @@ const Index = () => {
|
||||
)}
|
||||
</CardContent>
|
||||
</Card>
|
||||
|
||||
{/* Statistics Dashboard */}
|
||||
<StatsDashboard notes={notes} todos={todos} />
|
||||
</div>
|
||||
|
||||
{/* Middle Column: Notes or Open Note */}
|
||||
@@ -3149,6 +3156,14 @@ const Index = () => {
|
||||
shortcuts={keyboardShortcuts}
|
||||
/>
|
||||
|
||||
{/* Statistics Modal */}
|
||||
<StatsModal
|
||||
open={showStatsDashboard}
|
||||
onOpenChange={setShowStatsDashboard}
|
||||
notes={notes}
|
||||
todos={todos}
|
||||
/>
|
||||
|
||||
{/* Quick Capture Widget */}
|
||||
<QuickCaptureWidget onNoteCaptured={loadNotes} />
|
||||
</div>
|
||||
|
||||
Reference in new issue
Block a user